[gdal-dev] Resulting geometry from OGRGeometry::difference somehow got simplified

mikeucfl mikeucfl at gmail.com
Thu Jan 18 20:39:28 PST 2018


So the geometry before using the difference operation looks good (geodetic
values go up to 8-9 decimal places), and then the resulting geometry is
truncated to two (this is before placing in any file geodatabase) as well. I
have checked the source feature classes and verified that the precision is
set to 0.00000001, so looks good to me there.

One odd thing I noticed too is I output the two problematic geometries to a
new file geodatabase so I could iterate on the problem quicker, but when I
did that it tells me one of the geometries is invalid and the resulting
difference geometry is NULL. I had to do a geometry->buffer(0.0) to repair
it, and got valid geometry coming out.. but when I run it from the original
source all the geometries say they're valid and even forcing a buffer(0.0)
doesn't seem to fix it.

Really odd problem, not sure what's going on.. especially since my small
test case doesn't seem to re-create what the large dataset does. I'm
wondering if writing the geometry out is not the exact same as it was in
memory and possibly modifying the values? That would make some sense as to
why I see different results.. but again, kinda lost on what's going on.



--
Sent from: http://osgeo-org.1560.x6.nabble.com/GDAL-Dev-f3742093.html


More information about the gdal-dev mailing list