Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Auto-calculate the Bearing (Compass) #73

Open
valerio-bozzolan opened this issue May 17, 2024 · 4 comments
Open

Auto-calculate the Bearing (Compass) #73

valerio-bozzolan opened this issue May 17, 2024 · 4 comments

Comments

@valerio-bozzolan
Copy link

This lovely tool has the potential ability to automagically calculate the bearing. That is, the direction between the location of the person, and the location of the object.

I'm talking about the heading: parameter here:

https://commons.wikimedia.org/wiki/Template:Location

Further details:

https://phabricator.wikimedia.org/T363052


This is an issue that may be interesting during hackatons, or this kind of things \o/

@mkgrgis
Copy link

mkgrgis commented May 17, 2024

Hello, @valerio-bozzolan ! Interface URL point like https://wikimap.toolforge.org/api.php?cat=Pavlovsk_park&subcats&subcatdepth=8&camera=true&locator=true&allco=true yet gives bearing. You also can find, observe and use code under the API.

@valerio-bozzolan
Copy link
Author

Super interesting!

I do not understand if the above API "just" reads the bearing from the template, or, if it calculates it on-the-fly.

@valerio-bozzolan
Copy link
Author

OK so you say that https://commons.wikimedia.org/wiki/File:009._Pavlovsk._Pavlovsky_Park.jpg returns {"pageid":58214112,"ns":6,"title":"File:009. Pavlovsk. Pavlovsky Park.jpg","coordinates":[{"lat":59.6843,"lon":30.44962,"primary":true,"bearing":218,"cam":""} and - since I cannot see the bearing nor in structured data, nor in the template - so it seems it's generating that 🤩

Now let's see that source code:

https://de.wikipedia.org/wiki/Benutzer_Diskussion:DB111/Tools#Issue_tracker_and_source_code_of_WikiMap

@mkgrgis
Copy link

mkgrgis commented May 20, 2024

@valerio-bozzolan I am sorry for closed source code of DB111's utility... Searching under https://commons.wikimedia.org/w/api.php?action=help doesn't seems me easy for our trivial example.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants