[postgis-users] Re: maps google problem with SRID

lisek lichu lisek.lichu at gmail.com
Wed Nov 26 16:36:34 PST 2008


hello, I found an answer for question 4:

I can use ST_length_spheroid

select ST_length_spheroid(GeomFromText('LINESTRING(0 0,90
0)',4326),'SPHEROID["WGS 84",6378137,298.257223563]');
i get 10018754.1713946 so it is OK

select ST_length_spheroid(GeomFromText('LINESTRING(0 45,90
45)',4326),'SPHEROID["WGS 84",6378137,298.257223563]');
i get 6690232.93269468 so it is smaller as should be

select ST_length_spheroid(GeomFromText('LINESTRING(0 90,90
90)',4326),'SPHEROID["WGS 84",6378137,298.257223563]');
and at the north pole I get 0 so SUPER!

But is it a good way to calculate the length??

I found in PostGIS Reference:
ST_length_spheroid(geometry,spheroid) Calculates the length of of a geometry
on an ellipsoid. *This is useful if the coordinates of the geometry are in
latitude/longitude and a length is desired without reprojection.*

so is there any other way to do that? maybe it is faster with reprojection?

Simon
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/postgis-users/attachments/20081127/584daa61/attachment.html>


More information about the postgis-users mailing list