Skip to content

Commit

Permalink
Merge pull request OSGeo#11755 from rouault/fix_11750
Browse files Browse the repository at this point in the history
gml:CircleByCenterPoint(): return a 5-point CIRCULARSTRING for compliance with ISO/IEC 13249-3:2011
  • Loading branch information
rouault authored Jan 30, 2025
2 parents fb8a910 + dfa35bd commit 9c8dc90
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
2 changes: 1 addition & 1 deletion autotest/ogr/ogr_gml_geom.py
Original file line number Diff line number Diff line change
Expand Up @@ -2398,7 +2398,7 @@ def test_gml_CircleByCenterPoint():
geom = ogr.CreateGeometryFromGML(gml)

ogrtest.check_feature_geometry(
geom, ogr.CreateGeometryFromWkt("CIRCULARSTRING (-1 2,3 2,-1 2)")
geom, ogr.CreateGeometryFromWkt("CIRCULARSTRING (-1 2,1 4,3 2,1 0,-1 2)")
)


Expand Down
6 changes: 6 additions & 0 deletions ogr/gml2ogrgeometry.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2043,9 +2043,15 @@ GML2OGRGeometry_XMLNode_Internal(const CPLXMLNode *psNode, const char *pszId,
p.setX(dfCenterX - dfRadius);
p.setY(dfCenterY);
poCC->addPoint(&p);
p.setX(dfCenterX);
p.setY(dfCenterY + dfRadius);
poCC->addPoint(&p);
p.setX(dfCenterX + dfRadius);
p.setY(dfCenterY);
poCC->addPoint(&p);
p.setX(dfCenterX);
p.setY(dfCenterY - dfRadius);
poCC->addPoint(&p);
p.setX(dfCenterX - dfRadius);
p.setY(dfCenterY);
poCC->addPoint(&p);
Expand Down

0 comments on commit 9c8dc90

Please sign in to comment.