Terraformer uses the GeoJSON specification as a guide on how to format all representation of geographical data.
A coordinate is the building block for the rest of the GeoJSON specification. It is represented by an array of x
, y
integers. The ordering of x
and y
are important, this means that when representing latitude and longitiude the order is [longitude, latitude]
.
[-122.68, 45.528];
An array of Coordinate objects that are used to define a line or polygon.
[
[-122.68, 45.58],
[-123.23, 45.62],
[-122.8, 45.22],
];
A GeoJSON bounding box is usually a 4-item array representing the rectangle that will contain the GeoJSON object.
[-122.7, 45.51, -122.64, 45.53];
"GeoJSON Geometry" refers to any of the single geometry objects from the geoJSON specification like Point, MultiPoint, LineString, MultiLineString, Polygon, or MultiPolygon.
An object representing a single point.
{
"type": "Point",
"coordinates": [-105.01621, 39.57422]
}
An object representing multiple points as a single coordinate array.
{
"type": "MultiPoint",
"coordinates": [
[-105.01, 39.57],
[-80.66, 35.05]
]
}
A series of coordinates that form a line.
{
"type": "LineString",
"coordinates": [
[-101.5, 39.662],
[-101.75, 39.2415],
[-101.64, 39.2415]
]
}
An object that represents multiple linestrings in a single object.
{
"type": "MultiLineString",
"coordinates": [
[
[-101.5, 39.662],
[-101.75, 39.2415],
[-101.23, 39.2415],
[-101.749, 39.7984],
[-101.5, 39.011]
],
[
[-99.23, 38.6605],
[-99.56, 38.727],
[-99.25, 38.018]
],
[
[-98.499, 38.913],
[-98.499, 38.913],
[-98.38, 38.15],
[-97.5, 38.629]
]
]
}
An array of coordinates defining a polygon.
{
"type": "Polygon",
"coordinates": [
[
[41.83, 71.01],
[56.95, 33.75],
[21.79, 36.56],
[41.83, 71.01]
]
]
}
An object that represents multiple polygons in a single object.
{
"type": "MultiPolygon",
"coordinates": [
[
[
[102.0, 2.0],
[103.0, 2.0],
[103.0, 3.0],
[102.0, 3.0],
[102.0, 2.0]
]
],
[
[
[100.0, 0.0],
[101.0, 0.0],
[101.0, 1.0],
[100.0, 1.0],
[100.0, 0.0]
]
]
]
}
GeoJSON Features combine a Geometry object with a unique identifier and set of metadata.
{
"type": "Feature",
"id": "stadium",
"geometry": {
"type": "Point",
"coordinates": [-104.99404, 39.75621]
},
"properties": {
"name": "Coors Field",
"amenity": "Baseball Stadium",
"popupContent": "This is where the Rockies play!"
}
}
Contains multiple Features objects in a single object.
{
"type": "FeatureCollection",
"features": [
{
"type": "Feature",
"geometry": {
"type": "Point",
"coordinates": [-80.83775386582222, 35.24980190252168]
},
"properties": {
"name": "DOUBLE OAKS CENTER",
"address": "1326 WOODWARD AV"
}
},
{
"type": "Feature",
"geometry": {
"type": "Point",
"coordinates": [-80.83827000459532, 35.25674709224663]
},
"properties": {
"name": "DOUBLE OAKS NEIGHBORHOOD PARK",
"address": "2605 DOUBLE OAKS RD"
}
}
]
}
Contains multiple Geometry objects in a single object.
{
"type": "GeometryCollection",
"geometries": [
{
"type": "Polygon",
"coordinates": [
[
[41.83, 71.01],
[56.95, 33.75],
[21.79, 36.56],
[41.83, 71.01]
]
]
},
{
"type": "MultiPoint",
"coordinates": [
[100, 0],
[45, -122]
]
}
]
}
Terraformer Primitives wrap their GeoJSON counterparts to provide extra functionality.
An object respresenting a GeoJSON Point
An object respresenting a GeoJSON MultiPoint
An object respresenting a GeoJSON LineString
An object respresenting a GeoJSON MultiLineString
An object respresenting a GeoJSON Polygon
An object respresenting a GeoJSON MultiPolygon
An object respresenting a GeoJSON Feature
An object respresenting a GeoJSON FeatureCollection
An object respresenting a GeoJSON GeometryCollection
An object representing a GeoJSON Feature which contains a polygonal representation of a circle.
Envelopes are a common structure for indexes like Terraformer.RTree.
{
x: 1,
y: 1,
w: 15
h: 15
}
Convex
{
x: 1,
y: 1,
w: 15
h: 15
}