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

OpenStreetMap contribution #5

Open
gabortim opened this issue Jun 3, 2024 · 3 comments
Open

OpenStreetMap contribution #5

gabortim opened this issue Jun 3, 2024 · 3 comments
Assignees

Comments

@gabortim
Copy link

gabortim commented Jun 3, 2024

I came across this project a while ago and seeing what it does and what are the input requirements, I believe OpenStreetMap (OSM) provides all the necessary data for this project.

This got me thinking about some collaboration. While OSM usually lacks proper river centerlines, its riverbank data is almost "perfect". Feeding the script with OSM data, then outputting the results back to OSM could be a valuable use case. What do you think?

Additionally, there is a desktop editor called JOSM with an excellent plugin system, although a simple CLI tool could also be highly effective.

@cyschneck
Copy link
Owner

I agree! It seems very promising since the current bottleneck for working with rivers is collecting the coordinates of a river. centerline-width currently has two requirements:

  • river is a single stream river (as opposed to a multi-threaded river)
  • river is measured on the banks (left and right bank coordinates)

I am not terribly familiar with OpenStreetMap, but it seems like this is represented in OSM as a multipolygon or a ways (for linear and area boundaries)

This section of the North Fork Eel River is a good example. Part of the river is map as an area (water=river) and part appears missing, but is actually visible when waterway=river which approximates a centerline is used. However, OSM rivers are a mixed bag for mapping since not all rivers are mapped as areas, but instead are mapped as an approximate centerline

water=river (a part of natural=water) has the area element that this would need. At a glance it mentions about ~431K, which seems very promising, but many of those are likely multi-threaded rivers. There are some (distant) plans to have this package handle multi-threaded rivers, but even ignoring those parts, this seems like a rich resource for existing mapped rivers

I'll give overpy Python's Overpass API a look and add it to the roadmap. Thanks for pointing this out! It is a good application for this package to help OSM and OSM will provide a lot of existing mapped river banks. I will do more research and see if I can develop a workflow that will work between this package and OSM

@gabortim
Copy link
Author

gabortim commented Jun 5, 2024

I am not terribly familiar with OpenStreetMap, but it seems like this is represented in OSM as a multipolygon or a ways (for linear and area boundaries)

Yes, multipoligon consisting multiple, even geographically distant ways like in your example or simple closed ways.

OSM rivers are a mixed bag for mapping since not all rivers are mapped as areas, but instead are mapped as an approximate centerline

Yes, but from what I've seen most of them have the riverbanks mapped, well, at least in Europe. The centerline among other things is used for waterway routing for ships, boats etc.

I'll give overpy Python's Overpass API a look

That's an option as well, and at the same time, I'd like to point out that all the interesting queries for you are probably static (like this). An extra moving part in the form of an Overpass library may not be needed, as the API accepts the query string and gives JSON, XML, or CSV data in return. These can be handled with core Python functionality.

One more thing I'd like to point out, fully automated edits are highly discouraged, meaning if the CLI option is chosen, an editor like JOSM should be used for viewing/uploading changes to have some control.

If you have any questions, just ping me here.

@cyschneck cyschneck self-assigned this Jun 9, 2024
@cyschneck
Copy link
Owner

Returns rivers (as boundary boxes instead of estimated centerline)

/*
This has been generated by the overpass-turbo wizard.
The original search was:
“water=river ”
*/
[out:json][timeout:25];
// gather results
nwr["water"="river"]({{bbox}});
// print results
out geom;

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

2 participants