Giter Club home page Giter Club logo

Comments (9)

anvaka avatar anvaka commented on July 21, 2024

I agree. Unfortunately node type wouldn't give me bounding boxes. City of Edinburgh would give correct boundaries though: https://anvaka.github.io/city-roads/?q=city%20of%20Edinburgh

I wonder if there is a way to fetch enclosing areas for a node?

from city-roads.

dasmoth avatar dasmoth commented on July 21, 2024

Yes, I see the lack of bounding boxes is a problem. Ah well.

I wonder if it's possible to do a default -- say -- 5 mile radius if the bounding box isn't defined?

from city-roads.

leighghunt avatar leighghunt commented on July 21, 2024

What about the following - in a few examples I've tried (Edinburgh, Porirua), the osm_type=='node', class=='place', and type=='city' combination returns a reasonable boundingbox value to start with.

Source: https://nominatim.openstreetmap.org/search?format=json&q=edinburgh

[
  {
    "place_id": 109762,
    "licence": "Data © OpenStreetMap contributors, ODbL 1.0. https://osm.org/copyright",
    "osm_type": "node",
    "osm_id": 17898859,
    "boundingbox": [
      "55.7933456",
      "56.1133456",
      "-3.3483749",
      "-3.0283749"
    ],
    "lat": "55.9533456",
    "lon": "-3.1883749",
    "display_name": "Edinburgh, City of Edinburgh, Scotland, EH1 3EG, United Kingdom",
    "class": "place",
    "type": "city",
    "importance": 0.7767042570635242,
    "icon": "https://nominatim.openstreetmap.org/images/mapicons/poi_place_city.p.20.png"
  },
...

from city-roads.

erkanyildiz avatar erkanyildiz commented on July 21, 2024

What about no osm_type constraints, but just checking for existence of boundingbox?

from city-roads.

hanneswidrig avatar hanneswidrig commented on July 21, 2024

I like @erkanyildiz's idea, I am noticing American cities being filtered out for the same reasons.

from city-roads.

johnblackspear avatar johnblackspear commented on July 21, 2024

I wonder if it will be sufficient to change the filter criteria in FindPlace.vue to look for row.boundingbox (like @erkanyildiz suggested) and then conditionally calculating the areaId based on the row.type?

Something like areaId: row.type === 'relation' ? row.osm_id + 36e8 : row.osm_id + 24e8 ?

I'm not super clued up on what the Overpass API expects query-wise, though, so I might be missing subtleties around how the bounding boxes and areas are handled.

from city-roads.

RomanIakovlev avatar RomanIakovlev commented on July 21, 2024

If you have id of administrative center's node, you can query for relation containing this node. I'm not familiar with Overpass API, but if you go to https://www.openstreetmap.org/node/17898859 (node id is taken from @leighghunt's comment above), you'll see that node is member of relation 1920901, and you can take it from there.

from city-roads.

anvaka avatar anvaka commented on July 21, 2024

I like the idea of boundingbox as a fallback! I played with it for a while, and it returns what looks reasonable to me (or at least I perceive it better than complete unavailability of the map).

Opening this would likely result in more cache-misses, and more requests would go to overpass directly.

At the same time with the launch of city-roads I noticed that overpass times out more frequently on me than it used to. I hope I'm just imagining this, and this is not due to the city-roads. I opened a question here: drolbr/Overpass-API#553 to verify. If all is good we should be able to use bounding box soon.

from city-roads.

anvaka avatar anvaka commented on July 21, 2024

The fallback to bounding box is pushed here:

999b941

And it should be deployed. Please let me know if you find anything missing.

from city-roads.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.