Platesmania Information Autofill

Autofills "extra information" field on the upload form with location and date.

نووسەر
_derreck_
Daily installs
0
Total installs
2
Ratings
0 0 0
وەشان
0.4
Created
2025-01-25
Updated
2025-01-25
Size
5.49 KB
مۆڵەت
MIT
Applies to

PLEASE READ THIS! Script will not work by default.

Description

This script will automatically fill the following information box on the upload form:

- Date stamp; format "Month Year". This will be based on the dates that appear below your picture. Since there are usually multiple (one of when the pic was taken, one of when it was edited etc), this script will take the earliest one.

- Location stamp in the following format:
1. Street, but only if it contains a number (like highways)
2. Municiplaity (if not available, it will use town, village, suburb or city, in this order)
3. State
4. Country

The result will look like 'A 58 @ Tilburg, Noord-Brabant, Netherlands - May 2021'

Your pictures need a GPS location embedded into their EXIF tags for this to work. See the off-topic section below for more information.

Things you will have to do after installation

1. In line 15, you can (and should) specify a default location if your photo does not contain a location stamp. To do so, replace the text within the apostrophes (this part: 'Missing location tag - Please define a Default Location in line 15 of the script. See the instructions of the userscript for more information') with your preferred default location. Make sure to only replace the text, not the apostrophes.
If you prefer to not insert a location at all when there is no GPS information, you can disable line 15 (put two slashes // in front of it) and enable line 16 (remove the two slashes). This will result in just adding the date stamp, like "May 2021".

2. You will need an API key from geocode. This API allows us to convert coordinates to addresses (i.e. the location information).
You will need an account. Make one at https://geocode.maps.co/ and click the "free API key" button. Make an account, get your key. Then put it in line 18 between the '...' apostrophes.
The API is free for up to 5000 requests a day. That is far away from the amounts of images we upload to PM, so it will be sufficient.

Screenshot



A bit off-topic talk

Needless to say, your images must have a GPS stamp for the location insertion to work properly. However, during editing, GPS data can sometimes become detached from the images. Additionally, some browsers (especially mobile browsers) strip away EXIF information entirely.

Unfortunately, I can't do anything about that, so please ensure your images retain their GPS tags before uploading. (Keep in mind that PM does not remove these tags either so if you take photos in a private location, such as your home, be sure to remove the location data yourself before uploading).

Most smartphone camera apps can add location data to images if set up correctly. If you want to use this script but your camera lacks a GPS sensor (as is the case with many non-smartphone cameras), and all your photos are taken in the same location, you can use tools like ExifTool to add location data to your images in bulk.

If you’re moving between multiple locations or even take pictures while driving, you can add location data by using a recorded GPX track. Here’s how it works: While taking photos with a camera that doesn’t embed GPS data, you can use an app on your phone to record a GPX track (there are many apps available—just search for “GPX tracker”). A GPX track is essentially a log of where you moved and at what time. Later, using a tool like GeoSetter, you can sync your photos' timestamps with the location+time data in the GPX file. To avoid mismatches, ensure your camera's and phone's clocks are synchronized to the exact second.