[postgis-users] strange query with linestring in one point

Szymon Guz mabewlun at gmail.com
Thu Sep 29 02:29:51 PDT 2011


On 29 September 2011 11:20, Sandro Santilli <strk at keybit.net> wrote:

> On Thu, Sep 29, 2011 at 11:14:52AM +0200, Szymon Guz wrote:
> > Hi,
> > I've got a quite strange situation:
> >
> > this works OK, returns something:
> >
> > SELECT ... FROM ... WHERE
> > st_intersects(
> >   geometry,
> >   st_geomfromtext('POINT(3 50)', 4326)
> > );
> >
> > but this returns nothing:
> >
> > SELECT ... FROM ... WHERE
> > st_intersects(
> >   geometry,
> >   st_geomfromtext('POINT(3 50, 3 50 )', 4326)
> > );
>
> The second should raise an exception due to malformed WKT being used.
> Doesn't it ?
>
> --strk;
>
>
The second raises exception only if there is exactly one point. When there
are more points it works OK:

SELECT st_geomfromtext('LINESTRING(3  50)', 4326)
ERROR:  geometry requires more points
HINT:  "LINESTRING(3  50)" <-- parse error at position 17 within geometry

SELECT st_astext(st_geomfromtext('LINESTRING(3 50, 3 50)', 4326))

'LINESTRING(3 50,3 50)'


- Szymon
-- 
*http://simononsoftware.com/* <http://simononsoftware.com/>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/postgis-users/attachments/20110929/f5263c8a/attachment.html>


More information about the postgis-users mailing list