Geometry
Points, lines, polygons and GeoJSON. Created with kind geometry.
| Type | Class |
|---|---|
"line" | LineGeometry |
"point" | PointGeometry |
"polygon" | PolygonGeometry |
"geojson" | hand-written factory |
"line" — LineGeometry
{"type": "line", "poses": …}
| Key | Type | Always required | Notes |
|---|---|---|---|
poses | struct std::vector<MapPos> | yes |
| Property | Type | Access | Description |
|---|---|---|---|
poses | struct std::vector<massif::MapPos> | read-only | Returns the list of of map positions defining the line. |
Inherited from Geometry:
| Property | Type | Access | Description |
|---|---|---|---|
bounds | struct massif::MapBounds | read-only | Returns the minimal bounds for the geometry. |
centerPos | struct massif::MapPos | read-only | |
geoJSON | string | read-only | Returns the geometry as a GeoJSON string, in its own coordinates. Here rather than only on Feature because serialising a shape otherwise means constructing a GeoJSONGeometryWriter, which no string-based binding can do. |
type | enum | read-only |
"point" — PointGeometry
{"type": "point", "pos": …}
| Key | Type | Always required | Notes |
|---|---|---|---|
pos | struct MapPos | yes |
| Property | Type | Access | Description |
|---|---|---|---|
pos | struct massif::MapPos | read-only | Returns the position of the point. |
Inherited from Geometry:
| Property | Type | Access | Description |
|---|---|---|---|
bounds | struct massif::MapBounds | read-only | Returns the minimal bounds for the geometry. |
centerPos | struct massif::MapPos | read-only | |
geoJSON | string | read-only | Returns the geometry as a GeoJSON string, in its own coordinates. Here rather than only on Feature because serialising a shape otherwise means constructing a GeoJSONGeometryWriter, which no string-based binding can do. |
type | enum | read-only |
"polygon" — PolygonGeometry
{"type": "polygon", "poses": …, "holes": …}
{"type": "polygon", "poses": …}
{"type": "polygon", "rings": …}
| Key | Type | Always required | Notes |
|---|---|---|---|
poses | struct std::vector<MapPos> | no | |
holes | struct std::vector<std::vector<MapPos> > | no | |
rings | struct std::vector<std::vector<MapPos> > | no |
| Property | Type | Access | Description |
|---|---|---|---|
holes | struct std::vector<std::vector<massif::MapPos> > | read-only | Returns the list of map position lists defining the inner rings of the polygon (holes). |
poses | struct std::vector<massif::MapPos> | read-only | Returns the list of map positions defining the outer ring of the polygon. |
rings | struct std::vector<std::vector<massif::MapPos> > | read-only | Returns the list of map position lists defining the rings of the polygon. |
Inherited from Geometry:
| Property | Type | Access | Description |
|---|---|---|---|
bounds | struct massif::MapBounds | read-only | Returns the minimal bounds for the geometry. |
centerPos | struct massif::MapPos | read-only | |
geoJSON | string | read-only | Returns the geometry as a GeoJSON string, in its own coordinates. Here rather than only on Feature because serialising a shape otherwise means constructing a GeoJSONGeometryWriter, which no string-based binding can do. |
type | enum | read-only |
"geojson"
A GeoJSON reader, not a constructor.
| Key | Type | Notes |
|---|---|---|
geojson | string or object | the document, inline or as a string |
projection | string | target projection, by name — optional |
Base classes
Not constructed directly. Their properties are reachable on every object above that derives from them.
Geometry
| Property | Type | Access | Description |
|---|---|---|---|
bounds | struct massif::MapBounds | read-only | Returns the minimal bounds for the geometry. |
centerPos | struct massif::MapPos | read-only | |
geoJSON | string | read-only | Returns the geometry as a GeoJSON string, in its own coordinates. Here rather than only on Feature because serialising a shape otherwise means constructing a GeoJSONGeometryWriter, which no string-based binding can do. |
type | enum | read-only |