Opened 9 years ago

Closed 9 years ago

#3072 closed defect (fixed)

ST_Intersects sfcgal implementation gives error with polyhedral surface

Reported by: robe Owned by: colivier
Priority: medium Milestone: PostGIS 2.2.0
Component: sfcgal Version: 2.1.x
Keywords: Cc:

Description

I can't compare to the built in ST_Intersects since that one throws a polyhedralsurface not supported error.

I have this:

set postgis.backend = sfcgal;
WITH pa AS ( SELECT ST_Extrude(ST_Force3D(ST_GeomFromText('MULTIPOLYGON(((6011980.6923649 2117710.26819432,6011983.40466805 2117690.92097183,
6011988.97899699 2117691.72493859,6012014.67481019 2117512.89736198,6011838.71290818 2117490.73975961,6011813.97754787 2117666.48492323,
6011961.83622488 2117687.8102276,6011958.87617183 2117707.03845887,6011980.6923649 2117710.26819432)))',2227)),0,0,860) As geom ),
drone As ( SELECT 
    ST_Translate( 
        ST_Force3D( 
            ST_Transform(ST_GeomFromText('POINT(-122.4028 37.7952)',4326),2227) ),
        0, 0, z) As geom, z
 FROM generate_series(500,1000, 500) As z )
SELECT z
FROM drone INNER JOIN pa ON ST_Intersects(drone.geom, pa.geom);

I get this error:

NOTICE:  During intersects(A,B) :
NOTICE:    with A: POINT(6455232916477051/1073741824 2273757146426363/1073741824 500/1)
NOTICE:     and B: GEOMETRYCOLLECTION(POLYHEDRALSURFACE(((6455315114472671/1073741824 4547748172148997/2147483648 0/1,3227659013393001/536870912 4547706624305065/2147483648 0/1,3227662006088063/536870912 568463543851317/268435456 0/1,1613837900711365/268435456 227


This is using:

POSTGIS="2.2.0dev r13298" GEOS="3.5.0dev-CAPI-1.9.0 r4048" SFCGAL="1.0.5" PROJ="Rel. 4.8.0, 6 March 2012" GDAL="GDAL 1.11.1, released 2014/09/24" LIBXML="2.7.8" LIBJSON="0.12" RASTER

I was expecting this to give me the footprint intersection.

On another note — I thought if I used ST_Extrude in 2.2, that the ST_3DInteresects would give me a solid intersection (bit would be set to solid), it seems not to. I'll bring this up on dev list.

Attachments (1)

issue_3072.patch (1.3 KB ) - added by vmo 9 years ago.

Download all attachments as: .zip

Change History (4)

comment:1 by robe, 9 years ago

oops forgot to state the error:

ERROR:  When converting to 2D - GeometryCollection is invalid : PolyhedralSurface 0 is invalid: inconsistant orientation of PolyhedralSurface detected at edge 2 (0-0) of polygon 9 : GEOMETRYCOLLECTION(POLYHEDRALSURFACE(((6455315114472671/1073741824 45477481721489
********** Error **********

ERROR: When converting to 2D - GeometryCollection is invalid : PolyhedralSurface 0 is invalid: inconsistant orientation of PolyhedralSurface detected at edge 2 (0-0) of polygon 9 : GEOMETRYCOLLECTION(POLYHEDRALSURFACE(((6455315114472671/1073741824 45477481721489
SQL state: XX000

by vmo, 9 years ago

Attachment: issue_3072.patch added

comment:2 by colivier, 9 years ago

Commited as r13778.

Nota: I think it's more like a bugfix than a a new feature, but could be reverse if you think the otherway, to respect freeze…

comment:3 by colivier, 9 years ago

Resolution: fixed
Status: newclosed
Note: See TracTickets for help on using tickets.