[postgis-users] Working with point data from google maps in postgis

Paul Ramsey pramsey at refractions.net
Fri Jan 12 20:39:47 PST 2007


While the maps displayed by Google Maps are in mercator, the Google  
Maps API never returns any mercator units, it only returns lat/lon,  
so you can just use 4326 as the SRID for your data.

To do distance calculations, use distance_sphere (fast, less  
accurate) or distance_spheroid (slow, very accurate).

P

On 12-Jan-07, at 6:33 PM, Rob Young wrote:

> I'm looking to make a small application with google maps and  
> postgis, where I would enter spatial data into postgis via an  
> interface that would use a (google) map to define lat/long points.   
> I'm pretty familiar with databases, and know just enough about  
> projection systems to know I don't know that much.  ;)  I am  
> concerned about getting the following right, as I know if I don't I  
> will be introducing errors into any calculations I attempt with  
> postigs queries.
>
> I'm not completely sure which SRID to use with Google maps point  
> data.  I have found the following helpful message, but I was hoping  
> to confirm that.
>
> http://postgis.refractions.net/pipermail/postgis-users/2005- 
> November/009920.html
>
> If google maps does use the GRS 80 projection and a mercator  
> projection, which SRID should I use when creating postgis tables to  
> store said data?  There are quite a few GRS 80 types in the  
> spatial_ref_sys table.  I know enough to know that choosing the  
> correct one is important, but am really in the dark as to which one  
> I should actually choose!  :)
>
> Also, I will be interested in doing distance based queries (like  
> everyone) on this data once it's in the database.  The postgis  
> function length uses the project you associate with the geometry  
> data, correct?  And the units of the number it returns is specified  
> by the SRID?
>
> Thanks for the help,
>
> Robert Y
> _______________________________________________
> postgis-users mailing list
> postgis-users at postgis.refractions.net
> http://postgis.refractions.net/mailman/listinfo/postgis-users

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/postgis-users/attachments/20070112/4bb86cc2/attachment.html>


More information about the postgis-users mailing list