Geocoder API

The Geocoder API is a web service within the 3taps Network that allows other programs (both external systems and other parts of the 3taps Network) to calculate the location to use for a posting based on location-specific details within the posting such as a street address or a latitude and longitude value. This process of calculating the location for a posting is known as geocoding.
  1. geocode

    POST /geocoder/geocode

    Calculate the location for a posting

    Params

    data ARRAY An array of postings to geocode. Each entry in this array should be a JSON object containing one or more of the following:
    latitudeFLOATThe GPS latitude value as a decimal degree.
    longitudeFLOATThe GPS longitude value as a decimal degree.
    countrySTRINGThe name of the country.
    stateSTRINGThe name or code of the state or region.
    citySTRINGThe name of the city.
    localitySTRINGThe name of a suburb, area or town within the specified city.
    streetSTRINGThe full street address for this location.
    postalSTRINGA zip or postal code.
    textSTRINGAn unstructured location or address value.

    Returns

    ARRAY An array with one entry for each posting. Each array entry will itself be an array with three entries: (locationCode, latitude, longitude) where locationCode is the three-character location code to use for this posting, and latitude and longitude represent the calculated GPS coordinate for this posting’s location, in the form of floating-point numbers representing decimal degrees. If the posting could not be geocoded at all, locationCode will be set to a null value. If the geocoder was unable to calculate a lat/long value for the posting based on the supplied location details, latitude and longitude will be set to null values.

    Example Response

    [["SFO",37.77493,-122.41942],["LAX",34.05223,-118.24368]]

    Sample Code

    var textLocation = prompt('Enter a location to geocode', 'San Francisco, California');
    var textLocation2 = prompt('Enter another location to geocode', 'Los Angeles, California');
    var data = [
    	{text: textLocation},
    	{text: textLocation2}
    ];
    threeTapsGeocoderClient.geocode(JSON.stringify(data), callback);
    back to top