Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 6 additions & 9 deletions ogr/ogrgeometryfactory.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3524,7 +3524,7 @@ static void CutGeometryOnDateLineAndAddToMulti(OGRGeometryCollection *poMulti,
/* RemovePoint() */
/************************************************************************/

static void RemovePoint(OGRGeometry *poGeom, OGRPoint *poPoint)
static void RemovePoint(OGRGeometry *poGeom, const OGRPoint *poPoint)
{
const OGRwkbGeometryType eType = wkbFlatten(poGeom->getGeometryType());
switch (eType)
Expand Down Expand Up @@ -3561,14 +3561,11 @@ static void RemovePoint(OGRGeometry *poGeom, OGRPoint *poPoint)
case wkbPolygon:
{
OGRPolygon *poPoly = poGeom->toPolygon();
if (poPoly->getExteriorRing() != nullptr)
for (auto *poRing : *poPoly)
{
RemovePoint(poPoly->getExteriorRing(), poPoint);
for (int i = 0; i < poPoly->getNumInteriorRings(); ++i)
{
RemovePoint(poPoly->getInteriorRing(i), poPoint);
}
RemovePoint(poRing, poPoint);
}
poPoly->closeRings();
break;
}

Expand All @@ -3577,9 +3574,9 @@ static void RemovePoint(OGRGeometry *poGeom, OGRPoint *poPoint)
case wkbGeometryCollection:
{
OGRGeometryCollection *poGC = poGeom->toGeometryCollection();
for (int i = 0; i < poGC->getNumGeometries(); ++i)
for (auto *poPart : *poGC)
{
RemovePoint(poGC->getGeometryRef(i), poPoint);
RemovePoint(poPart, poPoint);
}
break;
}
Expand Down
Loading