[postgis-users] Bug?
Michael Fuhr
mike at fuhr.org
Wed Feb 7 07:23:03 PST 2007
On Wed, Feb 07, 2007 at 02:16:20PM -0000, Pedro Doria Meunier wrote:
> During my difficulties with the distance() function (which btw, returns
> values (in srid=4326) that don't make sense to me) I found this:
distance() returns distances in the same units that the geometries
have. If the units are degrees then distance() returns degrees;
if the units are meters then distance returns meters; if the units
are stadia then distance() returns stadia.
> A query like this works as expected (geom with srid=4326):
>
> select transform(mygeom, 2942) from my_table;
You say "works as expected" -- what are you expecting? What's the
input and what's the output? Without AsText() or AsEWKT() the above
query should return something like
01010000207E0B0000000000000000F07F000000000000F07F
> but when one tries this:
>
> select astext(transform(mygeom,2942)) from my table
>
> the result is:
>
> "POINT(inf inf)"
Apparently the coordinates can't be translated to SRID 2942, perhaps
because they're not really in the SRID specified in their original
geometry. For example:
SELECT AsText(Transform(GeomFromEWKT('SRID=4326;POINT(3241 -1648)'), 2942));
astext
----------------
POINT(inf inf)
(1 row)
This doesn't work because (3241 -1648) isn't really in SRID 4326,
whose coordinates should be longlat.
--
Michael Fuhr
More information about the postgis-users
mailing list