Skip to content

querying data from local osm file  #78

Open

Description

@johnbryant1

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.

Activity

  1. PolyglotOpenstreetmap commented on Dec 13, 2018

    @PolyglotOpenstreetmap

    `import overpy

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

  2. amenk commented on Dec 31, 2019

    @amenk

    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.

  3. 0x414D47 commented on May 6, 2020

    @0x414D47

    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.

  4. nachoSO commented on Mar 4, 2022

    @nachoSO

    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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions