Database Reference
In-Depth Information
Chapter 8. PostGIS Programming
In this chapter, we will cover the following topics:
• Writing PostGIS vector data with Psycopg
• Writing PostGIS vector data with OGR Python bindings
• Writing PostGIS functions with PL/Python
• Geocoding and reverse-geocoding using the GeoNames datasets
• Geocoding using the OSM datasets with trigrams
• Geocoding with geopy and PL/Python
• Importing netCDF datasets with Python and GDAL
Introduction
ThereareseveralwaystowritePostGISprograms;inthischapter,wewillseeafew
ofthem.YouwillmainlyusethePythonlanguagethroughoutthischapter.Pythonisa
fantasticlanguagewithaplethoraofGISandascientificlibrarythatcanbecombined
with PostGIS to write awesome geospatial applications.
In case you are new to Python, you can quickly get productive with these excellent
web resources:
• The official Python tutorial at http://docs.python.org/2/tutorial/
• The popular Dive into Python book at http://www.diveintopython.net/
• The Learn Python in the hard way class for a task-oriented training at ht-
tp://learnpythonthehardway.org/
You can combine Python with someexcellent and popular libraries such as:
Psycopg :ThisisthemostcompleteandpopularPythonDBAPIimplementa-
tion for PostgreSQL; see http://initd.org/psycopg/
GDAL Python bindings :TheseareusedtounchainthepowerfulGDALlib-
rary in your Python scripts; see http://www.gdal.org/gdal_tutorial.html
urllib2 : This is a handy Python standard library to manage HTTP stuff such
as opening URLs
simplejson : Thisis a simpleand fast JSON encoder/decoder
Search WWH ::




Custom Search