Including geo coordinates
Using geographic coordinates
In order to maximise the usefulness of your data, it is highly recommended that it includes GeoCoordinates
. Many data users will not use your data unless it includes a latitude
and longitude
within the geo
property of each Place
.
Licensing and republishing
In order to publish geographic coordinates in your open data feed, you must ensure that the source of these coordinates (usually your geocoder) permits you to republish this data under an open licence.
The OpenCage Geocoder is an example of a geocoder that permits such republishing.
The basic Google Geocoding API licence does not permit open data republishing, and does not permit including the data in any externally facing API.
Rendering a geocoding user interface
Given the inaccuracy of geocoding for sports venues, we recommend using leaflet.js (or a similar service) to implement a map to allow your users to move a pin to a specific location.
Leaflet.js and OpenCage implementation example
Below is a copy-and-pastable example of a drag-and-drop map pin and geocoder, that can be used within your booking system to allow the user to enter reliable latitude and longitude data.
It is powered by OpenStreetMap, open data compatible geocoding, and open source libraries.
On load you may specify the map.centerMap(lat, lng)
to set the initial position of the map.
On pressing the geocode button, the geocoder provides both latitude
and longitude
, which can then be stored in your database and later used within your open data feed(s). The map pin can also be used to adjust these values.
See the "Result" tab below for a live demo.
Gladstone: Implementation example
An example of the map pin interface within the Gladstone leisure management system is shown below.
Last updated