Attempts at Python 3.x + GIS work with pyshp, osgeo, matplotlib.basemap
Learning about Python and GIS as I go...
Attempting to do everything in Python 3.x, as supplied by Anaconda.
Libraries I have successfully used
I've been able to install these libraries and use them on OSX and Python 3.5, via the Anaconda installer:
- fiona - friendly API for handling of different shapefile formats.
- shapely - geospatial analysis
- descartes - converts geometric objects into paths and patches for Matplotlib.
- geopandas - wraps up the above libraries with Pandas DataFrames
- basemap - Matplotlib's geographic mapping library
Plotting data on maps
Trying to use matplotlib's basemap to do geospatial visualizations.
Installed basemap via
conda install basemap
Created earthquake scatterplot on Earth map layer: gist
Rendered mapviz as part of matplotlib grids viz_subplotmaps.py
Working with shapefiles
Use basemap to read shapefile and project
Successfully plotted Census shapefile that's already in epsg:4326
Check it out: plot_census_counties.py
Plot shapefiles that aren't in lat/lng format by first using [Geopandas to reproject to esri:4326](notebooks/Geopandas%20on%20OS%20X%20and%20Anaconda%20+%20Python 3.5.ipynb)
Concatenated shapefiles and converted shapefiles into GeoJSON (blog post on Census population estimates)
Trying to re-project a shapefile in Python using pyshp:
- Installed pyshp
pip install pyshp
- Attempted to emulate example: Reproject a Polygon Shapefile using PyShp and PyProj
Projecting coordinates with pyproj
- Installed pyproj via
conda install pyproj
- Successfully projected coordinates
- See use of pyproj to translate X/Y coordinates in NYPD stops-and-frisks data to lng/lat: dannguyen/python-notebooks-data-wrangling -- wrangling-nypd-frisks.py
- See early attempts at using pyproj (and caveat about its configuration): Getting inaccurate results converting from New York State projection to NAD83 with Python's pyproj