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

Vector Tiles #228

Merged
merged 34 commits into from
Jan 8, 2018
Merged

Vector Tiles #228

merged 34 commits into from
Jan 8, 2018

Conversation

bagnell
Copy link
Contributor

@bagnell bagnell commented Jun 5, 2017

Updated vector tiles draft. This reflects the current implementation in the vector-tiles branch of Cesium.

A few things we may want to add:

  • Meter width lines (like corridors on terrain/3D tiles)
  • Points with meter width on terrain/3D Tiles.
  • TOC to spec, Add TOC to all Tile Format specs #229
  • This is very Earth centric? Is that OK for now? What about general 3D scenes.

@pjcozzi
Copy link
Contributor

pjcozzi commented Jun 7, 2017

@bagnell please target this to a new branch: 3d-tiles-next

@@ -1309,6 +1309,20 @@ For example:

**TODO : add note about GLSL implementations requires strict type comparisons among other things: https://github.com/AnalyticalGraphicsInc/3d-tiles/issues/140**

#### Vector Data
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also update the TOC at the top of this file.

@@ -1309,6 +1309,20 @@ For example:

**TODO : add note about GLSL implementations requires strict type comparisons among other things: https://github.com/AnalyticalGraphicsInc/3d-tiles/issues/140**

#### Vector Data

A [Vector Tile](../TileFormats/VectorData/README.md) is a collection of points, polygons, and polylines. All vector data can be styled similar to other features with `color` and `show`. Points have several other styling options:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is a collection of points, polygons, and polylines

Reword to something like "a collection of vector feature such as points, polygons, and polylines."

Throughout, we want our messaging to be consistent that 3D Tiles vector tiles go beyond traditional points/poylines/polygons to true 3D use cases.

| Style | Description | Default |
| --- | --- | --- |
| pointSize | The size of the point in pixels. | 8.0 |
| image | A URL to an image to be displayed instead of a point. | " " |
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Here and below

" "

to

''

?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  • Is a data URI valid?
  • This could go into the tasklist or a future PR, but I wonder if folks will want to this point to a subset of some payload like buffer/bufferView in glTF so they can put all their images in one atlas.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also, explicitly say that pointSize is ignored when image is defined.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I could be a data URI.

Would another option for the future be to have an atlas as part of the payload and the image be a subregion of the atlas? That way implementations wouldn't have to rebuild an atlas.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Atlas - exactly. Can you submit an issue for this for future work?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Submitted #239


A [Vector Tile](../TileFormats/VectorData/README.md) is a collection of points, polygons, and polylines. All vector data can be styled similar to other features with `color` and `show`. Points have several other styling options:

| Style | Description | Default |
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We could improve this table with the datatype, bounds, etc. Instead, just put a TODO here to generate this table from the JSON schema.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Include an example or two of these properties being used, including some use cases like directly mapping per-feature properties to these and using per-feature properties to compute these.

| image | A URL to an image to be displayed instead of a point. | " " |
| text | The text to display for the point | " " |
| font | The font of the displayed text. | "30px sans-serif" |
| labelStyle | The label style: fill(0), outline(1), or both(2). | 0 |
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you add a table with screenshots for fill, outline, and both? Devs writing their own renderer would fine this useful.


### Positions

The positions buffer contains up to three sub-buffers for the polygons, polylines and points. The positions are encoded according to the quantized-mesh-1.0 format[1].
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Use serial comma. "polylines,"

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just link to quantized-mesh-1.0 format in a Resources section. I don't think it's a good intro here.


The positions buffer contains up to three sub-buffers for the polygons, polylines and points. The positions are encoded according to the quantized-mesh-1.0 format[1].

The bounding volume for the tile must be a tile bounding region containing the north, south, east, and west bounds of the tile. The positions are represented by u, v, and height values that are quantized and delta encoded.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Throughout, order lower-left (x,y) to upper-right (x,y). west, south, east, north.


| Field | Meaning |
| --- | --- |
| u | The horizontal coordinate of the vertex in the tile. When the u value is 0, the vertex is on the Western edge of the tile. Then the value is 32767, the vertex is on the Eastern edge of the tile. For other values, the vertex's longitude is a linear interpolation between the longitudes of the Western and Eastern edges of the tile. |
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Throughout this table, are you sure words like Western should be capitalized? Use bold if they need focus.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Use consistent wording: vertex vs. position.


#### Polygon positions

The first section of the positions buffer, from offset 0 to `polygonPositionsByteLength`, contains the polygon positions. Polygon positions only have u and v values. The u values are from offset `0` to `polygonPositionsByteLength / 2`. The v values are from offset `polygonPositionsByteLength /2` to `polygonPositionsByteLength`. The number of positions for each polygon is determined by the value of its `POLYGON_COUNT`.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"polygonPositionsByteLength /2" -> "polygonPositionsByteLength / 2"


#### Polygon positions

The first section of the positions buffer, from offset 0 to `polygonPositionsByteLength`, contains the polygon positions. Polygon positions only have u and v values. The u values are from offset `0` to `polygonPositionsByteLength / 2`. The v values are from offset `polygonPositionsByteLength /2` to `polygonPositionsByteLength`. The number of positions for each polygon is determined by the value of its `POLYGON_COUNT`.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For each of these three sections, perhaps replace/augment the first sentence with a small table showing the start byte length and end byte length.

@pjcozzi
Copy link
Contributor

pjcozzi commented Jun 27, 2017

Bump @bagnell

@bagnell
Copy link
Contributor Author

bagnell commented Jun 28, 2017

@pjcozzi This is ready for another look.

@pjcozzi
Copy link
Contributor

pjcozzi commented Jun 29, 2017

Tweaked the styling spec in 13e14ca.

@@ -51,6 +51,7 @@ Contents:
* [Notes](#notes)
* [Batch Table Hierarchy](#batch-table-hierarchy)
* [Point Cloud](#point-cloud)
* [Vector Data](#vector-data)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add yourself to the contributors list in this file.

| Style | Type | Description | Default |
| --- | --- | --- | --- |
| `show` | `Boolean` | Whether or not to show the feature. | `true` |
| `color` | `vec4` | The color of the feature. | `color('#FFFFFF')` |
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What does this mean? The color multiple with the image and label? How does this relate to pointColor?

| `labelStyle` | `Number` | The label style: **fill** (`0`), **outline** (`1`), or **both** (`2`). This is ignored when `labelText` is undefined. | `0` |
| `labelOutlineColor` | `vec` | The color of the text outline. This is ignored when `labelText` is undefined. | `color('#FFFFFF')` |
| `labelOutlineWidth` | `Number` | The width of the text outline. This is ignored when `labelText` is undefined. | `1.0` |
| `font` | `String` | The font of the displayed text. This is ignored when `labelText` is undefined. | `"30px sans-serif"` |
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I thought I mentioned this before but the format of the font string needs to be referenced, e.g., like this spec does for CSS colors.


For example:

```json
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I thought I mentioned this before, but please add more examples showing more of the vector tile-specific properties.


If `featureTableJSONByteLength` equals zero, the tile does not need to be rendered.

The body section immediately follows the header section, and is composed of four fields: `Feature Table`, `Batch Table`, `Indices`, and `Positions`.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Here - and/or maybe in the ** Positions** section below - we should explicitly state the order and how to compute the offsets for the indices and positions for each type of feature. We did to be explicit as opposed to relying on the order of the fields in the header and making an assumption.


| Semantic | Data Type | Description | Required |
| --- | --- | --- | --- |
| `POLYGONS_LENGTH` | `uint32` | The number of pre-triangulated polygons in the tile. | :white_check_mark: Yes, unless one of `POLYLINES_LENGTH` or `POINTS_LENGTH` is defined. |
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sounds like we require that at least one polygon, polyline, or point is defined. Should this be required? Does this mirror b3dm, i3dm, and pnts?


| Semantic | Data Type | Description | Required |
| --- | --- | --- | --- |
| `POLYGON_COUNTS` | `uint32[]` | The number of vertices that belong to each polygon. This refers to the polygon section of the positions buffer in the body. Each polygon count refers to a contiguous number of vertices in the position buffer that represents the polygon. | :white_check_mark: Yes, unless `POLYGONS_LENGTH` is zero or not defined. |
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Here and similar below, this is probably better stated as

Yes, when POLYGONS_LENGTH is greater than zero.

| `POLYGON_COUNTS` | `uint32[]` | The number of vertices that belong to each polygon. This refers to the polygon section of the positions buffer in the body. Each polygon count refers to a contiguous number of vertices in the position buffer that represents the polygon. | :white_check_mark: Yes, unless `POLYGONS_LENGTH` is zero or not defined. |
| `POLYGON_INDEX_COUNTS` | `uint32[]` | The number of indices that belong to each polygon. This refers to the indices buffer of the body. Each index count refers to a contiguous number of indices that represent the triangulated polygon. | :white_check_mark: Yes, unless `POLYGONS_LENGTH` is zero or not defined. |
| `POLYGON_MINIMUM_HEIGHTS` | `float32[]` | The minimum height of each polygon in meters above the WGS84 ellipsoid. | :red_circle: No. If the minimum height for each polygon is not specified, the global `MINIMUM_HEIGHT` will be used. |
| `POLYGON_MAXIMUM_HEIGHTS` | `float32[]` | The maximum height of each polygon in meters above the WGS84 ellipsoid. | :red_cricle: No. If the maximum height for each polygon is not specified, the global `MAXIMUM_HEIGHT` will be used. |
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should be : red_circle:


See the [Batch Table](../BatchTable/README.md) reference for more information.

### Indices
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Rename to Polygon Indices


#### Polygon positions

**Figure 3**: Polygon layout.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice diagrams!

@pjcozzi pjcozzi mentioned this pull request Jul 7, 2017
@pjcozzi
Copy link
Contributor

pjcozzi commented Nov 24, 2017

@bagnell is the tasklist at the top of this up-to-date?

@pjcozzi
Copy link
Contributor

pjcozzi commented Nov 24, 2017

Update the vector tile link and description in the main README.md -

image

@pjcozzi
Copy link
Contributor

pjcozzi commented Nov 24, 2017

@bagnell can you update the tasklist in #25?

Copy link
Contributor

@pjcozzi pjcozzi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks good.

The two biggest areas are:

  • Vector vs. classification tile
  • Making this non-Earth centric, e.g., for BIM models in a local coordinate system

There's also some cleanup to make sure all the updates needed for classification volumes are in the text.

I added roadmap ideas to #25 - I don't think any of these need to be done as part of this PR.


A [Vector Tile](../TileFormats/VectorData/README.md) is a collection of vector features such as points, polygons, and polylines. Vector features can be styled similar to other features with `color` and `show`. Points have several other styling options:

**TODO : generate these tables from the JSON schema**
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Perhaps remove this TODO and add a note to #37?


| Style | Type | Description | Default |
| --- | --- | --- | --- |
| `show` | `Boolean` | Whether or not to show the feature. | `true` |
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can point's just use color instead of pointColor so basically point features inherit all the geometry features' style properties and add new ones - as opposed to removing some as well.

| `pointColor` | `vec4` | The color of the point. `pointColor` is ignored when `image` is defined. | `color('#FFFFFF')` |
| `pointOutlineColor` | `vec4` | The color of the point outline. `pointOutlineColor` is ignored when `image` is defined. | `color('#000000')` |
| `pointOutlineWidth` | `Number` | The width, in pixels, of the point outline. `pointOutlineWidth` is ignored when `image` is defined. | `0.0` |
| `labelText` | `String` | The text to display for the point. | `undefined` |
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are \n line breaks allowed? If so, explicitly mention it.

| `pointOutlineColor` | `vec4` | The color of the point outline. `pointOutlineColor` is ignored when `image` is defined. | `color('#000000')` |
| `pointOutlineWidth` | `Number` | The width, in pixels, of the point outline. `pointOutlineWidth` is ignored when `image` is defined. | `0.0` |
| `labelText` | `String` | The text to display for the point. | `undefined` |
| `labelColor` | `vec4` | The color of the label. This is ignored when `labelText` is undefined. | `color('#FFFFFF')` |
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Here and throughout below probably remove:

This is ignored when labelText is undefined.

It is obvious and keeping the text makes the table more verbose.

| `labelText` | `String` | The text to display for the point. | `undefined` |
| `labelColor` | `vec4` | The color of the label. This is ignored when `labelText` is undefined. | `color('#FFFFFF')` |
| `labelStyle` | `Number` | The label style: **fill** (`0`), **outline** (`1`), or **both** (`2`). This is ignored when `labelText` is undefined. | `0` |
| `labelOutlineColor` | `vec` | The color of the text outline. This is ignored when `labelText` is undefined. | `color('#FFFFFF')` |
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should this be vec4?


### Polygon Indices

TODO: `uint16` indices?
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does it have a big impact on file size? Is this consistent with b3dm?

uint32 implies using the WebGL extension (which is probably fine) or a lot of runtime slicing.


### Polygon Indices

TODO: `uint16` indices?
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does it have a big impact on file size?

After gzip...


See the [Batch Table](../BatchTable/README.md) reference for more information.

### Polygon Indices
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also for meshes?


| Field | Meaning |
| --- | --- |
| u | The horizontal coordinate of the vertex in the tile. When the u value is 0, the vertex is on the western edge of the tile. Then the value is 32767, the vertex is on the eastern edge of the tile. For other values, the vertex's longitude is a linear interpolation between the longitudes of the western and eastern edges of the tile. |
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

With just a few wording tweaks and maybe a property tweak or two - couldn't we word this so that it is not geo specific? For example, I suspect the code doesn't care that something is "west" or "east", it is just "min" and "max."

| v | The vertical coordinate of the vertex in the tile. When the v value is 0, the vertex is on the southern edge of the tile. When the value is 32767, the vertex is on the northern edge of the tile. For other values, the vertex's latitude is a linear interpolation between the latitudes of the southern and northern edges of the tile. |
| height | The height of the vertex of the tile. When the height value is 0, the vertex's height is equal to `MINIMUM_HEIGHT` from the feature table. When the value is 32767, the vertex's height is equal to `MAXIMUM_HEIGHT` from the feature table. For other values, the vertex's height is a linear interpolation of the minimum and maximum heights. |

The values are then delta and ZigZag encoded. The delta encoding ensures the values are small integers. The ZigZag encoding ensure the values are positive integers. Example encoding code is listed below:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"The ZigZag encoding ensure" -> "ensures"

@bagnell
Copy link
Contributor Author

bagnell commented Dec 11, 2017

@pjcozzi @lilleyse This is ready for another look. I'll update the implementation for the few minor changes after you have another pass. The geometry and mesh were removed. Geometry tiles will be a separate PR.

@bagnell
Copy link
Contributor Author

bagnell commented Dec 14, 2017

Instead of a separate PR, I added the geometry spec to this.

@pjcozzi
Copy link
Contributor

pjcozzi commented Dec 14, 2017

Instead of a separate PR, I added the geometry spec to this.

Add a link to it from the main README.md.

@@ -0,0 +1,108 @@
# Geometry Data
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just call it "Geometry" - no need to have a parallel to "Vector Data."


The body section immediately follows the header section, and is composed, in order, of two fields: `Feature Table` and `Batch Table`.

Code for reading the header can be found in
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Throughout just like to Cesium's master branch - later this can be a tag so it never breaks. The PR will be merged soon.


### Semantics

Per-feature semantics specific to a feature type are prefixed with the name of the feature type. e.g. `BOXES` for boxes, `CYLINDERS` for cylinders and `ELLIPSOIDS` for ellipsoids.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We use the "serial comma" - put a comma after "cylinders."

Per-feature semantics specific to a feature type are prefixed with the name of the feature type. e.g. `BOXES` for boxes, `CYLINDERS` for cylinders and `ELLIPSOIDS` for ellipsoids.

At least one global `LENGTH` semantic must be defined.
If `BOXES_LENGTH` in not defined, or zero, no boxes will be rendered.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Perhaps make each of this "If" statements, a bullet.


| Semantic | Data Type | Description | Required |
| --- | --- | --- | --- |
| `BOXES` | `float32[]` | The boxes in the tile. The length of the array will be `19 * BOXES_LENGTH`. The first three elements of each box are the x, y, and z dimensions. The following 16 elements are the 4x4 model matrix in column-major order. | :white_check_mark: Yes, when the global `BOXES_LENGTH` is greater than zero. |
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's be super explicit - are the dimensions the full length or half length?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we even need this since it could just be the translation part of the 4x4 matrix? Just all boxes are unit boxes transformed by the matrix?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm OK with just a model matrix, that's how the implementation works.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should it mention anything about scaling the unit geometry? The only one I thought worth mentioning was the cylinder for which axes scaled the radius and which one was the length.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

+1 for the cylinder axes. I don't think anything else is needed for the box.

| --- | --- | --- | --- |
| `BOXES` | `float32[]` | The boxes in the tile. The length of the array will be `19 * BOXES_LENGTH`. The first three elements of each box are the x, y, and z dimensions. The following 16 elements are the 4x4 model matrix in column-major order. | :white_check_mark: Yes, when the global `BOXES_LENGTH` is greater than zero. |
| `BOX_BATCH_IDS` | `uint16[]` | The `batchId` of the box that can be used to retrieve metadata from the `Batch Table`. | :red_circle: No. |
| `CYLINDERS` | `float32[]` | The cylinders in the tile. The length of the array will be `18 * CYLINDERS_LENGTH`. The first element is the radius of the cylinder. The second element is the length along the z axis. The following 16 elements are the 4x4 model matrix in column-major order. | :white_check_mark: Yes, when the global `CYLINDERS_LENGTH` is greater than zero. |
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Similar comment for cylinders.

| `BOX_BATCH_IDS` | `uint16[]` | The `batchId` of the box that can be used to retrieve metadata from the `Batch Table`. | :red_circle: No. |
| `CYLINDERS` | `float32[]` | The cylinders in the tile. The length of the array will be `18 * CYLINDERS_LENGTH`. The first element is the radius of the cylinder. The second element is the length along the z axis. The following 16 elements are the 4x4 model matrix in column-major order. | :white_check_mark: Yes, when the global `CYLINDERS_LENGTH` is greater than zero. |
| `CYLINDER_BATCH_IDS` | `uint16[]` | The `batchId` of the cylinder that can be used to retrieve metadata from the `Batch Table`. | :red_circle: No. |
| `ELLIPSOIDS` | `float32[]` | The ellipsoids in the tile. The length of the array will be `19 * ELLIPSOIDS_LENGTH`. The first three elements are the radii in the x, y, and z axes. The following 16 elements are the 4x4 model matrix in column-major order. | :white_check_mark: Yes, when the global `ELLIPSOIDS_LENGTH` is greater than zero. |
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same comment.

@bagnell
Copy link
Contributor Author

bagnell commented Dec 14, 2017

@pjcozzi @lilleyse This is ready for another look.

@pjcozzi
Copy link
Contributor

pjcozzi commented Dec 15, 2017

@lilleyse this is all you when you have time.

@bagnell @lilleyse

  1. Please make sure that everything discussed here - but not currently done - is in an issue/roadmap
  2. That we strive to make this as non-Earth centric as possible either now or in the roadmap.


A [Vector Tile](../TileFormats/VectorData/README.md) is a collection of vector features such as points, polygons, and polylines. Vector features can be styled similar to other features with `color` and `show`. Points have several other styling options:

The following style properties apply to geometry features in vector tiles:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Probably clearer to say polygons and polylines here.

"description" : "The size of points in pixels.",
"default" : 8.0
},
"pointColor" : {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This was removed.

| `labelColor` | `vec4` | The color of the label's text. | `color('#FFFFFF')` |
| `labelStyle` | `Number` | The label style: **fill** (`0`), **outline** (`1`), or **both** (`2`). See **Table1**.| `0` |
| `labelOutlineColor` | `vec4` | The color of the text outline. | `color('#FFFFFF')` |
| `labelOutlineWidth` | `Number` | The width of the text outline. | `1.0` |
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Include in pixels here and in the schema.

| `labelStyle` | `Number` | The label style: **fill** (`0`), **outline** (`1`), or **both** (`2`). See **Table1**.| `0` |
| `labelOutlineColor` | `vec4` | The color of the text outline. | `color('#FFFFFF')` |
| `labelOutlineWidth` | `Number` | The width of the text outline. | `1.0` |
| `font` | `String` | The font of the displayed text. | `"30px sans-serif"` |
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Mention that this is a CSS font string, here and in the schema.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

| `labelOutlineColor` | `vec4` | The color of the text outline. | `color('#FFFFFF')` |
| `labelOutlineWidth` | `Number` | The width of the text outline. | `1.0` |
| `font` | `String` | The font of the displayed text. | `"30px sans-serif"` |
| `backgroundColor` | `vec4` | The label background color. | `rgba(42, 42, 42, 0.8)` |
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All the other color defaults are specified as css color strings, this should probably as well. (Also in schema).


**Figure 4**: Polyline layout.

![](figures/polyline.jpg)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In the diagram polylinePositionsByteLength / 2 should be polylinePositionsByteLength / 3


**Figure 5**: Point layout.

![](figures/point.jpg)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In the diagram pointPositionsByteLength / 2 should be pointPositionsByteLength / 3


**Figure 3**: Polygon layout.

![](figures/polygon.jpg)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should this diagram also include height values?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Polygons don't have height values.The heights are either given by th epolygon minimum and maximum heightsd in the feature table or the global minimum and maximum for the tile. Only points and polylines need ber-vertex heights.

},
"RECTANGLE" : {
"type" : "array",
"description" : "A floating-point 4 element array that defines a rectangle bounding all of the vector data. The elements in the array are, in order, west, south, east, and north.",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This description is out of date compared to the spec text.

"POINTS_LENGTH" : {
"$ref" : "featureTable.schema.json#/definitions/globalPropertyScalar"
},
"MESHES_LENGTH" : {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove meshes, boxes, etc.

@bagnell
Copy link
Contributor Author

bagnell commented Jan 3, 2018

@lilleyse Updated. This is ready for another look.

}, {
"$ref" : "style.condition.schema.json"
}],
"description" : "Sets near and far scaling properties of a feature based on the features's distance from the camera. A feature's scale will interpolate between the `y` and `w` values while the camera distance falls within the upper and lower bounds of the specified `x` and `z` value. Outside of these ranges, the features's scale remains clamped to the nearest bound. If undefined, `scaleByDistance` will be disabled.",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There are minor differences between the descriptions in the schema and in the spec text, it's probably worth going through all of these to make sure they are the same.

For example this one does not include "in meters".

@lilleyse
Copy link
Contributor

lilleyse commented Jan 5, 2018

That's all my comments. This is really close now.

@bagnell
Copy link
Contributor Author

bagnell commented Jan 5, 2018

@lilleyse Updated.

@lilleyse
Copy link
Contributor

lilleyse commented Jan 5, 2018

The updates look good. I'll check over the Cesium PR quickly and then this will be good to go.

@lilleyse
Copy link
Contributor

lilleyse commented Jan 8, 2018

👍

@lilleyse lilleyse merged commit 353e75f into 3d-tiles-next Jan 8, 2018
@lilleyse lilleyse deleted the vector-tiles branch January 8, 2018 21:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants