From 85a1f34f74322959b89e281be20f21935b5de101 Mon Sep 17 00:00:00 2001 From: Blake Thompson Date: Thu, 19 Jul 2018 09:34:58 -0500 Subject: [PATCH 1/7] Added splines and spline types to features --- 3.0/vector_tile.proto | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/3.0/vector_tile.proto b/3.0/vector_tile.proto index 29a1580..fe11d67 100644 --- a/3.0/vector_tile.proto +++ b/3.0/vector_tile.proto @@ -10,6 +10,8 @@ message Tile { POINT = 1; LINESTRING = 2; POLYGON = 3; + CURVE = 4; // like a LineString, but a spline + AREA = 5; // like a Polygon, but a spline } // Variant type encoding @@ -81,6 +83,10 @@ message Tile { // A string as a unique identifier for the Feature. Use either // id or string_id, but not both. See spec section 4.2. optional string string_id = 10; + + // Representation of spline knots to be clarified: + // https://github.com/mapbox/vector-tile-spec/issues/114 + repeated double knots = 5 [ packed = true ]; } // Layers are described in section 4.1 of the specification From 6edacb7b1d9a1c8fec60e30ee215b9adcc1620b4 Mon Sep 17 00:00:00 2001 From: Eric Fischer Date: Mon, 17 Sep 2018 16:51:33 -0700 Subject: [PATCH 2/7] Remove area type, since we don't know how it will work --- 3.0/vector_tile.proto | 1 - 1 file changed, 1 deletion(-) diff --git a/3.0/vector_tile.proto b/3.0/vector_tile.proto index fe11d67..c6540ac 100644 --- a/3.0/vector_tile.proto +++ b/3.0/vector_tile.proto @@ -11,7 +11,6 @@ message Tile { LINESTRING = 2; POLYGON = 3; CURVE = 4; // like a LineString, but a spline - AREA = 5; // like a Polygon, but a spline } // Variant type encoding From 5ccf2596ecd7e5a32677c8c8b302b8cbcdab07eb Mon Sep 17 00:00:00 2001 From: Eric Fischer Date: Mon, 17 Sep 2018 16:52:45 -0700 Subject: [PATCH 3/7] Renumber the knots message because 5 is taken --- 3.0/vector_tile.proto | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/3.0/vector_tile.proto b/3.0/vector_tile.proto index c6540ac..9a069ef 100644 --- a/3.0/vector_tile.proto +++ b/3.0/vector_tile.proto @@ -85,7 +85,7 @@ message Tile { // Representation of spline knots to be clarified: // https://github.com/mapbox/vector-tile-spec/issues/114 - repeated double knots = 5 [ packed = true ]; + repeated double knots = 11 [ packed = true ]; } // Layers are described in section 4.1 of the specification From ebbbdceea6128a5b4c72faf80f494fae013629e9 Mon Sep 17 00:00:00 2001 From: Blake Thompson Date: Thu, 18 Oct 2018 09:08:02 -0500 Subject: [PATCH 4/7] Updated the way splines are encoded, changed name back to splines from curve --- 3.0/README.md | 15 +++++++++++++++ 3.0/vector_tile.proto | 9 +++++---- 2 files changed, 20 insertions(+), 4 deletions(-) diff --git a/3.0/README.md b/3.0/README.md index 20ef6b6..e323c54 100644 --- a/3.0/README.md +++ b/3.0/README.md @@ -225,6 +225,21 @@ Linear rings MUST be geometric objects that have no anomalous geometric points, Polygon geometries MUST NOT have any interior rings that intersect and interior rings MUST be enclosed by the exterior ring. +##### 4.3.5.3. Spline Geometry Type + +The `SPLINE` geometry type encodes a curve geometry in the form of a b-spline or basis spline. Unlike other geometry types, `SPLINE` requires the use of multiple fields in a feature. A spline geometry MUST have control points in the `geometry` field and knots in the `spline_knots` field. A spline geometry MAY have a degree in the `spline_degree` field. + +If a `SPLINE` geometry does not provide a degree in the `spline_degree` field, the degree is considered to be 2. + +The command sequence in the `geometry` field for the control points in a spline geometry MUST consist of one or more repetitions of the following sequence: + +1. A `MoveTo` command with a command count of 1 +2. A `LineTo` command with a command count greater than 0 + +If the command sequence for a `SPLINE` geometry type includes only a single `MoveTo` command then the geometry MUST be interpreted as a single b-spline; otherwise the geometry MUST be interpreted as a multi b-spline geometry, wherein each `MoveTo` signals the beginning of a new b-spline. + +Each b-spline defined in the `geometry` field MUST have an array of knot values in the `spline_knots` field. Each array of knot values for a b-spline MUST contain exactly the number of knot values as defined by the following formula: `number_of_knots = number_of_control_points + degree + 1`. Knot values are encoded in the `spline_knots` field using delta-encoded-list complex value type as defined in 4.4.2.2 below. There will be delta-encoded-list for each b-spline. + #### 4.3.6. Example Geometry Encodings ##### 4.3.6.1. Example Point diff --git a/3.0/vector_tile.proto b/3.0/vector_tile.proto index 9a069ef..90f08fe 100644 --- a/3.0/vector_tile.proto +++ b/3.0/vector_tile.proto @@ -10,7 +10,7 @@ message Tile { POINT = 1; LINESTRING = 2; POLYGON = 3; - CURVE = 4; // like a LineString, but a spline + SPLINE = 4; // like a LineString, but a spline } // Variant type encoding @@ -79,13 +79,14 @@ message Tile { // elevation_scaling, if present. repeated sint32 elevation = 7 [ packed = true]; + repeated uint64 spline_knots = 8 [ packed = true ]; + + optional uint32 spline_degree = 9 [ default = 2]; + // A string as a unique identifier for the Feature. Use either // id or string_id, but not both. See spec section 4.2. optional string string_id = 10; - // Representation of spline knots to be clarified: - // https://github.com/mapbox/vector-tile-spec/issues/114 - repeated double knots = 11 [ packed = true ]; } // Layers are described in section 4.1 of the specification From 3db76a4dc81b9d2a9c0ce2eed2fa2466b6f2700f Mon Sep 17 00:00:00 2001 From: Jochen Topf Date: Thu, 18 Oct 2018 17:05:50 +0200 Subject: [PATCH 5/7] Defaults should not be in .proto file for compatibility. --- 3.0/vector_tile.proto | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/3.0/vector_tile.proto b/3.0/vector_tile.proto index 90f08fe..c501d93 100644 --- a/3.0/vector_tile.proto +++ b/3.0/vector_tile.proto @@ -81,7 +81,7 @@ message Tile { repeated uint64 spline_knots = 8 [ packed = true ]; - optional uint32 spline_degree = 9 [ default = 2]; + optional uint32 spline_degree = 9; // A string as a unique identifier for the Feature. Use either // id or string_id, but not both. See spec section 4.2. From af2d8d5745590a454a848692ddf013f1b052ce47 Mon Sep 17 00:00:00 2001 From: Eric Fischer Date: Thu, 18 Oct 2018 10:16:23 -0700 Subject: [PATCH 6/7] Try to clarify the encoding of the knots --- 3.0/README.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/3.0/README.md b/3.0/README.md index e323c54..329c87b 100644 --- a/3.0/README.md +++ b/3.0/README.md @@ -238,7 +238,9 @@ The command sequence in the `geometry` field for the control points in a spline If the command sequence for a `SPLINE` geometry type includes only a single `MoveTo` command then the geometry MUST be interpreted as a single b-spline; otherwise the geometry MUST be interpreted as a multi b-spline geometry, wherein each `MoveTo` signals the beginning of a new b-spline. -Each b-spline defined in the `geometry` field MUST have an array of knot values in the `spline_knots` field. Each array of knot values for a b-spline MUST contain exactly the number of knot values as defined by the following formula: `number_of_knots = number_of_control_points + degree + 1`. Knot values are encoded in the `spline_knots` field using delta-encoded-list complex value type as defined in 4.4.2.2 below. There will be delta-encoded-list for each b-spline. +The `spline_knots` field MUST contain a sequence of complex values, each of which MUST be of the delta-encoded-list type, as defined in section 4.4.2.2 below. The number of such sequences MUST be the same as the number of b-splines specified in the `geometry`. + +Each b-spline defined in the `geometry` field corresponds in sequence to one list of knot values in the `spline_knots` field. Each list of knot values for a b-spline MUST contain exactly the number of knot values defined by the following formula: `number_of_knots = number_of_control_points + degree + 1`. #### 4.3.6. Example Geometry Encodings From 8b966f3390c72013660a2048a22786e3a4e414a2 Mon Sep 17 00:00:00 2001 From: Eric Fischer Date: Thu, 18 Oct 2018 10:42:32 -0700 Subject: [PATCH 7/7] The number of complex values, not the number of sequences --- 3.0/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/3.0/README.md b/3.0/README.md index 329c87b..e821cc6 100644 --- a/3.0/README.md +++ b/3.0/README.md @@ -238,7 +238,7 @@ The command sequence in the `geometry` field for the control points in a spline If the command sequence for a `SPLINE` geometry type includes only a single `MoveTo` command then the geometry MUST be interpreted as a single b-spline; otherwise the geometry MUST be interpreted as a multi b-spline geometry, wherein each `MoveTo` signals the beginning of a new b-spline. -The `spline_knots` field MUST contain a sequence of complex values, each of which MUST be of the delta-encoded-list type, as defined in section 4.4.2.2 below. The number of such sequences MUST be the same as the number of b-splines specified in the `geometry`. +The `spline_knots` field MUST contain a sequence of complex values, each of which MUST be of the delta-encoded-list type, as defined in section 4.4.2.2 below. The number of such complex values MUST be the same as the number of b-splines specified in the `geometry`. Each b-spline defined in the `geometry` field corresponds in sequence to one list of knot values in the `spline_knots` field. Each list of knot values for a b-spline MUST contain exactly the number of knot values defined by the following formula: `number_of_knots = number_of_control_points + degree + 1`.