[postgis-users] problem with multilinestring
Vladimir Guzmán
vguzman at maintask.com
Sun Feb 8 16:18:06 PST 2004
I made a test with a new table, and it worked, so I realised that the
problem has something to do with the table itself.
I don't know exactly where the problem was, but I made a dump with the
options:
pg_dump -d -D -t arcos database > database.sql
And then, I drop the table and re-create it with the dump file.
Otherwise, I wasn't able to get the right results in the query.
Thanks a lot for your help.
Best regards,
Vladimir Ilich Guzmán R.
------------------------
http://www.maintask.com
Vladimir Guzmán wrote:
> 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,
>
More information about the postgis-users
mailing list