perliedman / geojson-path-finder

Find shortest path through a network of GeoJSON
https://www.liedman.net/geojson-path-finder/
ISC License
300 stars 86 forks source link

What are you using to download usable GeoJSON? #49

Closed botto closed 5 years ago

botto commented 5 years ago

Hi, I've been trying to extract usable GeoJSON from OSM extracts for road path finding but I'm having a hell of a time getting a usable file, it's either got disconnected linestrings or is way to big to load.

perliedman commented 5 years ago

Hi, IIRC I used Overpass Turbo to extract the demo area, with some filter to just extract the roads (highway=* or something like that). You should also be able to use query-overpass or similar from the command line.

Hope this helps!

JaxkDev commented 4 years ago

@perliedman Hi i need some help regarding this, so using the overpass api to get roads with highway filters i managed to get all of UK but i then found out this module wont work with it....

A segment of my data im passing to geojson-path-finder (I know its different to your network.json but cant figure out why its not formatted like that...)


  "version": 0.6,
  "generator": "Overpass API 0.7.55.1009 5e627b63",
  "osm3s": {
    "timestamp_osm_base": "2019-10-31T13:58:02Z",
    "copyright": "The data included in this document is from www.openstreetmap.org. The data is made available under ODbL."
  },
  "elements": [

{
  "type": "way",
  "id": 2842,
  "nodes": [
    195486,
    1430977153,
    1430977156,
    1430977140,
    195487,
    195488,
    195489
  ],
  "tags": {
    "active_traffic_management": "yes",
    "bicycle": "no",
    "carriageway_ref": "B",
    "description": "London Orbital Motorway",
    "destination": "(M1, M40, M4);St Albans (A1081);Watford;Heathrow",
    "destination:ref": "M25",
    "destination:symbol": "airport",
    "foot": "no",
    "highway": "motorway",
    "highways_england:area": "DBFO5",
    "horse": "no",
    "int_ref": "E 30",
    "lanes": "3",
    "lit": "yes",
    "maxspeed": "70 mph",
    "maxspeed:type": "UK:motorway",
    "motor_vehicle": "designated",
    "oneway": "yes",
    "operator": "Highways England",
    "ref": "M25",
    "source:maxspeed": "UK:motorway",
    "source:ref": "local_knowledge"
  }
},
perliedman commented 4 years ago

@JaxkDev that is JSON format from the Overpass API, but it is not GeoJSON, so it will not work with geojson-path-finder. Overpass Turbo or the query-overpass module linked above can give you GeoJSON.

JaxkDev commented 4 years ago

@perliedman your query-overpass module has the same issue i'm finding everywhere it doesn’t export the ‘way’ points just generates the base but doesn’t add any ways. I’m not using overpass-turbo because I’m working with large segments of data.

JaxkDev commented 4 years ago

(Exact same problem I’m having: https://github.com/tyrasd/osmtogeojson/issues/101)

perliedman commented 4 years ago

@JaxkDev query-overpass uses osmtogeojson, so that is expected if there is an issue in osmtogeojson. I don't really have insight into that project, nor the time or motivation to dig into it at the moment, I am sorry to say.

JaxkDev commented 4 years ago

Its okay i think its because im only querying the way's and no nodes/relations do i need all 3 ?

perliedman commented 4 years ago

@JaxkDev to be honest, not sure. It's been years since I wrote a query to extract road network from OSM to GeoJSON, and it looks like I did not save the query either, at least I can't find it now. I only used that data for the pathfinder demo, my production use of geojson-path-finder has nothing to do with OSM data.

In the end, you just need the LineString features, but how you get them and what bugs you have to work around is not something I remember.

Sorry to not be of any more help.

JaxkDev commented 4 years ago

hmm, ok thanks anyway.