Pergunta

I am trying to calculate the distances between points in PostgreSQL, and now I have the longitude and latitude value for each point, and I know it's from GPS(WGS84).

Because all the points are in same city, and not very far from each other, so I know that use geometry with a local cartesian projection is better, because compared with using geography, it needs less calculation.

My question is how can I find the suitable cartesian projection for my data? If I can find one, is it the SRID value which should be used in ST_Transform?

Thank you very much!

Foi útil?

Solução 2

I have found the SRID I need in this page:http://help.arcgis.com/en/arcgisserver/10.0/apis/rest/pcs.html and this page:http://help.arcgis.com/en/arcgisserver/10.0/apis/rest/gcs.html , and use ST_Transform to transfer the WGS84 coordinate to local cartesian coordinate, and can get the distance result in Unit meter.

Hope this can help others :)

Outras dicas

Using Postgis is not necessary just to calculate distance between points.

You can use this gist to have a simple distance computation (distances are in Km). You can also use the earthdistance extension.

Licenciado em: CC-BY-SA com atribuição
Não afiliado a StackOverflow
scroll top