Tuesday 9 August 2016

SDO_Inside equivalent in PostGIS for 3D objects


I am looking for a solution for querying a point whether it is located inside a 3D object or not. If the point is located on the surface of 3D, I could use ST_3DIntersects or ST_3DIntersection.


But, if the point does not touch the surface, but is located inside the exterior, how could I query it?


In short, I am looking for SDO_Inside equivalent in PostGIS for 3D object.


ST_Contains does not support 3D.


Here is an example on using ST_3DIntersects. I chose a point that are inside the region. Result is false.


SELECT ST_3DIntersects(checkpoint,region) As checkpointinregion FROM (SELECT ST_GeomFromText('POINT(2604000 1205000 1500)', 2056) As checkpoint, (SELECT ST_GeomFromText('POLYHEDRALSURFACE(((2600000 1200000 1000, 2600000 1200000 2000, 2600000 1300000 2000, 2600000 1300000 1000, 2600000 1200000 1000)), ((2600000 1200000 1000, 2600000 1300000 1000, 2700000 1300000 1000, 2700000 1200000 1000, 2600000 1200000 1000)), ((2600000 1200000 1000, 2700000 1200000 1000, 2700000 1200000 2000, 2600000 1200000 2000, 2600000 1200000 1000)), ((2700000 1300000 1000, 2700000 1300000 2000, 2700000 1200000 2000, 2700000 1200000 1000, 2700000 1300000 1000)), ((2600000 1300000 1000, 2600000 1300000 2000, 2700000 1300000 2000, 2700000 1300000 1000, 2600000 1300000 1000)), ((2600000 1200000 2000, 2700000 1200000 2000, 2700000 1300000 2000, 2600000 1300000 2000, 2600000 1200000 2000)))', 2056)) As region) as myobjects;


checkpointinregion


f (1 row)





No comments:

Post a Comment

arcpy - Changing output name when exporting data driven pages to JPG?

Is there a way to save the output JPG, changing the output file name to the page name, instead of page number? I mean changing the script fo...