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

vector_tiler null output #197

Closed
avanetten opened this issue Jul 15, 2019 · 7 comments
Closed

vector_tiler null output #197

avanetten opened this issue Jul 15, 2019 · 7 comments

Comments

@avanetten
Copy link
Contributor

vector_tiler is giving null output when tiling a geojson using the tiles created by raster_tiler

@nrweir
Copy link
Contributor

nrweir commented Jul 15, 2019 via email

@daveluo
Copy link

daveluo commented Jul 16, 2019

First off, much thanks for the Solaris toolkit and kudos on the initial release...really helpful!

I ran into this same problem of getting null outputs from VectorTiler. It worked as expected with the examples from the tutorials but encountered when I tried tiling my own data samples.

At least in my case, the problem seems to stem from my raster input not being in epsg:4326. When raster_tiler.tile_bounds is generated by RasterTiler, they contain non-4326 coordinates like (537722.4375, 9350190.01551792, 537782.2604974508, 9350249.838515371)

When passing this into vector_tiler.tile(tile_bounds=), clip_gdf() isn't able to find the bounds to clip the input geojson/gpd.

I confirmed and fixed the problem by converting the generated raster_tiler.tile_bounds to 4326 first and then passing that into vector_tiler.tile().

Here's a Colab notebook showing the issue and my quick fix: https://nbviewer.jupyter.org/gist/daveluo/7c54d0fbb1d1f32307d2af1a5b640254#Make-tiles-for-znz029

@nrweir
Copy link
Contributor

nrweir commented Jul 16, 2019

Thanks a lot for doing the diagnosis and exploration @daveluo! This may have been fixed with #201 - if you feel like checking, you could pip install the version on the dev branch and see if it fixes it.

I'll dig into it myself later tonight and make sure everything's resolved.

@daveluo
Copy link

daveluo commented Jul 16, 2019

Thanks for the heads up! I pip installed the dev branch but the latest changes did not fix the non-4326 tile_bounds issue.

@nrweir
Copy link
Contributor

nrweir commented Jul 16, 2019

OK thanks @daveluo, I'll check back into it in a little bit.

@nrweir
Copy link
Contributor

nrweir commented Jul 17, 2019

Alright yeah, there wasn't anything written into the code to handle cases where the raster and vector have different CRSs. I've added an argument to VectorTiler.tile() and VectorTiler.tile_generator(), tile_bounds_crs, where the user can specify the EPSG code for the raster CRS; solaris will check if it differs from the vector CRS and transform the bounds as needed. See #203.

Thanks for bringing this to our attention @daveluo!

@nrweir
Copy link
Contributor

nrweir commented Jul 18, 2019

Resolved with #203.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants