User:Teslaton/Tools/GeoLocator
From Wikipedia, the free encyclopedia
| URL | tools.freeside.sk/geolocator/geolocator.html |
|---|---|
| Commercial? | No |
| Type of site | Geotagging tool |
| Registration | No |
| Available language(s) | English, Slovak |
| Owner | Teslaton |
| Created by | Teslaton |
| Launched | 2008-10-30 |
| Current status | Online |
GeoLocator is a simple tool (DHTML web application), designed to streamline the process of geotagging, especially for Wikipedians.
It 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 heading (camera view direction), useful for Wikimedia Commons
location,location decgeocoding 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.
Contents |
[edit] Features
- integrated GoogleMap 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 region/address from coord via GoogleMaps reverse geocoding service
- flexible coordinate parser (it tries 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
[edit] Typical usage scenarios
[edit] Authoring a brand new template/geotag
- start from scratch or enter some initial location into query box (in almost any meaningful format).
- find your location on embedded map (move/zoom/search it as needed)
- place location marker on most exact location ([Alt+click] over your location, or by dragging a marker), typically using most detailed map zoom available
- eventually choose appropriate additional coordinate parameters (type, scale, region)
- eventually define a heading (camera view direction) from selected location ([Shift+mouse move]/[Shift+click])
- click on resulting geotag markup in most suitable format to copy it to clipboard
[edit] Updating or improving an existing coordinates/template/geotag
- paste existing coordinates or even whole existing geotag into query box and click Apply. Location is shown on a map.
- update location marker to more exact location (by dragging it or by [Alt+click] over new location)
- eventually define a heading (camera view direction) from that location ([Shift+mouse move]/[Shift+click])
- eventually update some of coordinate parameters (type, scale, region)
- click on resulting geotag markup in most suitable format to copy it to clipboard
[edit] Coordinate format conversion or normalization
- type or paste existing coordinates in some format (D, DM, DMS, template markup or map URL) and click Apply
- copy parsed coordinates, template markup or map URL (in most suitable output format) via clipboard
[edit] Practical hints
[edit] 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.
[edit] 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:
| Latitude | Town | 1° | 1′ | 1″ | 0.1″ | 0.01″ | 0.1° | 0.01° | 0.001° | 0.0001° | 0.00001° | 0.000001° | ||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 60° | Saint Petersburg | 56 km | 0.9 km | 15 m | 1.5 m | 15 cm | 5.6 km | 560 m | 56 m | 5.6 m | 56 cm | 5.6 cm | ||
| 45° | Bordeaux | 79 km | 1.3 km | 22 m | 2.2 m | 22 cm | 7.9 km | 790 m | 79 m | 7.9 m | 79 cm | 7.9 cm | ||
| 30° | New Orleans | 96 km | 1.6 km | 27 m | 2.7 m | 27 cm | 9.6 km | 960 m | 96 m | 9.6 m | 96 cm | 9.6 cm | ||
| 0° (equator) |
Quito | 111 km | 1.9 km | 31 m | 3.1 m | 31 cm | 11.1 km | 1110 m | 111 m | 11.1 m | 111 cm | 11.1 cm |
[edit] Syntax
[edit] 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:
[-] DD[.DDD] [N|S], [-] DDD[.DDD] [E|W][-] DD MM[.MMM] [N|S], DDD MM[.MMM] [E|W][-] DD MM SS[.SSS] [N|S], DDD MM SS[.SSS] [E|W]- 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.
[edit] Template variables
GeoLocator uses the same template syntax and variables as GeoTemplate does, adding few more:
- list of all coordinate parameters in GeoHack format, serialized into single string:
{ghparams}, e.g."type:landmark_scale:1000_region:DE-NI_heading:NEbN"{ghparamsp}– the same, prefixed by pipe when non-empty, e.g."|type:landmark_scale:1000_region:DE-NI_heading:NEbN"{ghparamsu}– the same, prefixed by underscore when non-empty, e.g."_type:landmark_scale:1000_region:DE-NI_heading:NEbN"{ghparamsnh},{ghparamsnhp},{ghparamsnhu}– the same, but withheadingparameter excluded (which should be used in camera location geotags only)
{% expression %}– generic javascript expression template macro. Expression is evaluated in context with coord data, bound as local variables,
e.g.:{% (lonEW == 'E' ? 'v.d.' : 'z.d.') %}→"v.d."- digit width specification, e.g.
{lonsecdec:2}→"08"
[edit] URL parameters
| parameter | description | default value |
|---|---|---|
q, params |
query string – coordinates, map URL or template markup | |
ll |
map center, independent of marker position ([-]DD.DDD,[-]DDD.DDD) | marker position |
spn |
map span ([-]DD.DDD,[-]DDD.DDD) | adaptive |
t |
map type ('m': Map, 'k': Satellite, 'h': Hybrid, 'p': Physical/terrain) |
'h' |
ct |
custom geotag template | {latdegabs}°{latminint:2}′{latsecdec:2}″ {latNS}, |
hp |
heading points – number of compass rose points to use: 4 (N, E, S, W), 8 (N, NE, E, ...), 16 (N, NNE, NE, ...) 32 (N, NbE, NNE, ...) or 360 (decimal angle) |
16 |
dp |
degrees precision – number of decimal places | 6 |
sp |
arc seconds precision – number of decimal places | 2 |
rm |
region mode – region parameter fill-in mode ('auto', 'custom', '') |
'auto' |
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
- http://tools.freeside.sk/geolocator/geolocator.html?q={{coord|48|8|31.92|N|17|6|0|E|type:landmark_region:SK}} (passing existing template markup)
- http://tools.freeside.sk/geolocator/geolocator.html?params=48_8_32_N_17_6_0_E_type:landmark_region:SK (GeoHack compatible syntax)
[edit] 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
[edit] 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, IE 7, FF 3, Opera 9.6 (with some minor issues), Google Chrome 0.3
- (I appreciate any info about other browsers/platforms)
[edit] ChangeLog
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
[edit] Contact
- For questions, tips, bugs or wishes regarding this tool, please feel free to contact me via:
- GeoLocator Wikipedia tool page:
- Teslaton/Tools/GeoLocator
- My user pages:
[edit] 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
[edit] See also
- Geotagging
- Geocoding
- WikiProject Geographical coordinates
- Obtaining geographic coordinates
- Geographic coordinate conversion
- Wikipedia Manual of Style – Geographical coordinates
- Wikimedia Commons media geocoding
- GeoTemplate (doc) – template for GeoHack tool, a common central page for displaying all geotagged locations on Wikimedia projects, including comprehensive list of contextual hyperlinks
- Preferred geotagging templates:
- English Wikipedia:
{{coord...}} - Wikimedia Commons:
{{location...}},{{location dec...}}
- English Wikipedia:
- Geotagging microformats: Geo, KML, ICBM

