Wikimedia-Austria / WikiDaheim

The front-end of WikiDaheim
https://wikidaheim.at
7 stars 4 forks source link

Filter coordinates in GPX file based on current selection #95

Closed BraveheartWikimedia closed 1 year ago

BraveheartWikimedia commented 4 years ago

Hi Bene,

would it be possible to filter the coordinates in the GPX filter based on the criteria set on screen? That would help limit the displayed data on map to the objects you actually want to go to, instead of getting everything.

BR, Philip

reiterbene commented 4 years ago

The GPX-Link that is generated already passes the selected categories. E.g.: https://api.wikidaheim.at/gpx.php?wikidata=Q143140&categories=request

Only the Properties-Settings (Missing Pictures/Description) do not affect the content of the GPX-File as these are filters the server isn't aware of. If we want to add those properties @pixelhaufen would have to implement it in the API first.

BraveheartWikimedia commented 4 years ago

Ok, thank you, I'll talk to Ruben then. I think being able to filter by missing pictures would be a keystone of this feature.

pixelhaufen commented 4 years ago

Default is only objects with missing images and coordinates. Add &data=all for every object with coordinates. Please note that the wikidata part is in the moment under development and the gpx will be the last peace in the puzzle to the update.

reiterbene commented 4 years ago

What I've done so far: If there is no filter selected (pictures/description) &data=all is attached. This should work in most cases.

@pixelhaufen there are more filter criteria available to the user (missing pictures and/or missing description) so it is currently not possible to generate a 1:1 link.

@BraveheartWikimedia does the current solution satisfy your requirements?

BraveheartWikimedia commented 4 years ago

Would work for me, depends on if Ruben can use this.

pixelhaufen commented 4 years ago

Sorry, I have no idea how the gui-logic should be. For the gpx-api:

reiterbene commented 4 years ago

we have a third case: missing description which isn't represented by the gpx-api yet

pixelhaufen commented 4 years ago

I know - but there is absolutely no use (at least that I'm aware of) for a gpx-file (which contains exactly what the photographers asked for) with the coordinates of objects that have no description. Even the source where it could be added is not part of the data and there is no way to find an object based on the coordinates to add the missing data... If it makes sense to send the call to return the objects with missing pictures if the user has only selected missing description is beyond my logic.

HerziPinki commented 1 year ago

Complaining user is still not satisfied: see https://de.wikipedia.org/wiki/Wikipedia_Diskussion:WikiDaheim/2023#Fehlende_Objekte_in_gpx-Datei

the only filter applied is that of 'missing images' (with coordinates, otherwise they cannot be displayed on a map). This is the main use case that should work properly.

The gpx for Linz even shows more objects than the WikiDaheim App (unfiltered).

For each of the objects above there are three sources in Wikidaheim: the Denkmalliste, the WP article and Commons-Category. Commons-Category is unlikely to be a source (only true for empty categories).

more data, still no clue.

BraveheartWikimedia commented 1 year ago

@pixelhaufen Is that something you're able to explain? Otherwise we'll have to go through it in a joint session to figure out what's going on here.

reiterbene commented 1 year ago

Regarding the multiple entries in the GPX-File: On the Client-Side there is a merging-script that merges items with the same geocode. As this happens on the client side and the GPX-File is generated on the server-side the merging does not apply to that. (see https://github.com/Wikimedia-Austria/WikiDaheim/blob/5ed90afef38ef2cfff523990e60fa0c62f3e4938/src/redux/reducers/app.js#L160)

HerziPinki commented 1 year ago

a case study: Hirtenberg (https://wikidaheim.at/Q687402), 33 objects, 26 thereof without image (on the frontend).

In the gpx there are 90 objects listed (filtered with no image). Content: https://www.google.com/maps/d/edit?mid=1zJGbtvzYXSiOe_ylZmKCzEtrcV6r2qQ&ll=47.92996603682447%2C16.180869293384838&z=15

Name Beschreibung Bild in gpx in frontend (w/out) in frontend (with) Quelle verlinkt nach
Hirtenberg Gemeinde in Österreich x x nein x Wikidata wikipedia
Category:Fire station in Hirtenberg Feuerwehrhaus in Hirtenberg, Österreich x x nein x Wikidata commons
Pfarrkirche Hirtenberg Kirche in Hirtenberg (54233) x x nein x Wikidata wikipedia
Kath. Pfarrkirche hl. Elisabeth   x nein nein x Denkmalliste  
Justizanstalt Hirtenberg Gefängnis in Hirtenberg, Niederösterreich x x nein x DenkmallisteWikidata wikidata verlinkt nach wikipedia?
Category:Bahnhof Hirtenberg Bahnhof in Österreich x x x Wikidata commons
Bruckerkapelle Kapelle in Hirtenberg (79527) x x nein x DenkmallisteWikidata  
Hirtenberg typische Gesamtansicht der Gemeinde Hirtenberg nein x x x Bilderwunsch wikipedia
20 Platanen Die Platanen befinden sich auf dem Gelände des ehemaligen Sommeranwesens des Industriellen Eduard von Schickh, das später als Waisenhaus diente und heute die Justizanstalt Hirtenberg beherbergt. nein x x x Naturdenkmal wikipedia

(for the station I added an image to wikidata P18 - so the behaviour might change)

reiterbene commented 1 year ago

Solution: generate GPX file on the fly in fronte-end.