gbv / jskos-proxy

HTTP proxy to serve JSKOS objects
https://uri.gbv.de/terminology/
MIT License
3 stars 2 forks source link

Display geographic information #38

Closed nichtich closed 4 weeks ago

nichtich commented 1 month ago

Requires good examples.

stefandesu commented 1 month ago

There should already be a working (simple) map view when a single coordinate is given via concept.location.coordinates, but as mentioned, we need some examples.

nichtich commented 1 month ago

Example https://uri.gbv.de/terminology/test/21994501-b31d-4bef-bdad-da11cce4c7e8

jskos-proxy needs to explicitly ask dante API for location property:

https://api.dante.gbv.de/data?uri=https://uri.gbv.de/terminology/test/21994501-b31d-4bef-bdad-da11cce4c7e8&properties=location

stefandesu commented 4 weeks ago

Now implemented in Dev. Two issues:

StiftungAusNachlass commented 4 weeks ago

The field location is not loaded in the example, because the example is from testpool and there is a special situation with different masks. This behaviour is different in "real" / "prod" - Pools. Use for example: https://api.dante.gbv.de/voc/top?uri=http:%2F%2Furi.gbv.de%2Fterminology%2Fprizepapers_place%2F&cache=false&properties=+location&limit=50

StiftungAusNachlass commented 4 weeks ago

Zoom: in our plugins we use zoom level 15 for points. For polygons so far into the bounds that there is still a bit of edge everywhere..

stefandesu commented 4 weeks ago

I've set the default zoom level to 15 for Points. For many examples, it still seems way too far zoomed in though.

Other than that, all GeoJSON data supported by Leaflet should work now. Other than the example from the test pool that does not load the location field, do we have examples for other location types than Point?

Also, can we expect there to be always one element in location, and if not, can you provide examples when there are multiples? Currently, it should show multiple maps, but it would be better to show all data in one map.

StiftungAusNachlass commented 4 weeks ago

Here a polygon-example: https://api.dante.gbv.de/data?uri=https://uri.gbv.de/terminology/prizepapers_place/ebf8ca1f-2218-4cf4-9d8c-ec545dd1b450&properties=+location LineString is also allowed in DANTE, but used very rarely. multiple geoJSONs are also possible, but probably not used anywhere. Multiple Maps are ok because it almost never happens anyway.

stefandesu commented 4 weeks ago

The polygon example also works: https://coli-conc.gbv.de/terminology/prizepapers_place/ebf8ca1f-2218-4cf4-9d8c-ec545dd1b450

I tested LineString locally and it should work. I think all GeoJSON points supported by Leaflet should work out of the box. I also implemented multiple locations in one map, even though it's a rare case. (Don't have an example, but works for me locally.)

It would be nice to be able to differentiate between cities or bigger location points, where zoom level 12 or 13 would be more appropriate, and actual single point locations, where zoom level 15 works well. Any opinions/ideas?

Other than that, this issue should be completed now. 👍

StiftungAusNachlass commented 4 weeks ago

No information comes from DANTE as to what type of place it is. Theoretically we have fields “geonames-Type” and “gnd-place-type”, but nobody uses them. I think the only option would be to use a geocoding service. Reverse.

You could try: https://nominatim.openstreetmap.org/ui/reverse.html?lat=42.33665&lon=13.49121&zoom=18 (there is an api for that)

stefandesu commented 4 weeks ago

Even then it would be basically impossible to say whether a certain coordinate is meant to show the whole city or just one specific building in the center of the city. I guess I'll leave it at that for now.

stefandesu commented 4 weeks ago

Example for multiple locations: https://uri.gbv.de/terminology/areal_unit_niedersachsen/faa510c7-6be8-44fd-8af1-50d14c5b7e86