Location Datatype

Heads up! The Location datatype is a legacy datatype which has been replaced by the Point datatype. Some functions available on the Point datatype are not available on the Location datatype.

Location is a type that contains latitude, longitude and address. Location is accessed as an array with 3 elements in it. These elements are:

  • The latitude of the location. This may be null, if the object has been recently uploaded. This must be decimal degrees, for example: 41.8657007325722
  • The longitude of the location. This may be null, if the object has been recently uploaded. This must be in decimal degrees, for example: -87.76110202195098
  • A JSON object containing the U.S. address. This may be null. The object has the following members:
    • address – The street address of the location.
    • city – The city this address is in
    • state – The state this address is in
    • zip – The zip code for this address

The following table describes the functions that can be used with locations.

Function Name Description Availability
case(...) Returns different values based on the evaluation of boolean comparisons 2.1
count(...) Returns a count of a given set of records 2.0 and 2.1
within_box(...) Returns the rows that have geodata within the specified box, defined by latitude, longitude corners 2.0 and 2.1
within_circle(...) Returns the rows that have locations within a specified circle, measured in meters 2.0 and 2.1

For example, to query for all of the Seattle Fire 911 Calls calls within 500 meters of the Socrata offices in Seattle:

https://data.seattle.gov/resource/3k2p-39jp.json?$where=within_circle(incident_location, 47.59815, -122.334540, 500)