By Sandra Schloen, August 2024
*** Note that this feature is offered as Proof-of-Concept based on free geocoding options (use at your own risk) ***
Contact the OCHRE Data Service if you wish to use this feature for your project -- we can potentially build in better constraints, or use a more reliable/flexible (paid) service.
OCHRE supports geocoding -- a process that converts a place or address into latitude/longitude coordinates -- in a variety of contexts. This article describes the OCHRE contexts that support this feature. But use this feature with caution and due consideration. Without additional constraints or context, the results may be ambiguous or misleading, so use at your own discretion and with careful checking of the results. OCHRE makes no claims of accuracy, nor offers any warranty on the results.
The contexts in which this feature is available are:
The Address of a "current person" item
The Coordinates tab of any Geo-item (items which have the Coordinates tab)
In coordination with the Reserved "Address" variable, available from the OCHRE Master project
In coordination with a Coordinate-style Variable of Derivation type "geolocation"
The "current person" Type of a Person or organization item provides address-related metadata fields. Fill in the address details then click the Geocode button to populate the item's Coordinates.
The Geocode icon displays as highlighted (red) when Coordinates are present.
The Coordinates tab of all geo-items provides the Geocode lookup option. In this context, the Geocode tool will use the Name of the item as the lookup address details and will fill in the resulting Coordinates. In this example, "Buckingham Fountain, Chicago, IL" is used as the lookup details.
Begin by grey-copying the alphanumeric "Address" Variable from the "Predefined Variables" list in the OCHRE Master project.
Supply an address as a character string using the Address Variable on a given item, then click the Geocode button on the Coordinates tab.
The data used for this example is a small sample of policing incidents within the Chicago area, available from the Chicago Police Department.
To use this option, create a Coordinate Type Variable, setting its Derivation to Geolocation (or borrow ours from the OCHRE Master Taxonomy).
Then, apply the Geolocation property to an item, providing the address information as the property's Comment field. The Edit tool of the Comment field will be the Geocode button. Click the button to lookup the Coordinates which will populate the Value of the property.
(Note that this option does not use the metadata fields on the item's Coordinates tab.)
This option might be used if multiple Coordinate values are needed. It is also useful if you want to apply Coordinates en masse to a collection of items. In this case you can create a Set of the items containing the Coordinate-style properties. Then when you View the Set with the "Recalculate Derived Variables" option checked (see the Table Column/Tags tab), OCHRE will populate the values of the derived variable for each item as it prepares the table View.
The geocode data created by this feature in OCHRE is provided "as is" without warranty or any representation of accuracy, timeliness of completeness.
In all cases, if Coordinates already exist on an item, the Geocoding tool will prompt for confirmation that they should be overwritten before continuing.
Results may be improved by making small adjustments; e.g. using "AVE" instead of "AV", "BLVD" instead of "BL", etc.
Results may not be reliable depending on how detailed the address information was, or how common / ambiguous the information might be. Results should be verified by some other means if used for meaningful research/analysis. A quick check of the items in OCHRE's Map View may help identify obvious outliers.
Geocoding can be achieved en masse with the help of the OCHRE Data Service, which has this feature built into a sophisticated import tool.
OCHRE is making use of 2 popular APIs that provide free geocoding data, and which have an option to return data as XML. Both services emphasize that they provide no warranty of accuracy, and that these are "use at your own risk." OCHRE reiterates this, if used through the OCHRE implementation of these services.
1) GeoNames
Sample usage: http://api.geonames.org/geocode?q=<fullAddress>&username=
Data is provided for free, "as is" and under a cc-by license
Free usage is limited to 10,000 credits daily (maximum 1,000 / hour, typically 1 credit per request) per username
Requires signing up for a free user account
2) Geocoding API from Map Maker
Sample usage: https://geocode.maps.co/search?q=<fullAddress>&api_key=xxxx&format=xml
Free service which offers "generous limits of up to 1 million queries per month, at a maximum rate of 1 request per second." Note that OCHRE has built in the necessary 1-second delay.
Requires signing up for a free API authorization key.
[Geocode icons by Location Vectors by Vecteezy.]
OCHRE tries the Geocode API first. It seems to be more reliably correct and often offers multiple results, ranked by "importance." If there are multiple results, OCHRE will choose the first one, presumably the most "important." If Geocode comes back empty, OCHRE will then try Geonames.
In this example the GeoNames API gives no results ...
http://api.geonames.org/geocode?q=1700+W+CHICAGO+AVE%2C+IL&username=xxxx
... but the Geocode API finds the expected information ...
https://geocode.maps.co/search?q=1700+W+CHICAGO+AVE%2C+IL&api_key=xxxx&format=xml
The following OCHRE screenshot shows the results of querying for well-being checks by the Chicago Police District (CPD) on a given day in August displayed as a map.