GeoAdmin API Identify order of multiple results

14 views
Skip to first unread message
Assigned to procras...@gmail.com by david...@gmail.com

Pascal Arnet

unread,
Feb 8, 2022, 10:33:10 AMFeb 8
to GeoAdminCh API
Hello,

I'm using the identify endpoint https://api3.geo.admin.ch/rest/services/api/MapServer/identify with the tolerance parameter different than 0. In some cases I get more than one result. Now I have the problem that I cannot identify the result that is the closest to my request, because the results are sorted in an order other than distance to my coordinates submitted in the request. And I cannot find out which of the results is the one that I am looking for. I assume the closer the better.

Is there a way to get the closest object regarding my point coordinates?

Best regards,
Pascal

Marc Monnerat

unread,
Feb 8, 2022, 11:36:23 AMFeb 8
to geoadmin-api
Hello Pascal,

The features returned by the identify service are not sorted, because the primarily aim of this service was to highlight features in map.geo.admin.ch (kind of visual search)

Unfortunately, that means that you have to sort the features by yourself, but I agree, it would be a nice addition to the service.

Regards,

Marc



--
You received this message because you are subscribed to the Google Groups "GeoAdminCh API" group.
To unsubscribe from this group and stop receiving emails from it, send an email to geoadmin-api...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/geoadmin-api/a9dbf69e-272e-4fdb-a1f9-4a1a0e8c2cedn%40googlegroups.com.


--
--
Всё идёт по плану

David...@swisstopo.ch

unread,
Feb 9, 2022, 2:55:57 AMFeb 9
to geoadm...@googlegroups.com

Hi Pascal

 

One option: you take the results, write it o an array/list and calculate the distance based on the distance of your input coordinate and the coords of the results

Reply all
Reply to author
Forward
0 new messages