User:Teslaton/Tools/GeoLocator

GeoLocator is a simple tool (DHTML web application), designed to streamline the process of geotagging, especially for Wikipedians. Latest release is 0.35 (2015-04-11), see changelog.

Tool serves as interactive coordinate editor and metadata markup generator, allowing:
 * visual object localization and picking its exact coordinates from a map
 * visual verification and improvement of existing coordinates/geotag, represented in almost any meaningful format
 * visual definition of viewing diameter
 * visual definition of heading (camera view direction), useful for Wikimedia Commons,   geocoding templates
 * automated authoring of geospatial metadata in various formats – particulary coordinate templates for direct use in Wikipedia articles and geocoding templates for Wikimedia Commons multimedia content.

Features

 * integrated Google Maps control for interactive location and heading selection
 * metadata roundtrip support – pasting of existing geotag, updating it's location and/or parameters and encoding a new one
 * auto elevation/region/address from coords via async. requests to reverse geocoding services
 * flexible coordinate parser (it tries hard to parse almost any text/markup, containing coordinates)
 * editable coordinate parameters (type, scale, region, heading)
 * metadata markup generator with many predefined and one custom template
 * configurable number precisions (decimal degrees and arc seconds)
 * configurable heading angle division (compass rose points): 8, 16, 32 (abbreviations) or 360 (numeric)
 * URL integration

Authoring a brand new template/geotag

 * 1) start from scratch or enter some initial location into query box (in almost any meaningful format).
 * 2) find your location on embedded map (move/zoom/search it as needed)
 * 3) place location marker on most exact location ([Ctrl+click]/[Alt+click] over your location, or by dragging a marker), typically using most detailed map zoom available
 * 4) eventually choose appropriate additional coordinate parameters (type, dim, scale, region)
 * 5) eventually define a viewing diameter around marker location ([Ctrl+Shift+click])
 * 6) eventually define a heading (camera view direction) from selected location ([Shift+mouse move]/[Shift+click])
 * 7) click on resulting geotag markup in most suitable format to copy it to clipboard

Updating or improving an existing coordinates/template/geotag

 * 1) paste existing coordinates or even whole existing geotag into query box and click Apply. Location is shown on a map.
 * 2) update location marker to more exact location (by dragging it or by [Ctrl+click]/[Alt+click] over new location)
 * 3) eventually define a viewing diameter around marker location ([Ctrl+Shift+click])
 * 4) eventually define a heading (camera view direction) from that location ([Shift+mouse move]/[Shift+click])
 * 5) eventually update some of coordinate parameters (type, scale, region)
 * 6) click on resulting geotag markup in most suitable format to copy it to clipboard

Coordinate format conversion or normalization

 * 1) type or paste existing coordinates in some format (D, DM, DMS, template markup or map URL) and click Apply
 * 2) copy parsed coordinates, template markup or map URL (in most suitable output format) via clipboard

Viewing diameter
Viewing diameter, when specified, is used by GeoHack to calculate appropriate map scale – most detailed zoom level, so that whole area inside diameter is visible. Don't be overly precise, when specifying diameter, 2 significant digits are enough (e.g.:  instead of  ).

Use of viewing diameter is preferred over explicit setting of .

Heading
Only use heading (camera view direction) parameter for media (photo) geotagging. It's not intended for wikipedia article related geotags. GeoLocator does not export heading parameter for article templates even if you define one.

Precision
Don't be overly precise. Generally, the larger the object being mapped, the less precise the coordinates should be. A general rule is to give precisions approximately one tenth the size of the object, unless there is a clear reason for additional precision. Overly precise coordinates can be misleading by implying that the geographic area is smaller than it truly is.

Approximate length equivalents of different longitude steps at selected latitudes:

Supported coordinate formats
Query parser makes use of precisely tuned set of regular expression rules and "focuses" on meaningful digit groups only. It therefore accepts wide range of inputs with almost any mixture of separators, whitespace characters or other "garbage", present in query string. This is convenient when using coordinates already present in some format.

Basic coordinate format types:
 * pasted template markup
 * pasted GeoHack URL
 * pasted map URL
 * pasted template markup
 * pasted GeoHack URL
 * pasted map URL

See also query parser online unit tests (just positive cases yet) I use during messing up with it to assure that some case didn't break-up, while adding/altering the other.

Template variables
GeoLocator uses the same template syntax and variables as GeoTemplate does, adding few more: e.g.:   →
 * list of all coordinate parameters in GeoHack format, serialized into single string:
 * , e.g.
 * – the same, prefixed by pipe when non-empty, e.g.
 * – the same, prefixed by underscore when non-empty, e.g.
 * ,,   – the same, but with   parameter excluded (which should be used in camera location geotags only)
 * – generic javascript expression template macro. Expression is evaluated in context with coord data, bound as local variables,
 * digit width specification, e.g.   →

URL parameters
Notices:
 * Don't forget to URL encode all parameters properly, when passing them via URL

Examples:
 * http://tools.freeside.sk/geolocator/geolocator.html?48.1422,17.1 (simplest form with URL query part, directly containing coordinates)
 * http://tools.freeside.sk/geolocator/geolocator.html?q=48.1422,17.1001&dp=4&sp=0 (custom precisions)
 * |48|8|31.92|N|17|6|0|E|type:landmark_dim:260_region:SK%7D%7D http://tools.freeside.sk/geolocator/geolocator.html?q= 48.1422°N, 17.1°W (passing existing template markup)
 * http://tools.freeside.sk/geolocator/geolocator.html?params=48_8_32_N_17_6_0_E_type:landmark_dim:260_region:SK (GeoHack compatible syntax)
 * http://tools.freeside.sk/geolocator/geolocator.html?q=&ct=%7B%7BBilderwunsch/Listeneintrag%7CBREITENGRAD%3D%7Blatdegdec%7D%7CL%C4NGENGRAD%3D%7Blondegdec%7D%7CNAME%3D%7D%7D (custom template)

Design goals

 * simplicity
 * compatibility with GeoTemplate/GeoHack (template syntax, URL syntax, coordinate parameters)
 * compatibility with Google Maps (URL syntax)
 * visual heading definition
 * flexible coordinate parser
 * URL integration (everyting can be set via URL parameters)
 * major browser compatibility

Technology

 * DHTML – object oriented JavaScript, HTML, CSS (GeoLocator is purely client-side application, it is served as static files)
 * GoogleMaps API (client-side AJAX library)
 * browser compatibility: should be working in IE 6+, FF 3+, Opera 9.6+ (with some minor issues), Google Chrome 0.3+
 * (I appreciate any info about other browsers/platforms)

Known issues

 * 1) [Opera/Linux]: Neither [Ctrl+click], nor [Alt+click] does work ([Ctrl+click] is intercepted by Opera, [Alt+click] by window manager)
 * 2) * workaround: use [X+click] instead (hold down [X] character key as a modifier while clicking)
 * 3) [Opera/*]: Heading: when moving mouse while already holding down [Shift], [Shift+click] does not work
 * 4) * workaround: first, move cursor where desired, then press [Shift+click]
 * 5) Display lag or slow response when visualy setting heading/diameter
 * 6) * workaround: use browser with fast JS engine (e.g. recent versions of Firefox, Chrome)
 * 7) * workaround: dont't move mouse while already holding [Shift]/[Ctrl+Shift]. Instead: first, move cursor where desired, then press [Shift+click]/[Ctrl+Shift+click].

ChangeLog
 2015-04-11 0.35  - feature: fulltext search is back again, via Google Places API

- minor: location preview services fixes

2013-01-29 0.31  - feature: fluid layout to maximize map area on higher resolution screens - should work seamlessly on modern browsers, web search ,Google.com - feature: precision visualization (1°, 1', 1/0.1/0.01", 0.0001/0.00001/0.000001°)

- minor: quick clear icons ("[x]" beside template params) - minor: show helper - minor:+Google + Bing, Flickr, Geocaching (location preview services) - minor: + GPX waypoint (export format) - minor: "type:" param excluded from markup (type:camera assumed) - ghparamsnt, ghparamsntp, ghparamsntu macros introduced

2012-03-11 0.30  - minor: clickable custom template - minor: fixes

2011-04-16 0.29  - minor: new standard templates: -, for Commons - minor: partial Polish localization (presets, links, templates only) - minor: stable.toolserver.org/geohack -> toolserver.org/~geohack - minor: auto-show custom template when ct param set

2010-03-31 0.28  - feature: viewing diameter ("dim:D") in/edit/out support - interactive ([Ctrl+Shift+click]) or manual numeric definition - configurable precision (number of significant digits), default: 2 - when dim:D is present in input geotag/url: - initial map scale is calculated according to diameter (scale = 10 * dim) - diameter circle is drawn around marker - feature: OpenStreetMap as layer via OSM Mapnik tile server

- minor: new standard templates: - compatible coords snippet - minor: german template: output of filled-in params only (type, dim, region) - minor: layout fixes - minor: favicon - minir: [X+click] alternative to [Ctrl+click]/[Alt+click] for Opera/Linux

2010-03-20 0.27  - feature: elevation under marker via async. reverse geocoding - currently single fixed service/model only: Aster Global Digital Elevation Model (samples ~ 30x30 m between 83°N..65°S) via geonames.org - @todo: selection from multiple models/services (would require UI changes, settings persistence, too much work for too small benefit for now)

- minor: new map links: - Google Maps: Wikipedia articles, Panoramio photos, Wikimedia Commons photos - OpenStreetMap - GeoHack globe:export - minor: new template params: - {elevation}, {elevationint}, {osmzoom} - minor: new standard templates: - for german wiki ("More wikipedia templates" section)

2008-11-06 0.26  - feature: standard map view presets above map

- i18n: Slovak localization (S-JTSK coord in/out support; sk templates, map links, presets) - minor: support for generic javascript "eval" template macro. Code is evaluated in context with coord data, bound as local variables. E.g.: {% (lonEW == 'E' ? 'v.d.' : 'z.d.') %} -> 'v.d.' - minor: support for template variable digit width specification, e.g. {lonsecdec} -> '8'; {lonsecdec:2} -> '08' - minor: pan control middle button ("Return to the last result") always focuses map on marker - minor: permalink includes map span/center/type. Can be used to save/restore full state.

2008-11-01 0.25  - feature: auto region/address from coord via GoogleMaps reverse geocoding service - feature: coord markup as hyperlink with onclick prompt to ease copy-to-clipboard

- minor: coord parameters also on location display - minor: permalink includes state parameters (precisions, custom template) - fix: Google Chrome browser: mouse event coordinates fix, code font-size fix

2008-10-26 0.22  - first public release after few evenings of consolidation and cleanup

2008-02-10 0.11  - first internal version: simple generic coord parser + fixed markup generator

version archive: · 0.35 (2014-04-11), · 0.34 (2014-10-01), · 0.33 (2014-01-28), · 0.31 (2013-06-01), · 0.30 (2012-03-11), · 0.29 (2011-04-16), · 0.28 (2010-03-31), · 0.27 (2010-03-20), · 0.26 (2008-11-06), · 0.25 (2008-11-01)

Contact

 * For questions, tips, bugs or wishes regarding this tool, please feel free to contact me via:
 * Teslaton/Tools/GeoLocator discussion or wikimail
 * GeoLocator Wikipedia tool page:
 * Teslaton/Tools/GeoLocator
 * My user pages:
 * Teslaton (en.wikipedia.org), Teslaton (sk.wikipedia.org)

Other similar tools

 * hjl_get_CoorE/hjl_geocoding on GISwiki.org
 * Multichill's Coordinates tool
 * Google Maps with crosshair (click to crosshair to display a tag)
 * Google Maps with compass overlay to find heading
 * Dschwen's Commons coordinate conversion helper