General Data Format
There is a need for a format that deals with various types of geospatial data in a uniform way and provides a high level of funcionality. The data is used:
- In tiling schemes
- To display, edit, and store spatial data
Specifically, in CanvasMap
- In vector layers from GeoJSON, and other files
The data types include:
- Raster data (should this be a different format?
- Vector data
- Points - including clusters
- Polylines - including networks
- Polygons - really BlueSpray regions with areas, exterior polygons and interior polygons
Format Definition
There are currently four types of data supported but we may add more in the future:
- REGIONS("Regions") - vector data (see below)
- POINTS("Points") - simple coordinates but they may be clustered
- RasterExtension - raster represented in a standard raster format such as JPEG or PNG
- RASTER_DATA("Raster Data") - raster data represented as a grid of numeric values
Vector Data
The vector data is organized by regions where each region is the spatial data for one feature. Attributes for features are handled outside this structure.
- Regions[]
-
array of objects for each feature's spatial data
- LayerFeatureIndex
- TileIsInsideFeature - true if the entire tile is inside the feature, there will be no child tiles when true and the tile can be painted with a solid fill
- Areas[] - array of objects for each unique spatial area
- Polys[]
- first entry is the exterior while other polygons are interior (holes)
- EdgeIndexes[]
- EdgeDirections[]
- Closed: - true if the poly closes back on itself, false otherwise
- Polys[]
- first entry is the exterior while other polygons are interior (holes)
- Edges[] -
- Xs[]
- Ys[]
- Zs[], - option z values for 3d data
- StartVertexIndex - optional index to the vertex at the start of this edge(if specified, EndVertexIndex must be specified as well)
- EndVertexIndex - optional index to the vertex at the end of this edge
Clustered Points
- NumClusters - number of point clusters in this data set
- ClusterCoordinates[][] - array of Xs, Ys, and optional Zs values
- LayerPointFeatureIndexes[][] - array of feature indexes for each cluster of points
- NumPointFeatures[] - array of the number of features represented by each point (jjg - needed?)
Pyramiding
Pyramids require high level information to describe the pyramid structure and, optionally, key elements of the data.
- Title
- Bounds: XMin, XMax, YMin, YMax
- Type: Raster
- OriginalBounds
- TopZoomLevel
- TitleRefWidth
- MinColumn
- MaxColumn
- NumColumns
- MinRow
- MaxRow
- NumRows
- MinPixelValues - raster only
- MaxPixelValues
- AttributeInfo - vector only
- NumColumns
- NumRows
- Attributes: [
]
- array of objects that describe the attributes as below
- { Heading: "", Type: DOUBLE, STRING }
If the data is part of a pyramiding structure, it can contain:
- NumChildTiles: - numeric value from 0 to 4 for the number of tiles spatially "below" this one. Undefined implies 0 child tiles
- ChildTiles - an array with two entries each with two entries that represent the four sub-tiles.
Attributes for pyramids are in sparate files so they do not need to be loaded with the spatial data. The attributes are provided by column and by row for speed.
Attributes - folder with the attribute data
- AttributeColumn_X -
- Heading - Name of the column
- Type - DOUBLE,
- Values - an array of all the attribute values for the column
- AttributeRow_X - 0 referenced data for each row
- Row - row index
- Values[] - array with all attribute values for a feature