Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added spline types #118

Merged
merged 7 commits into from
Oct 18, 2018
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
17 changes: 17 additions & 0 deletions 3.0/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -225,6 +225,23 @@ 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.

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`.

#### 4.3.6. Example Geometry Encodings

##### 4.3.6.1. Example Point
Expand Down
6 changes: 6 additions & 0 deletions 3.0/vector_tile.proto
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ message Tile {
POINT = 1;
LINESTRING = 2;
POLYGON = 3;
SPLINE = 4; // like a LineString, but a spline
}

// Variant type encoding
Expand Down Expand Up @@ -78,9 +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;

// 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;

}

// Layers are described in section 4.1 of the specification
Expand Down