kaggle_courses_geospatial-analysis(1)

Introduction

In this micro-course, you’ll learn about different methods to wrangle and visualize geospatial data, or data with a geographic location.

it seems it is amazing

Along the way, you’ll offer solutions to several real-world problems like:

  • Where should a global non-profit expand its reach in remote areas of the Philippines?
  • How do purple martins, a threatened bird species, travel between North and South America? Are the birds travelling to conservation areas?
  • Which areas of Japan could potentially benefit from extra earthquake reinforcement?
  • Which Starbucks stores in California are strong candidates for the next Starbucks Reserve Roastery location?
  • Does New York City have sufficient hospitals to respond to motor vehicle collisions? Which areas of the city have gaps in coverage?

You’ll also visualize crime in the city of Boston, examine health facilities in Ghana, explore top universities in Europe, and track releases of toxic chemicals in the United States.

In this first tutorial, we’ll quickly cover the pre-requisites that you’ll need to complete this micro-course. And, if you’d like to review more deeply, we recommend the Pandas micro-course.

We’ll also get started with visualizing our first geospatial dataset!

#Reading data

The first step is to read in some geospatial data! To do this, we’ll use the GeoPandas library.

This is a wonderful packages called GeoPandas

While this column can contain a variety of different datatypes, each entry will typically be a Point, LineString, or Polygon.

The “geometry” column in our dataset contains 2983 different Polygon objects, each corresponding to a different shape in the plot above.

In the code cell below, we create three more GeoDataFrames, containing campsite locations (Point), foot trails (LineString), and county boundaries (Polygon).

读入数据

在这里插入图片描述

绘制地图

shu ju z

!!!得到所有国家的地图边界数据

#This dataset is provided in GeoPandas
world_filepath = gpd.datasets.get_path(‘naturalearth_lowres’)
world = gpd.read_file(world_filepath)

!!!画出我中华人民共和国的地图

#This dataset is provided in GeoPandas
world_filepath = gpd.datasets.get_path('naturalearth_lowres')
world = gpd.read_file(world_filepath)

data_China = world[world['name'] == 'China']
data_China.plot(figsize = (10,10) , color=  'none' , edgecolor = 'gainsboro' , zorder = 3)

在这里插入图片描述

画出Kiva慈善组织的在全世界范围内的行善地点

#This dataset is provided in GeoPandas
world_filepath = gpd.datasets.get_path('naturalearth_lowres')
world = gpd.read_file(world_filepath)

ax = world.plot(figsize=(20,20), color='whitesmoke', linestyle=':', edgecolor='black')
world_loans.plot(ax=ax, markersize=2)

在这里插入图片描述

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值