[postgis-users] problem with multilinestring

Vladimir Guzmán vguzman at maintask.com
Sat Feb 7 15:33:47 PST 2004


Hello.

I've got a table named 'arcos', with a MULTILINESTRING geometry named 
'the_geom'.

I need to get the elements that starts or ends at a certain point.

If I query the database with "SELECT the_geom FROM arcos WHERE id=51892;"

I get:
                                                              the_geom
------------------------------------------------------------------------------------------------------------------------------------
 SRID=1;MULTILINESTRING((-74.1835602497749 
4.62941345152032,-74.1837889284997 4.62928942801709,-74.1840390840234 
4.62917486837267))
(1 row)

With the query "SELECT startpoint(the_geom) FROM arcos WHERE id=51892;"
I get:
                    startpoint
--------------------------------------------------
 SRID=1;POINT(-74.1835602497749 4.62941345152032)
(1 row)

But if I try the query: "SELECT id FROM arcos WHERE startpoint(the_geom) 
~= geometryfromtext('POINT(-74.1835602497749 4.62941345152032)',1);"
I get no results:
 id
----
(0 rows)

And the same problem if i try: "SELECT id FROM arcos WHERE 
x(startpoint(the_geom))::float = -74.1835602497749;"
 id
----
(0 rows)


But if instead I try:"SELECT id FROM arcos WHERE 
x(startpoint(the_geom))::text = -74.1835602497749;"
I get:
  id
-------
 51892

But, obviously, this query is very slow, and is not getting the 
geographic capabilities from postgis.
Any ideas?

Thanks in advance,

-- 
Vladimir Ilich Guzmán R.
------------------------
http://www.maintask.com 





More information about the postgis-users mailing list