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

querying data from local osm file #78

Open
johnbryant1 opened this issue Nov 2, 2018 · 4 comments
Open

querying data from local osm file #78

johnbryant1 opened this issue Nov 2, 2018 · 4 comments

Comments

@johnbryant1
Copy link

Hi, I am trying to query the data of a specific osm file from my hard disk. Is it possible to do so directly using overpy without uploading the osm file it to a localhost? Thank you in advance.

@PolyglotOpenstreetmap
Copy link

`import overpy

with open('test.osm')) as fh:
osm_data = api.parse_xml(data=fh.read(), encoding='utf-8', parser=None)
`

@amenk
Copy link

amenk commented Dec 31, 2019

I assume the idea of @johnbryant1 is to load a local OSM file and run queries against that (correct me if I am wrong).

I tried

    with open('example.osm') as file_handle:
        osm_data = api.parse_xml(data=file_handle.read(), encoding='utf-8', parser=None)

    api = osm_data.api

but

    api.query(query_str)

seems still to query overpass-api.de instead of running in-memory.

@armandomiguel
Copy link

Hi, I'm also interested in getting overpy to work while using a local .osm file instead of the online databases.
After trying the approaches of @PolyglotOpenstreetmap and @amenk, I couldn't get the query to use my local database.

Does anyone have a solution for this?

Thanks in advance.

@nachoSO
Copy link

nachoSO commented Mar 4, 2022

Hello, is there any news about this issue?
I'm sure it is my fault but I also tried with @PolyglotOpenstreetmap proposal and unfortunately it runs the query against the global server.

Can somebody please shed some light on this?
Thank you!

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

5 participants