Clarification of the Object table and JSON output of city boundaries API created by Azavea
In this article, I will clarify the object table and JSON output of Azavea's City Boundaries API. For those with programming knowledge, an object table is a data structure used to store data in rows and columns, while JSON (JavaScript Object Notation) is a lightweight data interchange format commonly used for web applications. Azavea's City Boundaries API provides detailed information on the administrative boundaries of cities across the United States, including information such as city name, state, and county. By understanding the object table and JSON output of this API, programmers can better integrate this data into their projects and applications.
Object and Description table
Objects | Description |
type | |
geometry | |
coordinates |
type: This object describes the type of the geographic feature represented by the GeoJSON data. The value of this object can be one of several options, such as "Point", "LineString", "Polygon", "MultiPoint", "MultiLineString", or "MultiPolygon". It's important to correctly specify the type of feature being represented, as this impacts how the feature is displayed and analyzed in mapping applications.
geometry: This object represents the geometric shape of the geographic feature being represented by the GeoJSON data. The specific properties of this object depend on the value of the "type" object. For example, if the "type" object is set to "Point", then the "geometry" object would include the "coordinates" object which specifies the longitude and latitude of the point.
coordinates: This object represents the coordinates of the geographic feature being represented by the GeoJSON data. The specific properties of this object depend on the value of the "type" and "geometry" objects. For example, if the "type" object is set to "Polygon", then the "coordinates" object would include an array of arrays, where each inner array represents a ring of coordinates defining the polygon.
The information in the table is useful for programmers and developers working with geographic data and mapping applications. GeoJSON is a common data format used for representing geographic features, and understanding the different objects and properties within GeoJSON is crucial for correctly visualizing and analyzing these features. By providing a clear and concise list of the objects and their descriptions, the table allows programmers to quickly and easily reference the necessary information needed for working with GeoJSON data. This can help save time and reduce errors when working with complex geographic data, ultimately leading to more accurate and effective mapping applications.
Explaining the JSON
The JSON output is a representation of a GeoJSON feature. The "type" property of the feature is set to "Feature". The "geometry" property describes the geometric shape of the feature, which in this case is a MultiPolygon. The "coordinates" property is an array of coordinates that defines the shape of the MultiPolygon. In this example, the MultiPolygon contains one polygon, which itself contains one ring of coordinates. The ring of coordinates contains one set of coordinates, which is [0, 0]. This can be visualized as a single point at the origin (0, 0) of the coordinate system.
{
"type": "Feature",
"geometry": {
"type": "MultiPolygon",
"coordinates": [
[
[
[
0,
0
]
]
]
]
}
}
Conclusion
We discussed different topics related to data structures and formats used in programming, such as object tables and JSON. We also talked about the usefulness of understanding these structures, particularly when working with geographic data and mapping applications. Finally, we explored an example of a JSON output representing a GeoJSON feature, including its different objects and properties. Overall, this conversation provided insights into important concepts and practices for programmers and developers working with data.
Footnote
It is possible to request access to the Azavea city boundaries API through the third-party data marketplace of Worldindata. This marketplace provides a platform for accessing and exchanging data between data providers and users, including the Azavea city boundaries API. To gain access, users can create an account on the Worldindata platform and request access to the Azavea city boundaries API. Once approved, users can access the API and its data to integrate it into their projects and applications. This provides a convenient and efficient way for programmers to access and utilize the data provided by the Azavea city boundaries API.