日本語
Geometry ドラフト 値型
これはエンティティ型ではなく、属性の値として使う構造です。
ジオメトリ
location などの GeoProperty の値として使う GeoJSON ジオメトリ(RFC 7946)。点(Point)、線(LineString)、面(Polygon)、それぞれの複数形(MultiPoint、MultiLineString、MultiPolygon)、およびそれらをまとめた GeometryCollection。座標は経度・緯度(・高さ)の順で WGS 84。モデルごとに種類を絞ってよい(例 点だけ)。
| IRI | https://datamodels.jp/ns/common/Geometry |
| @context | https://datamodels.jp/context/common/v1.jsonld (エイリアス、互換性のある最新版)https://datamodels.jp/context/common/v1.0.0.jsonld (このバージョン、不変) |
| JSON Schema | /schema/common/Geometry/v1.json/schema/common/Geometry/v1.0.0.json |
| 例 | example.json |
| ソース | github.com/geolonia/datamodels |
使い方
json
"location": {
"$ref": "https://datamodels.jp/schema/common/Geometry/v1.0.0.json",
"x-ngsi": { "type": "GeoProperty", "model": "https://datamodels.jp/ns/common/Geometry" },
"x-iri": "https://uri.etsi.org/ngsi-ld/v1/ngsi-ld-core-context-v1.8.jsonld#location"
}例(key-values)
例は架空のシナリオ(東京都千代田区の大雨対応)です。地名とコードは実在のものですが、出来事・人・チームは架空です。書き方は例の書き方。
json
{
"type": "Polygon",
"coordinates": [
[
[
139.7515,
35.693
],
[
139.755,
35.693
],
[
139.755,
35.6955
],
[
139.7515,
35.6955
],
[
139.7515,
35.693
]
]
]
}注記
- A value type, not an entity type. Use it as the value of the core location GeoProperty (or another GeoProperty) and reference the schema with $ref from an entity schema. The member names (type, coordinates, bbox) and the geometry types (Point, Polygon and so on) are terms of the NGSI-LD core context and expand to the GeoJSON-LD vocabulary; the catalog mints only the class for any of these geometries.
- Stricter than RFC 7946 alone: a position has two or three numbers, and a multi-geometry, a Polygon or a GeometryCollection has at least one member. A model narrows the allowed types with a type constraint next to the $ref, as Attachment does for Point.
- RFC 7946 §3.1.6 requires every linear ring to close (first and last position identical). JSON Schema cannot express this; the catalog's validator checks the rings of every example in the catalog, and consumers should check instances with a GeoJSON-aware library.
- The class is minted (https://datamodels.jp/ns/common/Geometry) because the GeoJSON-LD vocabulary (https://purl.org/geojson/vocab#) defines the individual geometry types but no class for a geometry in general. OGC's Simple Features vocabulary (http://www.opengis.net/ont/sf#Geometry) has such a class, but GeoJSON values in NGSI-LD expand to the GeoJSON-LD types, not to Simple Features.
- Upstream considered (2026-09-25): the GeoJSON schemas at geojson.org (JSON Schema draft-07 while this catalog uses 2020-12; GeometryCollection in a separate file; unversioned URLs; empty coordinate arrays accepted) and Smart Data Models Location-Commons in common-schema.json (six types without GeometryCollection; defines a whole location property rather than a reusable geometry; published on master only). Neither can be referenced as it is; this schema follows the same RFC 7946 structure.
- The NGSI-LD core context (v1.8) defines coordinates and bbox but not geometries, so in JSON-LD processing a GeometryCollection's geometries expand to the core context's default vocabulary, and a collection with a single member compacts back to an object instead of an array. Brokers that store GeoJSON as it is are not affected.
このページのモデル内容は CC BY 4.0 で提供されています。 LICENSE-CONTENT