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

MVT encoding (or decoding) issue #218

Open
grim7reaper opened this issue Jul 5, 2024 · 2 comments
Open

MVT encoding (or decoding) issue #218

grim7reaper opened this issue Jul 5, 2024 · 2 comments

Comments

@grim7reaper
Copy link

Seems like in some cases geozero cannot read the MVT it generated.

Simple example:

#[test]
fn render_rect() {
    let shape = Rect::new(Coord { x: 0., y: 0. }, Coord { x: 1., y: 1. });
    let feature = Geometry::Rect(shape).to_mvt_unscaled().expect("mvt");
    let mut writer = GeoWriter::new();
    geozero::mvt::process_geom(&feature, &mut writer).expect("read MVT");
}

Dunno if the issue is in the encoder or the decoder.

Or maybe I'm doing something wrong?

@pka
Copy link
Member

pka commented Jul 5, 2024

Code looks legit at a first glance. What's the error message?

@grim7reaper
Copy link
Author

grim7reaper commented Jul 5, 2024

Error I get is:

MvtError(GeometryFormat)

I tried to debug it a bit and it's coming from here.

My guess is that we somehow detect an interior ring (negative area) but since there is no outer ring to which it could belong we get the error.

So maybe a problem at write time?

grim7reaper added a commit to HydroniumLabs/h3o-mvt that referenced this issue Nov 15, 2024
Had to temporarily disable a unit test.

Not 100% sure it's a geozero bug (georust/geozero#218),
it could also be on our side, but the generated MVT does look visually
good and can be decoded by other libraries, so it seems to be working
fine on our side.
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

No branches or pull requests

2 participants