-
Notifications
You must be signed in to change notification settings - Fork 4
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
Adding filters to raster layers #9
Comments
The approach we're taking here is to vectorize the rasters and then using that to style and filter on the map. This gives us the best control on styling as well as dynamically filter. Outlining here the steps to vectorize the raster file. Thanks @ingalls for helping me figure this out. 1. Import raster into a PostgreSQL database with PostGIS.Install PostgreSQL + PostGIS and GDAL
Create a database
Import raster data
2. Vectorize and exportUse ST_PixelAsPolygons
Export to GeoJSON
Zoom levels and resolutionThe population data is at a much higher resolution. By default Mapbox would make the population vector tileset only visible from a higher zoom level, like 9. To have them show up at a lower zoom, use the Tippecanoe method and upload the mbtiles. More here. |
Filtering raster layers using expressions in Mapbox GL is currently unsupported. There's a discussion on Mapbox GL repo about raster-colorize but that hasn't really found a place on their roadmap.
I'm capturing some of the options we discussed so far:
I personally think we should use option 3. Could we use https://github.com/mapbox/rio-mbtiles?
cc @AliceR @sharkinsspatial @vincentsarago
The text was updated successfully, but these errors were encountered: