Comments (9)
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.
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.
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.
What about no osm_type
constraints, but just checking for existence of boundingbox
?
from city-roads.
I like @erkanyildiz's idea, I am noticing American cities being filtered out for the same reasons.
from city-roads.
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.
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.
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.
The fallback to bounding box is pushed here:
And it should be deployed. Please let me know if you find anything missing.
from city-roads.
Related Issues (20)
- Map Scale HOT 1
- Allow a way to generate a map from pin point + radius.
- Filled areas with non closed boundaries
- Broken rendering of Venice, Italy roads
- OSM Error HOT 1
- [Feature Request] Add subway/train lines
- [Feature Request] Display city (area) boundaries
- [Feature Request] Add export HOT 2
- Possible to export/save settings for re-rendering later? HOT 1
- Configure fill?
- Waterways
- [Feature Request] Allow city-roads read local OSM file to avoid mass network request HOT 3
- OSM Error HOT 1
- hhh
- Differing paths in SVG export compared to OSM data
- Bad map loading experience
- OSM Error HOT 1
- OSM Error HOT 1
- OSM Error HOT 1
- OSM Error HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from city-roads.