Get Cityname from search result

136 views
Skip to first unread message

fopsdev

unread,
Mar 9, 2021, 3:22:10 PM3/9/21
to GeoAdmin API
hi there

would like to use the search-rest-api to validate some addresses.

is the search-api using locations-type the right approach?

i'm asking this because perfroming the following request:

https://api3.geo.admin.ch/rest/services/api/SearchServer?type=locations&searchText=paradeplatz%202

results in some not so easy to parse fields like:  "detail":"paradeplatz 2 8001 zuerich 261 zuerich ch zh"  

i can't find the cityname as a standlone attribute here. is this the right way to search for addresses (plz, cityname,...) using fuzzy search?

thanks for any enlightment

David...@swisstopo.ch

unread,
Mar 10, 2021, 2:19:59 AM3/10/21
to geoadm...@googlegroups.com

To Validate ZIP or  places

 

the use the  find service

http://api.geo.admin.ch/services/sdiservices.html#find

 

Layer with places and ZIP

ch.swisstopo-vd.ortschaftenverzeichnis_plz  (eg https://s.geo.admin.ch/8f465accaf)

 

and have a look for examples

 

 

 

reverse geocoding examples http://api.geo.admin.ch/services/sdiservices.html#examples-of-reverse-geocoding

--
You received this message because you are subscribed to the Google Groups "GeoAdmin 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/768fd4c7-d207-472b-a998-b422ad35a447n%40googlegroups.com.

Christof Kälin

unread,
Nov 18, 2022, 9:51:06 AM11/18/22
to GeoAdminCh API
So basically, this one should be the correct kind of request with the ZIP code as the input: https://api3.geo.admin.ch/rest/services/api/MapServer/find?searchText=3084&searchField=plz&layer=ch.swisstopo-vd.ortschaftenverzeichnis_plz&returnGeometry=false
And use the value from the langtext attribute

David Oesch

unread,
Nov 18, 2022, 12:17:27 PM11/18/22
to geoadm...@googlegroups.com
Yes this the simplest approach 

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.
Reply all
Reply to author
Forward
0 new messages