Skip to content

Commit

Permalink
OpenFileGDB: exclude straight line segments when parsing arcs
Browse files Browse the repository at this point in the history
  • Loading branch information
dingsl-giser authored and rouault committed Sep 13, 2024
1 parent 7eb028e commit e10ed28
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 1 deletion.
Binary file not shown.
16 changes: 16 additions & 0 deletions autotest/ogr/ogr_openfilegdb.py
Original file line number Diff line number Diff line change
Expand Up @@ -2719,3 +2719,19 @@ def test_ogr_openfilegdb_get_extent_getextent3d():
0.0,
)
)


###############################################################################
# Test reading a geometry where there is an arc with an interior point, but
# it is actually flagged as a line


def test_ogr_openfilegdb_arc_interior_point_bug_line():

with ogr.Open("data/filegdb/arc_segment_interior_point_but_line.gdb.zip") as ds:
lyr = ds.GetLayer(0)
f = lyr.GetNextFeature()
ogrtest.check_feature_geometry(
f,
"MULTILINESTRING ((37252520.1717 7431529.9154,38549084.9654 758964.7573))",
)
3 changes: 2 additions & 1 deletion ogr/ogrpgeogeometry.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2448,7 +2448,8 @@ OGRErr OGRCreateFromShapeBin(GByte *pabyShape, OGRGeometry **ppoGeom,
if (nBits & EXT_SHAPE_ARC_IP)
CPLDebug("OGR", " DefinedIP");
#endif
if ((nBits & EXT_SHAPE_ARC_IP) != 0)
if ((nBits & EXT_SHAPE_ARC_IP) != 0 &&
(nBits & EXT_SHAPE_ARC_LINE) == 0)
{
pasCurves[iCurve].eType = CURVE_ARC_INTERIOR_POINT;
pasCurves[iCurve].u.ArcByIntermediatePoint.dfX = dfVal1;
Expand Down

0 comments on commit e10ed28

Please sign in to comment.