geoadmin / mf-chsdi3

api3.geo.admin.ch source code
https://api3.geo.admin.ch
Other
33 stars 15 forks source link

Layer search: return attribution value #3360

Open fredj opened 4 years ago

fredj commented 4 years ago

It would be nice if the layer search service could return the attribution value in the result (swisstopo, OFCOM, ...). This information is currently (if I remember correctly) only present in the layersConfig.json file

procrastinatio commented 4 years ago

Do you mean the search service (http://api3.geo.admin.ch/services/sdiservices.html#search)?

You have the origin attribute (zipcode, gazeetter, etc..) which gives you a hint about the attribution to set, far from ideal, I know. The trouble is that the layersConfig.json is not supposed to be used outside map.geo.admin.ch.

Alternatively, you may use the layer metadata service (http://api3.geo.admin.ch/services/sdiservices.html#layers-metadata), which is a bit more verbose

Metadata for all layer in the API: http://api3.geo.admin.ch/rest/services/api/MapServer

Searching a specific layer: http://api3.geo.admin.ch/rest/services/api/MapServer?searchText=bird&lang=en

@davidoesch @boecklic Any thought?

davidoesch commented 4 years ago

I fully agree with @procrastinatio It is all there

@fredj what is your specific use case? We need to go direction of the OGC API In the Future

fredj commented 4 years ago

Hi,

What I want to do is the same as the search input in map.geo.admin.ch: let the user search for a layer (using the search service) and add the selected layer to the map (a cesium map in my case).

p1d1d1 commented 4 years ago

You could pass the layer name as value for "searchText" to the "layer metadata service" and read the attribution in "dataOwner" e.g. http://api3.geo.admin.ch/rest/services/api/MapServer?searchText=ch.bafu.bundesinventare-jagdbanngebiete&lang=en