Writing PostGIS vector data with OGR Python bindings

In this recipe, you will use Python and the Python bindings of the GDAL/OGR library to create a script for geocoding a list of the names of places using one of the GeoNames web services (http://www.geonames.org/export/ws-overview.html). You will use the Wikipedia Fulltext Search web service (http://www.geonames.org/export/wikipedia-webservice.html#wikipediaSearch), which for a given search string returns the coordinates of the places matching that search string as the output, and some other useful attributes from Wikipedia, including the Wikipedia page title and url.

The script should first create a PostGIS point layer named wikiplaces in which all of the locations and their attributes ...

Get PostGIS Cookbook - Second Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.