Skip to content

Commit

Permalink
Updated the way splines are encoded, changed name back to splines fro…
Browse files Browse the repository at this point in the history
…m curve
  • Loading branch information
flippmoke committed Oct 18, 2018
1 parent 5ccf259 commit ebbbdce
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 4 deletions.
15 changes: 15 additions & 0 deletions 3.0/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
9 changes: 5 additions & 4 deletions 3.0/vector_tile.proto
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit ebbbdce

Please sign in to comment.