Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

GML: Support for unit of measure for radius of gml:CircleByCenterPoint does not work as expected #11597

Closed
heidivanparys opened this issue Jan 7, 2025 · 3 comments · Fixed by #11599
Assignees

Comments

@heidivanparys
Copy link
Contributor

What is the bug?

Setting the value of gml:Curve/gml:segments/gml:CircleByCenterPoint/gml:radius/@uom to km or [nmi_i] does not construct the expected geometry in GDAL/QGIS, although those units should be supported according to what I can see in e.g. #3118.

Steps to reproduce the issue

Use the following three GML snippets. The circle using meter as unit is shown fine. The circles using kilometer and nautical miles are not shown fine.

Note: I know that using nautical miles would not make that much sense in the given location and with the given CRS, but I would at least expect km to work here. I added the nautical miles example to test what would happen, and also because I could see in other issues that support for that uom should be present.

<?xml version="1.0" encoding="UTF-8"?>
<ex:FeatureCollection
    xmlns:gml="http://www.opengis.net/gml/3.2"
    xmlns:ex="urn:uuid:33491e0b-1e7a-4dc0-817e-2c333fa786f7"
    gml:id="id7c0d5245-cc49-4f2d-b1fa-25c9a87af4c7">
    <ex:featureMember>
        <ex:MyFeatureTypeMeters gml:id="id894572b5-3d7d-446b-8b47-6c96ec30e06a">
            <ex:id>894572b5-3d7d-446b-8b47-6c96ec30e06a</ex:id>
            <ex:geometri>
                <gml:Surface srsName="http://www.opengis.net/def/crs/EPSG/0/25832" srsDimension="2">
                    <gml:patches>
                        <gml:PolygonPatch>
                            <gml:exterior>
                                <gml:Ring>
                                    <gml:curveMember>
                                        <gml:Curve>
                                            <gml:segments>
                                                <gml:CircleByCenterPoint numArc="1">
                                                    <gml:pos>665843.66 6063914.72</gml:pos>
                                                    <gml:radius uom="m">3000</gml:radius>
                                                </gml:CircleByCenterPoint>
                                            </gml:segments>
                                        </gml:Curve>
                                    </gml:curveMember>
                                </gml:Ring>
                            </gml:exterior>
                        </gml:PolygonPatch>
                    </gml:patches>
                </gml:Surface>
            </ex:geometri>
        </ex:MyFeatureTypeMeters>
    </ex:featureMember>
</ex:FeatureCollection>
<?xml version="1.0" encoding="UTF-8"?>
<ex:FeatureCollection
    xmlns:gml="http://www.opengis.net/gml/3.2"
    xmlns:ex="urn:uuid:33491e0b-1e7a-4dc0-817e-2c333fa786f7"
    gml:id="id7c0d5245-cc49-4f2d-b1fa-25c9a87af4c7">
    <ex:featureMember>
        <ex:MyFeatureTypeKilometers gml:id="id894572b5-3d7d-446b-8b47-6c96ec30e06a">
            <ex:id>894572b5-3d7d-446b-8b47-6c96ec30e06a</ex:id>
            <ex:geometri>
                <gml:Surface srsName="http://www.opengis.net/def/crs/EPSG/0/25832" srsDimension="2">
                    <gml:patches>
                        <gml:PolygonPatch>
                            <gml:exterior>
                                <gml:Ring>
                                    <gml:curveMember>
                                        <gml:Curve>
                                            <gml:segments>
                                                <gml:CircleByCenterPoint numArc="1">
                                                    <gml:pos>665843.66 6063914.72</gml:pos>
                                                    <gml:radius uom="km">3</gml:radius>
                                                </gml:CircleByCenterPoint>
                                            </gml:segments>
                                        </gml:Curve>
                                    </gml:curveMember>
                                </gml:Ring>
                            </gml:exterior>
                        </gml:PolygonPatch>
                    </gml:patches>
                </gml:Surface>
            </ex:geometri>
        </ex:MyFeatureTypeKilometers>
    </ex:featureMember>
</ex:FeatureCollection>
<?xml version="1.0" encoding="UTF-8"?>
<ex:FeatureCollection
    xmlns:gml="http://www.opengis.net/gml/3.2"
    xmlns:ex="urn:uuid:33491e0b-1e7a-4dc0-817e-2c333fa786f7"
    gml:id="id7c0d5245-cc49-4f2d-b1fa-25c9a87af4c7">
    <ex:featureMember>
        <ex:MyFeatureTypeNauticalMiles gml:id="id894572b5-3d7d-446b-8b47-6c96ec30e06a">
            <ex:id>894572b5-3d7d-446b-8b47-6c96ec30e06a</ex:id>
            <ex:geometri>
                <gml:Surface srsName="http://www.opengis.net/def/crs/EPSG/0/25832" srsDimension="2">
                    <gml:patches>
                        <gml:PolygonPatch>
                            <gml:exterior>
                                <gml:Ring>
                                    <gml:curveMember>
                                        <gml:Curve>
                                            <gml:segments>
                                                <gml:CircleByCenterPoint numArc="1">
                                                    <gml:pos>665843.66 6063914.72</gml:pos>
                                                    <gml:radius uom="[nmi_i]">1.62</gml:radius>
                                                </gml:CircleByCenterPoint>
                                            </gml:segments>
                                        </gml:Curve>
                                    </gml:curveMember>
                                </gml:Ring>
                            </gml:exterior>
                        </gml:PolygonPatch>
                    </gml:patches>
                </gml:Surface>
            </ex:geometri>
        </ex:MyFeatureTypeNauticalMiles>
    </ex:featureMember>
</ex:FeatureCollection>

image

Versions and provenance

Installation via OSGEO4W.

QGIS version3.40.0-Bratislava
QGIS code revisionb56115d874
 
Libraries
Qt version5.15.13
Python version3.12.7
GDAL/OGR version3.9.3
PROJ version9.5.0
EPSG Registry database versionv11.016 (2024-08-31)
GEOS version3.13.0-CAPI-1.19.0
SQLite version3.46.1
PDAL version2.8.1
PostgreSQL client versionunknown
SpatiaLite version5.1.0
QWT version6.3.0
QScintilla2 version2.14.1
OS versionWindows 10 Version 2009
 
Active Python plugins
quick_map_services0.19.34
db_manager0.1.20
grassprovider2.12.99
MetaSearch0.3.6
processing2.12.99

Additional context

This issue is related to #11582, #4807 and #3118.

@rouault
Copy link
Member

rouault commented Jan 7, 2025

fix in #11599. Won't likely make it to 3.10.1 whose RC1 has been issued just before

@rouault
Copy link
Member

rouault commented Jan 7, 2025

Won't likely make it to 3.10.1 whose RC1 has been issued just before

actually we'll have a RC2, so the fix will go to 3.10.1

@heidivanparys
Copy link
Contributor Author

Great, thanks a lot for the very quick reply and fix!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants