Comments (14)
Thank you for your feature request.
It is unlikely that this feature will be implemented any time soon. Therefore, you will have to calculate the distance between the query point and the object on the client to verify that the object is close enough for your purposes. An approximate distance can be easily calculated from the bounding box. Otherwise you probably want to use a third party library for the calculations.
If this feature is implemented in the future, it would probably be done by adding reverse geocoding parameters to the regular query endpoints, such as https://dawa.aws.dk/vejstykker , where a circle parameter is already available.
It is unlikely that we will provide the distance from the query point in responses, as this would require a new response structure and therefore a significantly higher implementation effort.
from dawa.
@andershessellund Thanks for the prompt answer. I understand that I can calculate the distance myself. However, that is not a trivial task to do it properly (e.g. to calculate distance between a point and a MultiLineString on a globe) and I'm not able to find a library for my environment which does that properly. Besides, you already have that st_distance call in the server. So, i thought it would be much easier to do it via this "cirkel" param. This would save me and other people some time. Plus, less calculations means less greenhouse emission :).
In any case, it's up to you to make a final decision here.
Thanks for your work!
from dawa.
@dmytro-gokun Will the following request meet your needs?
from dawa.
@finnjordal Absolutely. If it works and returns the correct road information that is exactly what I need.
from dawa.
@dmytro-gokun It works :)
from dawa.
@finnjordal Does it? When I hit this link:
https://dawa.aws.dk/vejstykker?cirkel=15.5851471984198,58.6832383751223,100&format=geojson&struktur=nestet
it returns:
{
"type": "FeatureCollection",
"crs": {
"type": "name",
"properties": {"name": "EPSG:4326"}
},
"features": [
]
}
If i increase radius to 1000 - nothing, 10000 - still nothing. Only something insane, like 1000 km:
https://dawa.aws.dk/vejstykker?cirkel=15.5851471984198,58.6832383751223,1000000&format=geojson&struktur=nestet
returns plenty of roads far away. Not very useful.
If you looks at this point on Google Maps: https://www.google.com/maps/place/58%C2%B040'59.7%22N+15%C2%B035'06.5%22E/@58.6832384,15.5829585,17z/data=!3m1!4b1!4m5!3m4!1s0x0:0x0!8m2!3d58.6832384!4d15.5851472
you can see that it is in the middle of country and has lot of of roads around.
I could be doing it wrong though. Any help is appreciated.
from dawa.
@dmytro-gokun DAWA only covers Denmark. Coordinates you use are located in Sweden.
from dawa.
@finnjordal Oh, you are right. The only reason i've tried those coordinates was because they were in your sample :D. But it works great, indeed. Thanks a lot!
Do you perhaps know if result set is ordered by increasing distance from the original point or not?
from dawa.
@dmytro-gokun The sort order is increasing (kommunekode, vejkode)
from dawa.
@finnjordal You mean its sorted alphabetically be (kommunekode, vejkode) and not by distance?
from dawa.
@dmytro-gokun yes
from dawa.
@finnjordal Okay. I guess it does not make big difference for small radius... Still, to me it would make much more sense if it were sorted by distance. In that case I'd be able to take the first one and be sure it is what I need (the closest road).
Do you perhaps know what is the sort order when using "cirkel" parameter with "adgangsadresser" endpoint?
from dawa.
@dmytro-gokun For addresses ("adgangsadresser"), there is no sort order
from dawa.
@finnjordal Do you think there is any chance that might be fixed? Again, when one is looking for a closest address (or road), it makes sense to sort accordingly...
from dawa.
Related Issues (20)
- Fjern docs for BBR beta
- Køre BBR data på inaktivt igen
- Fjern link til INSPIRE tjeneste på forsiden af DAWA
- Datavask fejlkategorisering
- Changes og maxChangers med i humio alert
- Vejnavn i vejnavne, som ikke findes i vejstykker eller navngivneveje HOT 1
- Nye adgangsadresser forsynes med højden -1. HOT 3
- Tastefejl i dokumentationen af suppelrende bynavne
- Menu i navbar kan ikke aktiveres ved lille vinduesstørrelse HOT 1
- Opdater autocomplete byg
- test
- bfe nummer er null på jordstykke autocomplete
- x
- Datavask. Identisk id skal give kategori A
- Slåfejl
- Tilføj manglende betegnelser
- Søgeresultaterne fra autocomplete ikke optimal
- Beskrivelse af srid parameteren mangler i beskrivelsen af BBRLight bygninger HOT 1
- Unexpected Exit? HOT 3
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 dawa.