[postgis-users] ST_GeomFromText function doubt

Paul Ramsey pramsey at opengeo.org
Wed Oct 27 14:33:06 PDT 2010


Try this:

SELECT name, the_geom,
ST_AsText(the_geom),ST_GeomFromText(ST_AsText(the_geom),ST_SRID(the_geom)) FROM
nyc_subway_stations WHERE name = 'Broad St';

The trouble is that ST_AsText drops the SRID information, so when you
convert that back into a binary geometry, it has a different structure
than the binary structure that includes the SRID.

P.

On Wed, Oct 27, 2010 at 2:29 PM, Paul Alarcon <pag66.06 at gmail.com> wrote:
> Hello users this is my first post i have a dout using this function, i'm
> newbie in postgis and try to underestand the spatial relation function.
> im using the follwing query
> SELECT name, the_geom,
> ST_AsText(the_geom),ST_GeomFromText(ST_AsText(the_geom)) FROM
> nyc_subway_stations WHERE name = 'Broad St';
> but the_geom field is not the same as te ST_geomfrom text field, what is
> wrong ?
> Thanks a lot
> greetings Paul
>
>
> _______________________________________________
> 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