Commons:Geocoding/Panorama
From Wikimedia Commons, the free media repository
This project connects two projects. It takes information about the positions of POIs (point of interests) from Wikipedia and shows them on Commons panorama images. So it connects Wikipedia:WikiProject Geographical coordinates and Commons:Geocoding.
As result you can watch directly this example-image. Or you can see images with this feature in Category:Media_with_locations/Panorama, in the description pages of these images you find a box with the name "Panorama-overlay". Follow the link.
Contents |
[edit] How it works
We save the parameters on commons in Template:Location-Panorama and so everybody can participate on this project. With these parameters we start a script that uses the camera position, the angle between the left and right image border to north and the image width to calculate the positions of the objects in the image. But this script can also use to change language and help to generates new templates for Commons, see below.
[edit] Brief syntax description for Template:Location-Panorama
- Syntax
- lon: Longitude (decimal) camera location
- lat: Latitude (decimal) camera location
- left: angle between direction to the north pole and to the left border of the image measured clockwise (degrees)
- right: angle "left" plus horizontal field of view (degrees), the value may be bigger than 360°
- rang: range / dimension of the area with objects (square in kilometers)
- image: image name at commons
- la: preferred language
- pix: show image-width in pixel
- limit: max. count of objects in the square (not all are in the image)
- thumb: yes/no If it is yes the image-resizing function of Common is used
- height1: Distance from the top of the screen to the first objects above in pixel
- height2: Distance from the first objects above (far away) to the last objects below (nearly) in pixel
- exp:' explanation coming soon
- alt this is the camera height above grove in meters. If this value is given, the script use arctan(distance/height) to calculate the position of a label. If this value is not given then the vertical label position is linear or calculating with exponent exp.
- maxheight cuts labels at but tom edge (in pixel)
- Example
{{Location-Panorama |lon=-73.985833 |lat=40.747778 |left=0 |right=79 |rang=30 |image=Assemblage.jpg |la=en |pix=3000 |limit=200 |thumb=yes |height1=50 |height2=300}}
[edit] Usage of the template
- The template seems only useful if more than 5 Wikipedia articles are visible in the image.
- You need to know the exact camera location. Sometimes you can use things in the foreground to get this position. Applications like Google Maps can also help you.
- For the beginners it is best to start from an image where the script is already working. Then edit the URL, change the image-name and the lat/lon parameter.
- For the image-width parameter pix should take a value that the image-height fill a normal screen (900px). But this value also depends on the image quality and object density. Don't play to much with this parameter, because for each value a new thumbnail has to get rendered.
- Determination of the left and right angle might seem difficult, but its very easy. Start the script without left and right-parameter in the url, then you get a form where you can select an object for the left calibration point. Then click into the image below to tell the script where the object is. Then do the same for the right calibration point. Done. The script is now calculating the angles for the left and the right image border. Both objects should be close the border and clearly visible. You should check which point of the object is actually geocoded in Wikipedia. For a church for example it might not always the steeple. Try to click on the geocoded point. Of course, you can also work manually.
- For the alt parameter you need to estimate the altitude of the camera above ground. It works only good if you have a high building or mountain in a nearly flat area.
- Play a little bit with the different height1, height2, limit and range values. The Labels can also be a little bit higher than the object.
- Below the image you can find the filled-out {{Location dec}} and {{Location-Panorama}} templates which you can copy onto the commons image description page if you are satisfied with the result.
[edit] The script
[edit] Source code
The source code is here: [1].
[edit] Hints for viewing the images
- If you move the mouse over a label it shifts to the foreground. This can be useful if the label is hidden by another label.
- If an interesting image part is hidden by labels and you want to see this area then use the browser function to make the font size very small.
[edit] Data
are coming from Wikipedia-World
[edit] Participants
- User:Kolossos developer, contact person
- ...

