Giter VIP home page Giter VIP logo

kml2ofds's People

Contributors

r2zer0 avatar stevesong avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

Forkers

r2zer0

kml2ofds's Issues

Add option to join two strings that terminate close to each other but which don't have a node

Currently the code assigns a node to any span endpoint that does not already have one. In some cases, where two spans terminate close to each other, it may be that the the map is intended to be contiguous at this point. We could look for spans that terminate very close to each other and join those spans into a single span.

Alternatively, further on in the code, we could look for two "Auto generated nodes" that are close together and reduce it to a single node connecting the two spans.

image

Test for crossed polylines and generate error

The current code doesn't cope well with polylines that intersect each other. Short term strategy is to test for this and generate an error, suggesting that the KML should be adjusted to remove intersections.

pykml parser is not recognising Placemark or LineString elements with embedded ids

Namibia's Grid fibre network https://thegridonline.network/?page_id=770 contains Placemark and LineString elements with IDs e.g.

Will probably have to use findall rather than iter. e.g.

# Parse your KML file
with open('your_file.kml', 'rb') as kml_file:
    root = parser.parse(kml_file).getroot()

# Define the namespace
namespace = "{http://www.opengis.net/kml/2.2}"

# Find all Placemark elements regardless of their ID
placemarks = root.findall(".//" + namespace + "Placemark")

# Iterate over found Placemarks
for placemark in placemarks:
    # Do whatever you need with each Placemark
    # For example, print its ID
    placemark_id = placemark.get("id")

Consider cases where a node terminates close to another span but not near either end.

In OFDS, a network fork should be a node at which three spans terminate. When network mappers draw a network fork in KML, they may choose to draw the fork by drawing a new line that begins close to an existing polyline. The current code does not have the capability to detect and resolve forks that are created this way.

This could be an Auto generated missing node. (note that "Auto generated missing nodes" are created to terminate any polyline that doesn't end in a node, in order to be compliant with OFDS which requires all spans to be terminated by a node at either end)
Screenshot from 2024-05-02 15-47-32

or a named node
Screenshot from 2024-05-02 15-38-10

There is a need for functionality that would detect nodes that are within a certain proximity to a polyline but not either end of the polyline. In these instances, we should break the polyline at the nearest vertex of the polyline and use the node as the terminating point.

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.