Code Monkey home page Code Monkey logo

Comments (11)

DGuidi avatar DGuidi commented on June 15, 2024

GMLWriter writes a GML "representation" of a Geometry: a GML fragment and not a complete GML document.
To create a "valid" GML document, you (or we) should create a writer that, at least, takes a list of IFeature, then manage geometry AND attributes to generate A GML document, that at least contains initial xml declaration and namespace imports.

from nettopologysuite.

RobertSmart avatar RobertSmart commented on June 15, 2024

Hi, thanks for the feedback. I managed to use sharpkml to get a quick usable output, but it would be good to see an export to gml file option.

from nettopologysuite.

FObermaier avatar FObermaier commented on June 15, 2024

If I got it right, the problem is the wrapping <gml:GML></gml:GML> tag that is created using the writer. At least JTS does not write that in its xml.

from nettopologysuite.

DGuidi avatar DGuidi commented on June 15, 2024

Have you tried to read JTS GML output with QGIS?
I suspect you can obtain another error, jost becaus the GML fragment isn't a GML/XML valid document.
Anyway, remove gml namespace can be a valid strategy, at least to maintain JTS behavior.

from nettopologysuite.

FObermaier avatar FObermaier commented on June 15, 2024

Having said that, I think the API should change and the GMLWriter.Write functions should take an XmlWriter as argument, thus knowing which namespaces have already been defined to not pollute the file with namespace declarations.

from nettopologysuite.

FObermaier avatar FObermaier commented on June 15, 2024

As a comparison:
JTS:

<gml:Point>
  <gml:coordinates>
    52,-0.9 
  </gml:coordinates>
</gml:Point>`

NTS:

<gml:GML xmlns:gml="http://www.opengis.net/gml">
  <gml:Point>
    <gml:coord>
      <gml:X>52</gml:X>
      <gml:Y>-0.9</gml:Y>
    </gml:coord>
 </gml:Point>
</gml:GML>

from nettopologysuite.

DGuidi avatar DGuidi commented on June 15, 2024

I'm working on a pull request.
Actually, I don't remember the meaning of gml:GML tag, I remember that code was modified for MSSQLSpatial purposes...
Anyway, code fixes to made output like JTS one is trivial.
I don't actually know how many existing code this change can break.

from nettopologysuite.

DGuidi avatar DGuidi commented on June 15, 2024

+1 for change the API

from nettopologysuite.

DGuidi avatar DGuidi commented on June 15, 2024

@FObermaier @RobertSmart please check. Hope this fix the problem.

from nettopologysuite.

DGuidi avatar DGuidi commented on June 15, 2024

can I close this issue now?

from nettopologysuite.

RobertSmart avatar RobertSmart commented on June 15, 2024

I haven't had time to check, but if matches the JTS implementation, then it should be fine to close now.

Thanks, Rob

from nettopologysuite.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.