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

Compute the osm places shape #67

Closed

Conversation

antoine-de
Copy link
Contributor

@antoine-de antoine-de commented Oct 31, 2018

cosmogony.world still has a lot of missing cities. This is mainly due to the cities shape not being in osm.

But in osm, when cities are missing, there are often nodes with type=city or type=town.

In this PR we try to compute rough shape for those nodes.

In order to do this, we compute a voronoi diagrams for each "parent" zone.

the algorithm is roughly:
for each parent:

  • take all nodes [type=city or type=town] in it and compute a voronoi from it
  • for each each take its voronoi and subtract:
    • the parent's shape
    • all nicely bounded cities in this parent.

This PR is a work in progress. There are still lots a TODOs and it depends on:

This should fix #19

for (idx, voronoi) in voronois.into_iter().enumerate() {
let place: &mut Zone = &mut places[idx];

place.boundary = make_boundary(voronoi, &calc_geom);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

TODO: result = (voronoi - calc_geom) ∩ parent_geom


let calc_geom = create_forbidden_geom(&zones[parent.index]);
for (idx, voronoi) in voronois.into_iter().enumerate() {
let place: &mut Zone = &mut places[idx];
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

TODO: places and points use same indices, but that's not obvious

@amatissart
Copy link
Member

Replaced with #84

@amatissart amatissart closed this Jun 17, 2019
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 this pull request may close these issues.

Approximate polygons for areas/levels where they are missing
2 participants