Database Reference
In-Depth Information
ThesixthrecipewillshowyouhowtocreateaPL/Pythonfunctionusingthe geopy
librarytogeocodeaddressesusingwebgeocodingAPI suchasGoogleMaps,Ya-
hoo! Maps, Geocoder.us, GeoNames, and other ones.
Inthelastrecipeofthischapter,youwillcreateaPythonscripttoimportdatafrom
the netCDF format to PostGIS using the GDAL Python bindings.
Let's see some notes before starting with the recipes in this chapter.
If you are using Linux, follow these steps:
1. CreateaPython virtualenv ( http://www.virtualenv.org/en/latest/ )tosetup
a Python-isolated environment to be used for all the Python recipes in this
bookandactivateit.Createitinacentraldirectory,asyouwillneedtouseit
for most of the Python recipes of this topic.
$ cd ~/virtualenvs
$ virtualenv --no-site-packages
postgis-cb-env
$ source postgis-cb-env/bin/activate
2. Onceactivated,youcaninstallthePythonlibrariesyouwillneedforthere-
cipes in this chapter:
$ pip install simplejson
$ pip install psycopg2
$ pip install numpy
$ pip install gdal
$ pip install geopy
3. Incaseyouarenewtothevirtualenvironmentandyouarewonderingwhere
the libraries have been installed, you should find everything in the vir-
tualenv directoryinourdevelopmentbox.Youcanfindthelibrariesusing
the following command:
$ ls /home/capooti/virtualenv/
postgis-cb-env/lib/python2.7/site-packages
Search WWH ::




Custom Search