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

Improve map to use points on higher zoom levels #11

Open
m-mohr opened this issue Oct 25, 2024 · 1 comment
Open

Improve map to use points on higher zoom levels #11

m-mohr opened this issue Oct 25, 2024 · 1 comment
Assignees

Comments

@m-mohr
Copy link
Collaborator

m-mohr commented Oct 25, 2024

From Caleb:

One thing I noticed is that it is very hard to see where the kenya/rwanda examples in low zoom level. One way to get around this is to generate pmtiles that are centroids at low zoom levels and polygons at high zoom levels:
Here's how I did it for GRW (I played with drop rate on the points a bit and visualized in QGIS)
tippecanoe --drop-densest-as-needed --drop-rate=2.5 --minimum-zoom=0 --maximum-zoom=9 --force -o solar_centroids.mbtiles solar_centroids_epsg4326.geojson
tippecanoe --minimum-zoom=9 -o solar.mbtiles solar_epsg4326.geojson
tile-join --force -o output.mbtiles solar.mbtiles solar_centroids.mbtiles
on the front end you can point a bubblelayer and vectorlayer (depending on library) at the same vector tile source

@m-mohr m-mohr self-assigned this Oct 25, 2024
@m-mohr
Copy link
Collaborator Author

m-mohr commented Nov 3, 2024

Working on it right now, the commands I've used so far:

  1. Merge FTW datasets:
    fiboa convert ftw -o ftw.parquet
  2. Compute centroids:
    ogr2ogr -sql "SELECT ST_Centroid(geometry) AS geometry, id, determination_datetime, dataset, license FROM ftw" -dialect sqlite ftw_centroid.parquet ftw.parquet
  3. Create GeoJSON with polygons:
    ogr2ogr -t_srs EPSG:4326 ftw_sources.json ftw.parquet
  4. Create GeoJSON with points/centroids:
    ogr2ogr -t_srs EPSG:4326 ftw_sources_centroid.json ftw_centroid.parquet
  5. Create PMTiles with polygons:
    tippecanoe --drop-densest-as-needed --minimum-zoom=9 --force -o ftw_sources_lv9.pmtiles ftw_sources.json
  6. Create PMTiles with points/centroids:
    tippecanoe --drop-densest-as-needed --minimum-zoom=0 --maximum-zoom=9 --force -o ftw_sources_centroids.pmtiles ftw_sources_centroid.json
  7. Merge PMTiles files:
    tile-join --force -l "ftw_sources" -o ftw-sources.pmtiles ftw_sources_centroids.pmtiles ftw_sources_lv9.pmtiles

The tile-join doesn't really work for me yet, can't get the PMTiles to properly merge it seems.
I could load the separate PMTiles files on the map, but that's probably not what we want here given that others are already using the PMTiles file.

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

1 participant