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

Add new functions to play with Overpass api #1398

Merged
merged 26 commits into from
Nov 8, 2024

Conversation

ebocher
Copy link
Member

@ebocher ebocher commented Oct 24, 2024

This PR adds new utilities functions to interact with the Overpass api.

Examples

Download osm data as csv file and import it

SELECT ST_OverpassDownloader('out: csv(\"name\")]; area[name=\"Paimpol\"];nwr(area)[railway=station];out;', '/tmp/placenames.csv', true):

SELECT name FROM CSVREAD('/tmp/placenames.csv', null, 'fieldSeparator=\t')

Counting the number of building

select ST_OverpassDownloader(CONCAT('[bbox:', ST_AsOverpassBbox(st_Expand('SRID=4326;POINT(-2.781140 47.643182)'::GEOMETRY, 0.001)), ']', '[out:csv(::count, ::\"count:nodes\", ::\"count:ways\", ::\"count:relations\")][timeout:25];(nwr[building=yes];); out count;'), '/tmp/count_building', true )

ST_AsOverpassBbox function is used to generate the bbox signature.

Plus fix all javadoc

@ebocher ebocher marked this pull request as ready for review November 4, 2024 14:48
@ebocher ebocher merged commit 47a8b90 into orbisgis:master Nov 8, 2024
1 check passed
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

Successfully merging this pull request may close these issues.

1 participant