Skip to content

Commit

Permalink
add schema 1.1.0
Browse files Browse the repository at this point in the history
  • Loading branch information
bertt committed Jun 28, 2024
1 parent 47032cf commit f4de410
Show file tree
Hide file tree
Showing 2 changed files with 160 additions and 23 deletions.
157 changes: 156 additions & 1 deletion geoparquet.codegen/1.1.0/schema.json
Original file line number Diff line number Diff line change
@@ -1 +1,156 @@
{"$schema":"http://json-schema.org/draft-07/schema#","title":"GeoParquet","description":"Parquet metadata included in the geo field.","type":"object","required":["version","primary_column","columns"],"properties":{"version":{"type":"string","const":"1.1.0"},"primary_column":{"type":"string","minLength":1},"columns":{"type":"object","minProperties":1,"patternProperties":{".+":{"type":"object","required":["encoding","geometry_types"],"properties":{"encoding":{"type":"string","pattern":"^(WKB|point|linestring|polygon|multipoint|multilinestring|multipolygon)$"},"geometry_types":{"type":"array","uniqueItems":true,"items":{"type":"string","pattern":"^(GeometryCollection|(Multi)?(Point|LineString|Polygon))( Z)?$"}},"crs":{"oneOf":[{"$ref":"https://proj.org/schemas/v0.7/projjson.schema.json"},{"type":"null"}]},"edges":{"type":"string","enum":["planar","spherical"]},"orientation":{"type":"string","const":"counterclockwise"},"bbox":{"type":"array","items":{"type":"number"},"oneOf":[{"description":"2D bbox consisting of (xmin, ymin, xmax, ymax)","minItems":4,"maxItems":4},{"description":"3D bbox consisting of (xmin, ymin, zmin, xmax, ymax, zmax)","minItems":6,"maxItems":6}]},"epoch":{"type":"number"},"covering":{"type":"object","required":["bbox"],"properties":{"bbox":{"type":"object","required":["xmin","xmax","ymin","ymax"],"properties":{"xmin":{"type":"array","items":[{"type":"string","minLength":1},{"const":"xmin"}],"minItems":2,"maxItems":2},"xmax":{"type":"array","items":[{"type":"string","minLength":1},{"const":"xmax"}],"minItems":2,"maxItems":2},"ymin":{"type":"array","items":[{"type":"string","minLength":1},{"const":"ymin"}],"minItems":2,"maxItems":2},"ymax":{"type":"array","items":[{"type":"string","minLength":1},{"const":"ymax"}],"minItems":2,"maxItems":2}}}}}}}},"additionalProperties":false}}}
{
"$schema": "http://json-schema.org/draft-07/schema#",
"title": "GeoParquet",
"description": "Parquet metadata included in the geo field.",
"type": "object",
"required": [
"version",
"primary_column",
"columns"
],
"properties": {
"version": {
"type": "string",
"const": "1.1.0"
},
"primary_column": {
"type": "string",
"minLength": 1
},
"columns": {
"type": "object",
"minProperties": 1,
"patternProperties": {
".+": {
"type": "object",
"required": [
"encoding",
"geometry_types"
],
"properties": {
"encoding": {
"type": "string",
"pattern": "^(WKB|point|linestring|polygon|multipoint|multilinestring|multipolygon)$"
},
"geometry_types": {
"type": "array",
"uniqueItems": true,
"items": {
"type": "string",
"pattern": "^(GeometryCollection|(Multi)?(Point|LineString|Polygon))( Z)?$"
}
},
"edges": {
"type": "string",
"enum": [
"planar",
"spherical"
]
},
"orientation": {
"type": "string",
"const": "counterclockwise"
},
"bbox": {
"type": "array",
"items": {
"type": "number"
},
"oneOf": [
{
"description": "2D bbox consisting of (xmin, ymin, xmax, ymax)",
"minItems": 4,
"maxItems": 4
},
{
"description": "3D bbox consisting of (xmin, ymin, zmin, xmax, ymax, zmax)",
"minItems": 6,
"maxItems": 6
}
]
},
"epoch": {
"type": "number"
},
"covering": {
"type": "object",
"required": [
"bbox"
],
"properties": {
"bbox": {
"type": "object",
"required": [
"xmin",
"xmax",
"ymin",
"ymax"
],
"properties": {
"xmin": {
"type": "array",
"items": [
{
"type": "string",
"minLength": 1
},
{
"const": "xmin"
}
],
"minItems": 2,
"maxItems": 2
},
"xmax": {
"type": "array",
"items": [
{
"type": "string",
"minLength": 1
},
{
"const": "xmax"
}
],
"minItems": 2,
"maxItems": 2
},
"ymin": {
"type": "array",
"items": [
{
"type": "string",
"minLength": 1
},
{
"const": "ymin"
}
],
"minItems": 2,
"maxItems": 2
},
"ymax": {
"type": "array",
"items": [
{
"type": "string",
"minLength": 1
},
{
"const": "ymax"
}
],
"minItems": 2,
"maxItems": 2
}
}
}
}
}
}
}
},
"additionalProperties": false
}
}
}
26 changes: 4 additions & 22 deletions src/GeoParquet.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
//----------------------
// <auto-generated>
// Generated using the NJsonSchema v10.9.0.0 (Newtonsoft.Json v9.0.0.0) (http://NJsonSchema.org)
// Generated using the NJsonSchema v11.0.1.0 (Newtonsoft.Json v13.0.0.0) (http://NJsonSchema.org)
// </auto-generated>
//----------------------

Expand All @@ -12,27 +12,21 @@ namespace GeoParquet
/// <summary>
/// Parquet metadata included in the geo field.
/// </summary>
[System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "10.9.0.0 (Newtonsoft.Json v9.0.0.0)")]
[System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "11.0.1.0 (Newtonsoft.Json v13.0.0.0)")]
public partial class GeoParquet
{

[System.Text.Json.Serialization.JsonPropertyName("version")]

[System.Text.Json.Serialization.JsonIgnore(Condition = System.Text.Json.Serialization.JsonIgnoreCondition.Never)]
[System.ComponentModel.DataAnnotations.Required(AllowEmptyStrings = true)]
public string Version { get; set; }


[System.Text.Json.Serialization.JsonPropertyName("primary_column")]

[System.Text.Json.Serialization.JsonIgnore(Condition = System.Text.Json.Serialization.JsonIgnoreCondition.Never)]
[System.ComponentModel.DataAnnotations.Required]
public string Primary_column { get; set; }


[System.Text.Json.Serialization.JsonPropertyName("columns")]

[System.Text.Json.Serialization.JsonIgnore(Condition = System.Text.Json.Serialization.JsonIgnoreCondition.Never)]
[System.ComponentModel.DataAnnotations.Required]
public System.Collections.Generic.IDictionary<string, GeoColumn> Columns { get; set; } = new System.Collections.Generic.Dictionary<string, GeoColumn>();

Expand All @@ -49,46 +43,34 @@ public System.Collections.Generic.IDictionary<string, object> AdditionalProperti

}

[System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "10.9.0.0 (Newtonsoft.Json v9.0.0.0)")]
[System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "11.0.1.0 (Newtonsoft.Json v13.0.0.0)")]
public partial class GeoColumn
{

[System.Text.Json.Serialization.JsonPropertyName("encoding")]

[System.Text.Json.Serialization.JsonIgnore(Condition = System.Text.Json.Serialization.JsonIgnoreCondition.Never)]
[System.ComponentModel.DataAnnotations.Required(AllowEmptyStrings = true)]
public string Encoding { get; set; }


[System.Text.Json.Serialization.JsonPropertyName("geometry_types")]

[System.Text.Json.Serialization.JsonIgnore(Condition = System.Text.Json.Serialization.JsonIgnoreCondition.Never)]
[System.ComponentModel.DataAnnotations.Required]
public System.Collections.Generic.ICollection<string> Geometry_types { get; set; } = new System.Collections.ObjectModel.Collection<string>();


[System.Text.Json.Serialization.JsonPropertyName("edges")]

[System.Text.Json.Serialization.JsonIgnore(Condition = System.Text.Json.Serialization.JsonIgnoreCondition.WhenWritingDefault)]
[System.Text.Json.Serialization.JsonConverter(typeof(System.Text.Json.Serialization.JsonStringEnumConverter))]
public Edges Edges { get; set; }


[System.Text.Json.Serialization.JsonPropertyName("orientation")]

[System.Text.Json.Serialization.JsonIgnore(Condition = System.Text.Json.Serialization.JsonIgnoreCondition.WhenWritingDefault)]
public string Orientation { get; set; }


[System.Text.Json.Serialization.JsonPropertyName("bbox")]

[System.Text.Json.Serialization.JsonIgnore(Condition = System.Text.Json.Serialization.JsonIgnoreCondition.WhenWritingDefault)]
public object Bbox { get; set; }


[System.Text.Json.Serialization.JsonPropertyName("epoch")]

[System.Text.Json.Serialization.JsonIgnore(Condition = System.Text.Json.Serialization.JsonIgnoreCondition.WhenWritingDefault)]
public double Epoch { get; set; }


Expand All @@ -104,7 +86,7 @@ public System.Collections.Generic.IDictionary<string, object> AdditionalProperti

}

[System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "10.9.0.0 (Newtonsoft.Json v9.0.0.0)")]
[System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "11.0.1.0 (Newtonsoft.Json v13.0.0.0)")]
public enum Edges
{

Expand Down

0 comments on commit f4de410

Please sign in to comment.