Map Transport

This Transport creates a fedwiki ghost page from a geo-located image. It uses exiv2 on the server to extract the GPSInfo in the Exif headers of the image.

VIMEO 171953543 Description of the first version of the map-transport for geo-encoded images, and Wikipedia map references.

Simply drag and drop a map page url or the url of a geocoded image onto the transporter:

POST https://rest.livecode.world/map

# About

With this transporter we also look to experiment and integrate it with how the About Map Plugin works.

In Maps and Places we explore how we may interact with maps in the federation.

Below is the code that converts the Degrees, Minutes, Seconds info into decimal values.

# Code

You can find the latest version of the code here - gist

The function geo_ExtractLatlong() uses some simple text parsing to figure out the lat and long co-ordinates from the url dropped - gist

The basic logic for converting degrees, minutes, and seconds into decimal versions of Latitude and Longitude can be found here:

put sDeg + sMin / 60 + sSec / 3600 into decValue geo_SetNegative decValue, nwse

The command get_SetNegative takes the information provide (north, south, east, west) and negated the decimal value if needed.

command geo_SetNegative @decValue, nwse if char 1 of nwse is among the items of "w,s" then put -1 * decValue into decValue end if end geo_SetNegative

# To Do

It should be enhanced to: - [x] Check geolocation with real examples - [ ] Look at API - mediawiki - [ ] Check GeoHack - mediawiki.org - [ ] Integrate GeoHack.js - it.wikipedia.org

# Exif GPS Standard

According to the exif standard, there are three "rational" fields for each, containing degrees, minutes, and seconds.

exiftool normalizes imporoper decimal degrees into D,M,S while assigning these values, (exiftool -GPSLongitude="0.5 90 63.12345" junk.jpg" -> GPS Longitude: 2 deg 1' 3.12" W") So if you need decimal degrees, you do dd=x0+x1/60.+x2/3600. and could ignore the non-normalization.

$d = $deg + (($min/60) + ($sec/3600)); GPSLatitude = 57 38 56.83 (57/1 38/1 5683/100) GPSLongitude = 10 24 26.79 (10/1 24/1 2679/100) GPS Latitude: 57 deg 38' 56.83" N GPS Longitude: 10 deg 24' 26.79" E GPS Longitude: 10.40744 GPS Position: 57.64911 10.40744