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

Feature Request: Downloading Features as GeoJSON or OSM #74

Open
Heinlein1115 opened this issue Dec 16, 2024 · 4 comments
Open

Feature Request: Downloading Features as GeoJSON or OSM #74

Heinlein1115 opened this issue Dec 16, 2024 · 4 comments

Comments

@Heinlein1115
Copy link

Hi,

I'm a big fan of waterwaymap.org and the way it visualizes natural waterways and downhills. It's incredibly useful!

I was wondering if it would be possible to add a feature that allows users to download the displayed features (rivers, streams, etc.) in either GeoJSON or OSM format. This would be incredibly helpful for integrating the data with other GIS tools and workflows.

Thanks for your time and consideration, and for creating such a valuable resource.

@amandasaurus
Copy link
Owner

amandasaurus commented Dec 20, 2024

I'm glad you like it! I'd love to help people make maps with this sort of data. All the scripts to make it are in the Makefile which is called from make-planet.sh. It's osm-lump-ways which actually generates the data.

I'm not able to provide an interactive “Download Current View” like you ask for. WWM.org is a static website that displays maps from a statically hosted .pmtiles file. The vector tile data has been processed and a little simplified.

One issue is that the data files are very large! Before it gets converted to vector tiles each map is an ca. 20 GiB GeoJSONSeq file.

But! Here's a first attempt: https://data.waterwaymap.org/planet-upstreams.csv.zst (data updated daily, and open data under the ODbL, contains OSM data)

it's a 6.5 GiB zstd compressed CSV. Uncompressed 52 GiB. 3 columns: end_nid (integer), from_upstream_m (float) & geom (text). The geom has a 2 point linestring in WKT. It's a line from point A to point B. There's 4½ billion of them. from_upstream_m is the total upstream in point B. end_nid is the OSM node that this eventually flows into.

ogr2ogr can convert this to another format (don't forget -oo GEOM_POSSIBLE_NAMES=geom -oo AUTODETECT_TYPE=yes!). You can also do geo filtering. e.g. here's how I get a nice 233 MiB file for Ireland (in 25 min)

ogr2ogr ie-upstream.gpkg planet-upstreams.csv -oo GEOM_POSSIBLE_NAMES=geom -oo AUTODETECT_TYPE=yes -clipsrc -10.546875 51.158677 -5.350342 55.509971

I can make maps of this in QGIs, like this:

Screenshot from 2024-12-20 15-11-50

or
image

CSV is not practical to load in (e.g.) QGis, however it compresses really well. I'm open to other suggested file formats.

What do you (& others) think of this file? Does this data file work for you?

@StyXman
Copy link

StyXman commented Dec 21, 2024

I just tried:

mdione@ioniq:~/src/projects/elevation/data/amapanda$ wget https://data.waterwaymap.org/planet-upstreams.csv.zst
--2024-12-21 22:43:46--  https://data.waterwaymap.org/planet-upstreams.csv.zst
Resolving data.waterwaymap.org (data.waterwaymap.org)... 172.67.150.147, 104.21.39.241, 2606:4700:3033::ac43:9693, ...
Connecting to data.waterwaymap.org (data.waterwaymap.org)|172.67.150.147|:443... connected.
HTTP request sent, awaiting response... 500 Internal Server Error
2024-12-21 22:43:51 ERROR 500: Internal Server Error.

@StyXman
Copy link

StyXman commented Dec 22, 2024

Works now...

@amandasaurus
Copy link
Owner

amandasaurus commented Dec 22, 2024 via email

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

3 participants