[postgis-users] Meant to ask for PostGIS/Google Maps API using Python

Josh Livni josh at umbrellaconsulting.com
Fri Jan 25 08:58:23 PST 2008


There's two ways to overlay data from PostGIS into Google Maps.  As an 
image overlay (eg WMS), or as vector overlays (if you don't have tons of 
complex data in one view).

WMS:
Assuming you are gonna use Google Maps proper, versus OpenLayers (which 
would make things easier), check out wms236.js for a simple javascript 
that makes it reasonably easy to take your WMS and overlay it in Google 
Maps.  Note that either way, Google uses an 'odd' projection 
(http://spatialreference.org/ref/user/google-projection/) so your WMS 
should be output in that.  However if you are just working with a 
localish area not near the poles, you can probably get away with 
EPSG:4326 for a reasonable close overlay.
A slightly modifed wms236.js called wms_spherical.js that uses this 
projection is in use at http://seattleurbannature.org/Survey/ihm.html 
(which has all its source data in PostGIS).  Again, if you use 
OpenLayers you don't have to deal with this extra bit, but either way 
you do still need your WMS to output in a projection that overlays nicely.

Vectors:
This one's easy:  use FeatureServer (hey - it's even in python).   I'm 
not covering how to parse the GeoJSON and create vector overlays in 
Google Maps here, but that's quite well documented.  Or just load the 
KML directly.  In OpenLayers, the GeoJSON output is easy to turn into 
vector overlays.

Cheers,

  -Josh

PS digest subscribers can get up to the minute reporting online:  
http://postgis.refractions.net/pipermail/postgis-users/ or 
http://www.nabble.com/PostGIS-f1221.html

PPS All the above is just regarding a simple map, no additional 
framework.  Did you say you wanted an actual full fledged framework of 
some kind?  Check GeoDjango maybe - I think they have Google Map 
templates now. 

dnrg wrote:
> Python is my language of choice and I'm sticking with
> it. So, are there any PostGIS/Google Maps API
> integration tutorials using Python?
>
> Python seems to provide the best bang for the buck
> FOSS GIS-wise. And my brain can only store so much
> syntax.
>
> I only subscribe to the Digest version of this list;
> sorry if my question has already been answered.
>
> I am jazzed about the idea of PostGIS/Google Maps
> integration using Python. Would love to see some
> working online examples as well.
>
> Dana
>
>
>
>       ____________________________________________________________________________________
> Looking for last minute shopping deals?  
> Find them fast with Yahoo! Search.  http://tools.search.yahoo.com/newsearch/category.php?category=shopping
> _______________________________________________
> postgis-users mailing list
> postgis-users at postgis.refractions.net
> http://postgis.refractions.net/mailman/listinfo/postgis-users
>   



More information about the postgis-users mailing list