[postgis-users] Looking why st_within not working between point3d with box3d

Bruno Friedmann bruno at ioda-net.ch
Sat Sep 12 09:39:15 PDT 2009


Hi All

I'm facing strange results which I can't explain.
So any help or idea are welcome.

Here the context
Table of point in 3d have been setup.


SELECT
 st_asewkt(the_geom),
 GeometryType(the_geom),
 NDims(the_geom),
 ZMFlag(the_geom)
 from dom limit 2;

which seems to return correct 3d point

"SRID=21781;POINT(602499.98 233307.35 1026.73)";"POINT";3;2
"SRID=21781;POINT(602499.98 233326.89 1046.81)";"POINT";3;2


The full extend of data is
"BOX3D(598125 233000 631.03,602499.98 235999.98 1316.91)"

Now I try to select rows inside a predefined box

select id,est,nord,alti_u  from dom_1106_42_03
WHERE st_within(
 the_geom,
 st_setsrid(
 st_makebox3d (
	GeomFromEWKT('SRID=21781;POINT( 598995 233995 500)'),
	GeomFromEWKT('SRID=21781;POINT( 599005 234005 1000)')
  )
 ,21781)
)

In this part alti Z is not above 1200 meters so I should not find anything
but I've got results like this :

id	est		nord	 alti
2774523;598995.1600;234002.1500;1209.8700
2775215;598995.3800;234001.0900;1210.2600
2775297;598995.4000;233999.6300;1207.7600

It's ok for x,y but not Z
I don't understand where my problem reside.

Thanks a lot in advance.


-- 

     Bruno Friedmann




More information about the postgis-users mailing list