Giter Club home page Giter Club logo

Comments (14)

andershessellund avatar andershessellund commented on September 16, 2024

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.

dmytro-gokun avatar dmytro-gokun commented on September 16, 2024

@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.

finnjordal avatar finnjordal commented on September 16, 2024

@dmytro-gokun Will the following request meet your needs?

https://dawa.aws.dk/vejstykker?cirkel=15.5851471984198,58.6832383751223,100&format=geojson&struktur=nestet

from dawa.

dmytro-gokun avatar dmytro-gokun commented on September 16, 2024

@finnjordal Absolutely. If it works and returns the correct road information that is exactly what I need.

from dawa.

finnjordal avatar finnjordal commented on September 16, 2024

@dmytro-gokun It works :)

from dawa.

dmytro-gokun avatar dmytro-gokun commented on September 16, 2024

@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.

finnjordal avatar finnjordal commented on September 16, 2024

@dmytro-gokun DAWA only covers Denmark. Coordinates you use are located in Sweden.

from dawa.

dmytro-gokun avatar dmytro-gokun commented on September 16, 2024

@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.

finnjordal avatar finnjordal commented on September 16, 2024

@dmytro-gokun The sort order is increasing (kommunekode, vejkode)

from dawa.

dmytro-gokun avatar dmytro-gokun commented on September 16, 2024

@finnjordal You mean its sorted alphabetically be (kommunekode, vejkode) and not by distance?

from dawa.

finnjordal avatar finnjordal commented on September 16, 2024

@dmytro-gokun yes

from dawa.

dmytro-gokun avatar dmytro-gokun commented on September 16, 2024

@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.

finnjordal avatar finnjordal commented on September 16, 2024

@dmytro-gokun For addresses ("adgangsadresser"), there is no sort order

from dawa.

dmytro-gokun avatar dmytro-gokun commented on September 16, 2024

@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)

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.