Comments (10)
This guide also contains some useful info: https://github.com/nst-guide/terrain#contours-1 - it looks like DEM files can be processed in isolation then the results merged, which fits in well with Flatmap's goal of saturating cpus and limiting memory and disk usage. If the result gets blocky at higher zoom levels, there's also https://docs.geotools.org/stable/javadocs/org/geotools/geometry/jts/JTS.html#smooth-org.locationtech.jts.geom.Geometry-double-
from planetiler.
I just now found out about client-side generated hillshade and contour-lines with maplibre GL JS.
- https://github.com/onthegomap/maplibre-contour
- https://maplibre.org/maplibre-style-spec/layers/#hillshade
This works globally, based on the terrain tiles from aws.
https://onthegomap.github.io/maplibre-contour/#12.03/46.14026/7.11656
from planetiler.
Yes! I was thinking the same thing, as well as hillshading polygons derived from the same elevation data. Do you have any background knowledge on generating contour lines?
I did some work on graphhopper with elevation data so I know it shouldn't be too hard to access free public data from Java. I'm not too familiar with generating isolines but it looks like marching squares used by d3-contour is pretty standard?
from planetiler.
Do you have any background knowledge on generating contour lines?
Unfortunately not.
from planetiler.
Some interesting and possibly valuable links I collected when looking for global contour lines and hillshade from open data:
Free terrain tiles from aws:
- https://registry.opendata.aws/terrain-tiles/
- on demand generated hillshades from aws terrain-tiles https://terradactile.sparkgeo.com/
- Technical background: https://sparkgeo.com/blog/terradactile-generate-cogs-from-aws-terrain-tiles/
- Source code: https://github.com/sparkgeo/terradactile-lambda/blob/master/terradactile/terradactile/app.py
- GDAL Docker image https://github.com/developmentseed/geolambda
- https://www.openslopemap.org/karte/
- Global elevation data: http://www.viewfinderpanoramas.org/Coverage%20map%20viewfinderpanoramas_org3.htm
Terrain Tiles:
- https://bertt.wordpress.com/2022/05/24/custom-maplibre-terrain-tiles/
- https://www.eorc.jaxa.jp/ALOS/en/dataset/aw3d30/aw3d30_e.htm
- https://maplibre.org/news/2022-05-20-terrain3d/#10.46/47.2713/11.4/21.6/41
Generate hillshade
- https://github.com/interline-io/planetutils#elevation_tile_download
- https://github.com/Karry/hillshade-tile-server
- https://github.com/clhenrick/gdal_hillshade_tutorial
- https://www.kreidefossilien.de/en/miscellaneous/custom-hillshading-for-osmand
Generate contours
-
hillshade/contours and script for France:
- https://www.data.gouv.fr/fr/datasets/bd-alti-r-25-m-tuiles-pour-courbes-de-niveau-et-ombrage-dynamiques-1/
- https://makina-corpus.com/sig-webmapping/optimisation-tuiles-mnt-rgb-ombrage-dynamique-mapbox-gl-maplibre-gl
- https://makina-corpus.com/sig-webmapping/representation-des-modeles-numeriques-de-terrain-sur-le-web-ombrage-et-3d
- https://github.com/lokkelvin2/kepler.gl-offline#hillshade-generation
from planetiler.
Thanks for the pointers! I was about halfway through implementing contour lines in planetiler but ended up just porting the logic to JavaScript since it lets you generate any number of variations on thresholds from one dem source, and built that into maplibre-contour.
Let me know if people still have use cases for server-side generated hillshading/contour lines. Since maplibre now has client side support for those the biggest gap seems like server-generated global landcover.
from planetiler.
What would be amazing is if you could make a version of the javascript contour lines which works in aws lambda or cloudflare workers. Because I would love to use your contour lines in MapLibre Native but don't know how to get there...
from planetiler.
@wipfli Did you look at the Terradactile demo I linked above? This generates hillshade tiles on lambda. https://github.com/sparkgeo/terradactile-lambda/blob/master/terradactile/terradactile/app.py
I personally prefer provider-independent self-hosted services.
For now I mostly played with tileserver-gl and styles.json to tweak and design map styles. I need to get more familiar with maplibre-gl-js and the plugins.
from planetiler.
Last year I wrote a script which I used to generate contour lines for the whole planet.
https://github.com/CramericaIndustries/vector-terrain-cli
Downside of this script is that the contour lines are overlapping in the border areas of the DEM files.
from planetiler.
Right now I am using the https://github.com/onthegomap/maplibre-contour posted above, which makes contour lines based on the terrain raster-dem.
heres a live example of that https://wifidb.net/demo/contours/contour_lines.html#15/32.24408/76.21147/0/60
The nice thing is this produces vector tile lines, which can be styled as you want. It also lets you adjust what levels you want to see without having to generate a whole new set of contour line tiles.
from planetiler.
Related Issues (20)
- [BUG] download missing latest osm file HOT 1
- [BUG] Error when building planet tiles: "Protocol message contained an invalid tag (zero)" HOT 2
- Support Overture Map format HOT 18
- About the display layer of place name labels HOT 1
- Multiple areas support? HOT 2
- House number is generated for every primative with addr:housenumber key HOT 1
- [FEATURE] Merge with already existing tiles HOT 2
- Prefer name statements over Wikidata labels HOT 2
- [FEATURE] Log problematic geometry causing JTS exceptions HOT 22
- [FEATURE] Min polygon area for including center point
- [FEATURE] Expose OSM entity metadata in the process feature context HOT 2
- [FEATURE] Lua profile followups
- [BUG] US admin level 4 boundary lines appear incomplete HOT 3
- Tilejson attributes missing attributes added or removed during post-processing
- [BUG] tiles missing >= zoom 7 HOT 13
- [FEATURE] Log planet version being used HOT 2
- [BUG] Charging stations won't be exported HOT 4
- [FEATURE] Add arbitrary extra metadata using the Profile interface
- [BUG] GeoPackageReader with EPSG:3067 results in swapped lat & lng
- [BUG] IOException/GOAWAY happening in parseResults()
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from planetiler.