-
Notifications
You must be signed in to change notification settings - Fork 10
Closed
Description
Refs openlayers/openlayers#1615 and openlayers/openlayers#1718.
The TWKB format is very promising, particularly in the use of delta encoding for small transfer sizes. However, I think there are a number of opportunities for improvement:
- It is not possible to know if an arbitrary blob of binary data contains TWKB data. This could be fixed by adding a header.
- When streaming data, it is impossible to know if enough data has read to decode a complete geometry/feature. The only way way to know if a geometry/feature is complete is to attempt to read the geometry/feature and see if you run out of bytes.
- The variable precision is interesting, but needs to allow for negative values as well. For projections that use metres the coordinate values are large (e.g. EPSG:3857 has coordinate values from -2e7 to 2e7) and so precision 0 ("no decimal places") is still 1m accuracy, which is over-kill.
- The format as-is does not allow any kind of extension. For example, with large geometries it might be worthwhile to transmit a pre-computed extent, and with features it might be worthwhile to transmit arbitrary attributes as well as the feature's numerical id.
Concrete suggests:
- Use of a binary container format, e.g. RIFF or PNG-style chunks. Such a container format will give identification, structure, and extensibility.
- Support delta-encoding as one of many ways of encoding coordinates. Other ways could include normal WKB, and an uncompressed encoding based on OpenLayers 3's flat coordinates structure. The advantage of flat coordinates structures are that they have virtually zero parsing overhead, are very friendly to garbage collectors, and are already in the correct format to transfer to the GPU for WebGL rendering.
Metadata
Metadata
Assignees
Labels
No labels