Presentation is loading. Please wait.

Presentation is loading. Please wait.

CAMERON GOODALE PAUL RAMIREZ GIS and Python. PyCon 2012 https://us.pycon.org/2012/ March 7 th -11 th in Santa Clara, CA Largest gathering of Python Developers.

Similar presentations


Presentation on theme: "CAMERON GOODALE PAUL RAMIREZ GIS and Python. PyCon 2012 https://us.pycon.org/2012/ March 7 th -11 th in Santa Clara, CA Largest gathering of Python Developers."— Presentation transcript:

1 CAMERON GOODALE PAUL RAMIREZ GIS and Python

2 PyCon 2012 https://us.pycon.org/2012/ March 7 th -11 th in Santa Clara, CA Largest gathering of Python Developers (well over 2000) Lots of big name sponsors and plenty of job offerings Supported ESDSWG Software Reuse WG  To learn about and proliferate open source and GIS

3 Python http://www.python.org/ Open source programming language  Freely usable and distributable, even for commercial use Runs on Window, Linux/Unix, Mac OS X, and has been ported to Java and.NET virtual machines Use version 2.7 over 3.x for now as there are still some libraries that have yet to be ported

4 GDAL/OGR Geospatial Data Abstraction Library  X/MIT style Open Source License  http://www.gdal.org http://www.gdal.org Manipulation of Raster Data Supported Formats http://www.gdal.org/formats_list.html http://www.gdal.org/formats_list.html OGR ships in GDAL source tree  Manipulation of Vector data Python bindings available Plays well with NumPy GIS Swiss Army Knife

5 Shapely http://toblerity.github.com/shapely/ BSD Licensed Geometric objects, predicates, and operations outside the context of a database Manipulation and analysis of planar geometric objects Based on GEOS (i.e. the PostGIS engine) Interoperation with  Well Known Text (WKT)  Well Known Binary (WKB)  Numpy and Python Arrays  Any object that provides GeoJSON-like Python geo interface

6 NumPy http://numpy.scipy.org/ C/C++/Fortran Linear Algebra, N-dimensional arrays BSD License PyNGL and PyNIO  From NCAR  License on Earth System Grid site.

7 Pandas http://pandas.pydata.org/ Data Analysis New BSD License Great Video from a PyCon Tutorial  http://blog.lambdafoundry.com/tutorial-data-analysis-in- python-with-pandas-at-pycon-2012/

8 pyKML Python library for creating, parsing, manipulating, and validating KML BSD License http://packages.python.org/pykml/

9 ArcPy http://help.arcgis.com/en/arcgisdesktop/10.0/help/ index.html#/What_is_ArcPy/000v000000v70000 00/ http://help.arcgis.com/en/arcgisdesktop/10.0/help/ index.html#/What_is_ArcPy/000v000000v70000 00/ ESRI Python Library License ? ArcGIS scripting to do geographic data analysis, data conversion, data management, and map automation Access to geoprocessing tools Integrated with ESRI ArcGIS Suite

10 Mapnik http://mapnik.org/ Toolkit for Developing Mapping Apps Written in C++  Can be used with XML, Python, and node.js Runs on Linux, OS X, Windows License LGPL

11 TileStache http://tilestache.org/ Python-based Tile Server Simpler version of Tilecache (http://tilecache.org/) Runs on Linux, OS X, Windows License BSD

12 GeoDjango http://geodjango.org/ GIS for Django Supports Multiple Databases  PostgreSQL + PostGIS  Oracle Spatial  Spatialite  MySQL (least functional) License BSD

13 Leaflet http://leaflet.cloudmade.com/ Mapping component to support vector and image data Still early in development but very usable Replacement for Google Maps Many people moving away due to Google’s recent changes Similar to OpenLayers but more compact and modern

14 QGIS http://www.qgis.org/ GPL License Desktop Software akin ArcGIS for Desktop Can be extended through plugins Several ways to interact with Python http://qgis.org/pyqgis-cookbook/intro.html http://qgis.org/pyqgis-cookbook/intro.html  Integrated Python Console  Write a Python Plugin  Write a python application to automate some process or create a GUI to measure data, export a map to PDF, etc.

15 Contact Us Cameron Goodale cgoodale@jpl.nasa.gov @sigep311 Paul Ramirez pramirez@jpl.nasa.gov @pramirez624

16 Backups

17 GDAL Example >>> import gdal >>> from gdalconst import * >>> dataset = gdal.Open(‘MOD09GA.A2012081.h23v08.005.2012083065418.hdf’) >>> dataset.GetMetadata('SUBDATASETS') >>> state_1km = gdal.Open(dataset.GetMetadata('SUBDATASETS')['SUBDATASET_2_NAME']) >>> state_1km.GetProjection() 'PROJCS["unnamed",GEOGCS["Unknown datum based upon the custom spheroid",DATUM["Not specified (based on custom spheroid)",SPHEROID["Custom spheroid",6371007.181,0]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],P ROJECTION["Sinusoidal"],PARAMETER["longitude_of_center",0],PARAMETER["false_easti ng",0],PARAMETER["false_northing",0],UNIT["Meter",1]]’ >>> layer = state_1km.ReadAsArray() >>> type(layer) >>> layer.shape (1200, 1200) >>> state_1km = None >>> dataset = None

18 OGR Example >>> import ogr >>> datasource = driver.Open(‘sites.shp') >>> layer = datasource.GetLayer() >>> feature = layer.GetNextFeature() >>> while feature:... cover = feature.GetFieldAsString('cover')... geom = feature.GetGeometryRef()... print "x: %s y: %s" % (geom.GetX(), geom.GetY())... feature.Destroy()... feature = layer.GetNextFeature()... x: 455552.418361 y: 4641822.05368 x: 449959.840851 y: 4633802.50858 >>> datasource.Destroy()

19 Shapely Example >>> from shapely.geometry import Point, LineString, LinearRing, Polygon >>> Point(0,0).distance(Point(1,1)) 1.4142135623730951 >>> donut = Point(0, 0).buffer(2.0).difference(Point(0, 0).buffer(1.0)) >>> donut.area 9.409645471637816 >>> line = LineString([(0, 0), (1, 1)]) >>> line.length 1.4142135623730951 >>> line.coords[1:] [(1.0, 1.0)] >>> ring = LinearRing([(0, 0), (1, 1), (1, 0)]) >>> ring.length 3.414213562373095 >>> polygon = Polygon([(0, 0), (1, 1), (1, 0)]) >>> polygon.area 0.5 >>> LineString([(0, 0), (1, 1)]).contains(Point(0.5, 0.5)) True >>> Point(0.5, 0.5).within(LineString(coords)) True


Download ppt "CAMERON GOODALE PAUL RAMIREZ GIS and Python. PyCon 2012 https://us.pycon.org/2012/ March 7 th -11 th in Santa Clara, CA Largest gathering of Python Developers."

Similar presentations


Ads by Google