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

Sandro Santilli strk at keybit.net
Thu Sep 29 02:37:03 PDT 2011


On Thu, Sep 29, 2011 at 11:29:51AM +0200, Szymon Guz wrote:
> 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:
> > >
> > > 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 ?
>
> 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)'

Yes, but you wrote 'POINT(3 50, 3 50)' in your first mail :)

Anyway, you're now saying that while POINT(3 50) is reported
to intersect something, LINESTRING(3 50, 3 50) isn't. Correct ?
Can you provide literal data showing this discrepance ?
That is, a query where both operands are in WKT form ?

--strk;

  ()   Free GIS & Flash consultant/developer
  /\   http://strk.keybit.net/services.html



More information about the postgis-users mailing list