filmov
tv
Python Create Maps with GeoPandas
Показать описание
In this python tutorial, we will go over how to make maps with GeoPandas.
Topics Covered: geopandas, geodataframes, geoseries, geopandas map layers, convert pandas dataframe to geodataframe, geopandas plots, geopandas subplots, geopandas plot points, geopandas choropleth map, geopandas grouping, geopandas add background map using contextily, geopandas filter geodataframes, geopandas centroids, geopandas distance between centroids, geopandas area, geopandas buffer, geopandas boundary, geopandas intersects, geopandas with folium, geopandas with geojson, geopandas crs, geopandas convert crs, geopandas with cartopy, geopandas with geoplot, geodataframe to excel, geodataframe to geojson, geodataframe to shapefile, geopandas geocode, using geopandas with QGIS
NOTES:
*Install instructions - see my tutorial titled: Python Create Package Environments with Anaconda Navigator (example uses geopandas). Extra packages will need to be installed along with geopandas to run the examples.
*Tricky/complex parts are (crs, projections, epsg) and converting measurements into desired units
*Map projections and coordinate reference systems is a complex topic. When working with projections and coordinate reference systems, I often have to do a lot of research and sometimes I still can’t find what I am looking for. In the end, I usually try to make sure what I have chosen works well for the task at hand or analysis I am trying to complete and the map I am creating.
*Map projections try to portray the surface of the earth, or a portion of the earth, on a flat piece of paper or computer screen. In layman’s terms, map projections try to transform the earth from its spherical shape (3D) to a planar shape (2D). A coordinate reference system (CRS) then defines how the two-dimensional, projected map in your GIS relates to real places on the earth. The decision of which map projection and CRS to use depends on the regional extent of the area you want to work in, on the analysis you want to do, and often on the availability of data. Source: QGIS Documentation
*See Plotting polygons with Folium section in GeoPandas documentation for example of going from projected crs to geographic and back to projected
*Sources for shapefiles - United States Geological Survey (USGS), US Census Bureau, Natural Earth, GADM, ArcGIS Hub and ESRI (Environmental Systems Research Institute), Local University / College websites often have shapefiles available
*Not exactly sure what the natural earth GDP numbers are showing
*GeoDataFrames can have more than one column with geometry but only one default active geometry column at a time
*For the grouping - aggregation with dissolve example, grouped variable name used but a better variable name should be used because nothing is actually grouped yet here
*In the folium geojson example the Indiana counties are already in a geographic projection but we do show how to convert the crs if needed. If you use the Boroughs of New York City example in the geopandas documentation, the crs starts as projected.
*I just updated to geopandas 0.10.2 and there is an option to use explore() with a geodataframe to create leaflet maps and overlay other map layers. Below is and example of the code:
Topics Covered: geopandas, geodataframes, geoseries, geopandas map layers, convert pandas dataframe to geodataframe, geopandas plots, geopandas subplots, geopandas plot points, geopandas choropleth map, geopandas grouping, geopandas add background map using contextily, geopandas filter geodataframes, geopandas centroids, geopandas distance between centroids, geopandas area, geopandas buffer, geopandas boundary, geopandas intersects, geopandas with folium, geopandas with geojson, geopandas crs, geopandas convert crs, geopandas with cartopy, geopandas with geoplot, geodataframe to excel, geodataframe to geojson, geodataframe to shapefile, geopandas geocode, using geopandas with QGIS
NOTES:
*Install instructions - see my tutorial titled: Python Create Package Environments with Anaconda Navigator (example uses geopandas). Extra packages will need to be installed along with geopandas to run the examples.
*Tricky/complex parts are (crs, projections, epsg) and converting measurements into desired units
*Map projections and coordinate reference systems is a complex topic. When working with projections and coordinate reference systems, I often have to do a lot of research and sometimes I still can’t find what I am looking for. In the end, I usually try to make sure what I have chosen works well for the task at hand or analysis I am trying to complete and the map I am creating.
*Map projections try to portray the surface of the earth, or a portion of the earth, on a flat piece of paper or computer screen. In layman’s terms, map projections try to transform the earth from its spherical shape (3D) to a planar shape (2D). A coordinate reference system (CRS) then defines how the two-dimensional, projected map in your GIS relates to real places on the earth. The decision of which map projection and CRS to use depends on the regional extent of the area you want to work in, on the analysis you want to do, and often on the availability of data. Source: QGIS Documentation
*See Plotting polygons with Folium section in GeoPandas documentation for example of going from projected crs to geographic and back to projected
*Sources for shapefiles - United States Geological Survey (USGS), US Census Bureau, Natural Earth, GADM, ArcGIS Hub and ESRI (Environmental Systems Research Institute), Local University / College websites often have shapefiles available
*Not exactly sure what the natural earth GDP numbers are showing
*GeoDataFrames can have more than one column with geometry but only one default active geometry column at a time
*For the grouping - aggregation with dissolve example, grouped variable name used but a better variable name should be used because nothing is actually grouped yet here
*In the folium geojson example the Indiana counties are already in a geographic projection but we do show how to convert the crs if needed. If you use the Boroughs of New York City example in the geopandas documentation, the crs starts as projected.
*I just updated to geopandas 0.10.2 and there is an option to use explore() with a geodataframe to create leaflet maps and overlay other map layers. Below is and example of the code:
Комментарии