Giter Site home page Giter Site logo

Comments (5)

mattijn avatar mattijn commented on August 24, 2024 1

Interesting! Halfway in the computation of a topology the line segments are also split where the order is not always clear. In the hashmap-step I use a _hash_order() to determine the order. Maybe I could have used a directed graph there as well.
Regarding 1), I can understand the claim of a single place by multiple countries, but I didn't expect a place not being claimed by any country.
Regarding 2), the OSM location seems to be OK, the border is a bit messy there. Maybe it's a glitch when zooming out.

from topojson.

mattijn avatar mattijn commented on August 24, 2024

Thank you for raising the issue and it is great to see you find this package useful for your need!
Until now, speed has been the main bottleneck, but if we can reduce the memory footprint, that would be great too.
It's worth to profile the code to find the main culprit that is causing the memory to blow up.

from topojson.

Zaczero avatar Zaczero commented on August 24, 2024

🙂! If you are interested, I use this package to run https://github.com/Zaczero/osm-countries-geojson. It finally resolved the issue with overlaps/gaps produced during the simplification process. And now it's perfect!

from topojson.

mattijn avatar mattijn commented on August 24, 2024

Thanks for showing your package! May I ask how the directed graph of networkx is being utilised for your use-case? That seems interesting!

I was looking to your referenced geojson and noticed at least two things that you might check.

  • it seems there is a (part of a) country missing near Morocco:
image
  • something is doing odd in the south of the Netherlands:
image

Again, thanks for reaching out!

from topojson.

Zaczero avatar Zaczero commented on August 24, 2024
  1. This is simply the nature of OSM data. In regions of conflict, it's common to encounter such situations. Sometimes, you might even come across two countries at the same time:
    2023-12-03_00-45-33

  2. This appears to be a bug with GitHub's GeoJSON visualizer. They seem to apply their own simplification for rendering. Here's how this location appears on OSM:
    image
    And this is how it looks when rendered locally (which is acceptable for such a high level of simplification):
    image

I understand that the documentation for the countries generator is lacking. Essentially, the directed graph is utilized to reconstruct country polygons efficiently from split and randomly ordered line segments. OSM data does not store countries in predefined shapes but rather as a collection of lines. The directed graph (compared to undirected) improves performance by reducing the number of paths simple cycles has to traverse. Each node represents an intersection (lines endpoints), and each edge represents a line segment.

image

from topojson.

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.