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

Config file for OSM extraction #10

Open
nlehuby opened this issue Feb 22, 2018 · 2 comments
Open

Config file for OSM extraction #10

nlehuby opened this issue Feb 22, 2018 · 2 comments
Assignees

Comments

@nlehuby
Copy link

nlehuby commented Feb 22, 2018

It would be great to handle the data extraction from OSM with a config file (instead of having to write code).

We will need a bounding box and some tags to filter (usually the route / route_master tags and/or network tags)

Something like the json file from the osm2gtfs project would be great :

    "query": {
        "bbox": {
            "n": "10.0365",
            "s": "9.8346",
            "e": "-83.8507",
            "w": "-84.2418"
        },
        "tags": {
          "route": "train",
          "network": "Tren Urbano",
          "operator": "Incofer"
        }
    }
@sebkur sebkur self-assigned this Feb 25, 2018
@sebkur
Copy link
Member

sebkur commented Feb 25, 2018

I've already done some work towards this by making fewer import-related things hard-coded.
There's now an OverpassImporter class that fetches some OSM data using the Overpass API and then imports it. The following tests represent the work-in-progress on how that class is currently being used:

The second test shows that it is useful for the configuration to somehow support multiple route types for a single import.

@sebkur
Copy link
Member

sebkur commented Mar 7, 2018

There's now support for an XML-based configuration file. See this minimal example for
San José and the more complex example for Berlin that uses multiple route definitions and processing instructions.

The following tasks use such configuration files:

  • openmetromaps-cli osm-import file
  • openmetromaps-cli osm-import overpass
  • openmetromaps-cli osm-query
  • openmetromaps-cli osm-inspect

The task osm-import overpass can be used to import via Overpass API and the only input required is a configuration file. The task osm-import file uses a configuration file, too, but imports from a local OSM file instead. The task osm-query also operates on a configuration file, but just downloads the specified data from Overpass API for further processing or for use with the osm-import file task. Task osm-inspect is the (draft) importer tool that allows you to inspect the data that is going to be imported, perform the actual import and in the future should also offer support for configuring the data imported more fine-grained.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants