Generate aerial image metadata for submission to Lantmäteriet for public distribution approval.
Who is this for?
People who take aerial photographs or videos in Sweden, perhaps with a drone.
Why does this exist?
Sweden has strong surveillence laws, and as such it's illegal to publicly publish photos or videos taken from the air without approval from the the Swedish mapping, cadastral and land registration authority: Lantmäteriet. This includes publishing them online, including on social networks like Facebook, Twitter, and the like.
More information on Sweden's laws surrounding drones can be found (in Swedish):
Submission to Lantmäteriet for photo and video approval can be made using this form. Multiple images can be submitted from one form submission.
For each image you wish to publish, you need to provide the image's:
- Street address, including kommun.
- Fastighetsbeteckning (a kind of property designation).
- The image's coordinate.
An entry for a single image might look like this:
|File Name||Street Address||Kommun||Fastighetsbeteckning||Coordinate|
|DJI_0005.jpg||Fågelsta Arbetarbostaden 2||SALEM||VÄLLINGE 1:1||59° 13’ 19,65” N, 17° 44’ 41,166” E|
You can manually look up a coordinate's street address using Google Maps or similar, but for the fastighetsbeteckning you need to use the Lantmäteriet map to look it up.
As you can imagine, doing this manually can be a very time-consuming task!
What does it do?
This little program automates the above process, taking some images and generating a table of data for submission to Lantmäteriet.
This program will not do the submission for you! It's reasonably common for automated lookups of addresses and the fastighetsbeteckning to return low-accuracy or no data at all, especially if you're flying your drone over water, or otherwise outside of civilisation.
This project uses the Swift Package Manager, and requires Xcode 10 or higher be installed.
- Clone the repository to your computer.
cdto the repository and run
swift package updateto update dependencies.
swift buildto build the project.
- If you want to work on it, you can run
swift package generate-xcodeprojto create an Xcode project. As per Swift Package Manager convention, don't check this into the repo!
For a nice HTML table that includes location lookup links to Google Maps and Lantmäteriet to help manually tidying up the data, you can run:
$ lantmateriet-lookup -i *.jpg -html results.html
For text-based output, you can run:
$ lantmateriet-lookup -i *.jpg -tsv results.tsv
Text output won't include Google Maps and Lantmäteriet map URLs by default, but you can include them with
$ lantmateriet-lookup -i *.jpg -u -tsv results.tsv
If you omit both
-tsv, text output will be written to
stdout, for your piping and redirecting pleasure.
You can see a HTML table generated by this tool here.