Socrata was acquired by Tyler Technologies in 2018 and is now the Data and Insights division of Tyler. The platform is still powered by the same software formerly known as Socrata but you will see references to Data & Insights going forward.

Location Datatype

Location is a type that contains latitude, longitude and address. It may be accessed as an object with 3 keys in it. These keys 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
  • The human_address, which is a JSON object containing the U.S. address of the location. This may be null. The object has the following keys:
    • 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 functions can be used with location fields:

Keyword Name Description Availability
Function Name Description Availability
case(...) Returns different values based on the evaluation of boolean comparisons 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/kzjm-xkqj.json?$where=within_circle(report_location, 47.59815, -122.334540, 500)