georust / geo

Rust geospatial primitives & algorithms
https://crates.io/crates/geo
Other
1.58k stars 199 forks source link

SimplifyVwPreserve seems to be borken. #1042

Open twitchax opened 1 year ago

twitchax commented 1 year ago

The input was time zone boundaries from OSM.

SimplifyVwPreserve results in a weird result.

image

SimplifyVw seems to work just fine.

image
urschrei commented 1 year ago

That certainly doesn’t look correct, but hard to say why without knowing a bit more.

twitchax commented 1 year ago

I can provide the input data, etc., if that helps.

I'm not going to be super useful to debugging, I believe. :)

urschrei commented 1 year ago

Well, whatever you’ve got in the way of repro would be useful.

twitchax commented 1 year ago

Let me cut a branch.

twitchax commented 1 year ago

Ok, here is the code where it is called. Just switch between Vw and VwPreserve. To get the geojson output. run

cargo run --features full --features extrasimplified -- dump-geojson preserve
urschrei commented 1 year ago

Working on an VW-preserve fix and I think this looks better, but it'll be more immediately obvious to you. If you plug in my branch as the geo dependency you can use the updated algorithm:

geo = { git="https://github.com/urschrei/rust-geo.git", version="0.26.0" }

twitchax commented 1 year ago

Hmmm, looks about the same.

image
urschrei commented 1 year ago

🤔. Which of the three generated geojson files is that?

twitchax commented 1 year ago

The one with tz-osm in its name. You probably want to skip over the admin-osm by not using that feature since those cannot be generated via the web like the others.