0

I would like to extract all coordinates from my GML file and convert them in geometry type:

<geometrie>
                <gml:MultiCurve srsName="EPSG:3944" srsDimension="3">
                    <gml:curveMember>
                        <gml:LineString>
                            <gml:posList>1787810.8386000022 3214988.2920000004 0 1787810.7756000012 3214988.686999998 0</gml:posList>
                        </gml:LineString>
                    </gml:curveMember>
                </gml:MultiCurve>
            </geometrie>

....

<geometrie>
                <gml:Point srsName="EPSG:3944" srsDimension="3">
                    <gml:pos>1787697.0650999993 3214943.1966999993 0</gml:pos>
                </gml:Point>
            </geometrie>

I found the class GMLFilterGeometry in geotools but it's implemented in SAX and not STAX. It exists any over class like GMLFilterGeometry in STAX? Or another library can do that?

1
  • 1
    Welcome to Geographic Information Systems! Welcome to GIS SE! We're a little different from other sites; this isn't a discussion forum but a Q&A site. Your questions should as much as possible describe not just what you want to do, but precisely what you have tried and where you are stuck trying that. Please check out our short tour for more about how the site works.
    – Ian Turton
    Commented Nov 9, 2020 at 14:17

1 Answer 1

1

If you review the GeoTools XML FAQ you will see a list of supported libraries but STAX is not listed so I think you are out of luck.

That said, the joy of open source libraries is that you can implement your own solution (and push it into the GeoTools library for the benefit of others), especially since the GeoTools system is built on a factory principal making it easy to insert your own code.

However, if all you need to do is parse some GML into GeoTools features then I would go with the existing code base and not worry too much about the details.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.