Skip to content

Commit

Permalink
gml:CircleByCenterPoint(): return a 5-point CIRCULARSTRING for compli…
Browse files Browse the repository at this point in the history
…ance with ISO/IEC 13249-3:2011

Fixes OSGeo#11750
  • Loading branch information
rouault committed Jan 29, 2025
1 parent 5b5adef commit 31133be
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
3 changes: 2 additions & 1 deletion autotest/ogr/ogr_gml_geom.py
Original file line number Diff line number Diff line change
Expand Up @@ -2396,9 +2396,10 @@ def test_gml_CircleByCenterPoint():

gml = "<gml:CircleByCenterPoint><gml:pos>1 2</gml:pos><gml:radius>2</gml:radius></gml:CircleByCenterPoint>"
geom = ogr.CreateGeometryFromGML(gml)
print(geom)

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 31133be

Please sign in to comment.