12
Python GeoSpatial Analysis https://www.jasondavies.com/maps/transition /

Geo spatial python princeton pug

Embed Size (px)

Citation preview

Page 1: Geo spatial python   princeton pug

Python GeoSpatial Analysis

https://www.jasondavies.com/maps/transition/

Page 2: Geo spatial python   princeton pug

GeoSpatial Python• GeoSpatial analysis• Key concepts

• Representations of the earth• Projections• Coordinate Systems• Geometry• Remote Sensing • GeoFunctions

• Software • Geo Foundations• Python

Page 3: Geo spatial python   princeton pug

About me• by day

• Traveling salesman in wireless communications • Network neurologist• Mobile networking

• by night• Pythonista (middling)• Music • Photography

• Education• West Windsor Plainsboro High School• Thomas Edison State College, BSBA• Lehigh University, MBA

DonHolloway

DonHolloway

DonHolloway

Page 4: Geo spatial python   princeton pug

Geospatial Fundamentals• Statistical analysis + place• Spatial

• Points of Interest• Geolocation• Geometry

• Analysis• Big Data• Familiar tools

• Numpy• Pandas• Pillow

• Visualization

Terrestrial scale - shape and sizeNaming of placesNeed for rigour – coordinate systems and datums2D vs 3D perspectives on geospatial issues

Page 5: Geo spatial python   princeton pug

Representations of the Earth Map Globe Oblate Spheroid

datum• a set of reference points on the Earth's surface against which position

measurements are made• North American Datum of 1927 (NAD27)• NAD83 (adopted internationally as GRS80)• World Geodetic System 1984 (WGS84)

Page 6: Geo spatial python   princeton pug

ProjectionsProjections convert spherical coordinates (lat-long) to planar coordinates.

Three primary types:• Azimuthal: projection onto a planar surface• Cylindrical: projection onto a cylinder, which is then ‘unrolled’ to a plane.• Conic: projection onto a cone, which can be unrolled to a plane.

All projections create distortions of shape, area, or distanceWeb Mercator (EPSG:3857) – Used by Google maps, OpenStreet Maps• Cylindrical – Uses ellipsoidal coordinate data, spherical calculations

Page 7: Geo spatial python   princeton pug

Coordinate Systems• Geographic (Lat-Long)

• UTM (Universal Transverse Mercator) • Worldwide system with units in meters• In Northern hemisphere, Y coordinate (northing) is distance in meters from equator• X-coordinate (easting) is distance in meters east from a central meridian for a zone• Consists of 60 zones each 6 degrees wide

• State Plane Coordinate System (SPCS) • Different for each state• Some states divided into multiple zones with different grid systems for each zone• Either Transverse Mercator (NJ) or conical (PA * 2) projections

Page 8: Geo spatial python   princeton pug

Geometry (vectors)• Vector Data

• Points, Lines, Polygons• Spatial representation

• WKT, WKB• Simple features spec

• Points of Interest• Shapefiles

• Semi Proprietary• Loosely structured• Decades of data

• GeoJSON• Emerging open standard

• Tools• GEOS / Shapely• OGR / Fiona• Geojson• PyShp• dbfpy

https://njgin.state.nj.us/NJ_NJGINExplorer/index.jsp

NJ MunicipalitiesEarthquake epicenters

Page 9: Geo spatial python   princeton pug

Remote Sensing Imagery(Raster)• “Image-like”• Typical formats

• TIFF (tags inherent)• JPEG (exif), GIF, BMP and PNG(world files)

• Alternates• BLOB, NetCDF

• Resolution is specified in ground distance thateach cell represents• GDAL / Pillow / OpenCV

Landsat 8 – acquired 2/2/2016

Page 10: Geo spatial python   princeton pug

Geospatial functions• Bounding Box• Convex Hull• Buffer / erode• Dissolve• Generalize• Intersection• Merge• Point in Polygon• Union

Environment:WindowsPython 3.4Anaconda package

Page 11: Geo spatial python   princeton pug

Software• Geo Foundations• GDAL,OGR, Geos, PROJ4

• Geo General Purpose• QGIS, PostGIS, MapServer

• Analysis• Pandas, Numpy, Pillow, PostGIS, Matplotlib

• Python • geoPandas*(pandas), shapely (geos), pyproj(proj4), Fiona(OGR), geopy

(geolocation), Descartes(matplotlib),

Page 12: Geo spatial python   princeton pug

References• Resources• Wikipedia list of GIS software - et.gy/1Q327gk• OSGeo project list – www.osgeo.org/

• Data• NJ Shape files - https://njgin.state.nj.us/NJ_NJGINExplorer/index.jsp• Raster images - http://earthexplorer.usgs.govPython libraries/

• Shapely http://toblerity.org/shapely