Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions packages/schema/src/features/main.tsp
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ import "./landuse_point.tsp";
import "./marine.tsp";
import "./marine_point.tsp";
import "./nztopo50_carto_text.tsp";
import "./nztopo50_carto_symbol.tsp";
import "./nztopo50_coastline_island.tsp";
import "./nztopo50_dms_grid.tsp";
import "./nztopo50_grid.tsp";
Expand Down
37 changes: 37 additions & 0 deletions packages/schema/src/features/nztopo50_carto_symbol.tsp
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
import "@typespec/json-schema";
import "./common.tsp";

using TypeSpec.JsonSchema;

@jsonSchema("nztopo50_carto_symbol")
@extension("additionalProperties", false)
model nztopo50_carto_symbol {
...ProductFeature;
created_at: utcDateTime;
updated_at: utcDateTime;

/**
* id (UUID) of the feature this symbol annotates: the landuse polygon it sits within, or
* the road centreline it labels.
*
* Null where no feature was close enough to match.
*/
source_id: string | null;

type: carto_symbol_type;
label: string | null;

/** Label rotation in degrees clockwise from east. Null for symbols drawn unrotated. */
orientation: int32 | null;

...GeoParquet;
}

enum carto_symbol_type {
ContourNumber: "contour_number",
GolfCourse: "golf_course",
HighwayShield: "highway_shield",
MineOpencast: "mine_opencast",
MineTraining: "mine_training",
MineUnderground: "mine_underground",
}
107 changes: 107 additions & 0 deletions schema/nztopo50_carto_symbol.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,107 @@
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "nztopo50_carto_symbol",
"type": "object",
"properties": {
"id": {
"type": "string",
"description": "UUIDv7 of the feature"
},
"t50_fid": {
"anyOf": [
{
"type": "integer",
"minimum": 0,
"maximum": 4294967295
},
{
"type": "null"
}
],
"description": "Reference topo50 feature ID.\n\nWill be null if the feature is new and has not been published in a Topo50 edition."
Comment thread
tawera-manaena marked this conversation as resolved.
},
"created_at": {
"type": "string",
"format": "date-time"
},
"updated_at": {
"type": "string",
"format": "date-time"
},
"source_id": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"description": "id (UUID) of the feature this symbol annotates: the landuse polygon it sits within, or\nthe road centreline it labels.\n\nNull where no feature was close enough to match."
},
"type": {
"$ref": "#/$defs/carto_symbol_type"
},
"label": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
]
},
"orientation": {
"anyOf": [
{
"type": "integer",
"minimum": -2147483648,
"maximum": 2147483647
},
{
"type": "null"
}
],
"description": "Label rotation in degrees clockwise from east. Null for symbols drawn unrotated."
},
"geometry": {
"description": "GeoParquet 1.1 covering geometry struct.",
"not": {
"type": "null"
}
},
"bbox": {
"$ref": "#/$defs/BBox",
"description": "GeoParquet 1.1 covering bbox struct."
}
},
"required": ["id", "t50_fid", "created_at", "updated_at", "source_id", "type", "label", "orientation", "geometry"],
"additionalProperties": false,
"$defs": {
"carto_symbol_type": {
"type": "string",
"enum": ["contour_number", "golf_course", "highway_shield", "mine_opencast", "mine_training", "mine_underground"]
},
"BBox": {
"type": "object",
"properties": {
"xmin": {
"type": "number"
},
"ymin": {
"type": "number"
},
"xmax": {
"type": "number"
},
"ymax": {
"type": "number"
}
},
"required": ["xmin", "ymin", "xmax", "ymax"],
"description": "GeoParquet 1.1 covering bbox struct.",
"additionalProperties": false
}
}
}
Loading