CanvasMap
Getting Started Tutorials 3D Reference

Class CMDatasetVector extends CMDataset

CMDatasetVector
This is effecitvely an abstract class that provides an API between
the layer class and the data that may be shared between muliptle layers.
The data typically contains individual spatial features with attributes
But can also contain raster data organized as tiles.


Copyright (C) 2020, Humboldt State University, Jim Graham

This program is free software: you can redistribute it and/or modify it under the terms of the GNU General
Public License as published by the Free Software Foundation, either version 3 of the License, or (at your
option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the
implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
for more details.

You should have received a copy of the GNU General Public License along with this program. If not, see
.

Object Functions

Inherited From: CMDataset
ReturnsFunctionThrows
SetBounds(NewBounds)
Bounds GetBounds()
Bounds GetFeatureBounds()
[FeatureIndex,AreaIndex,PolyIndex,PointIndex] GetInChain()
InFeature(Chain, -)
InLineSegment()
Paint()
AddPoint()
AddPolyline()
AddPolygon()
DuplicateFeature()
SetPosition()

Object Functions

SetBounds(NewBounds)

Check if the feature is visible in the view.
This should be called by subclasses but can also be called to limit a layer's bounds after loading.

Parameters:
    NewBounds - Bounds with format {XMin,XMax,YMin,YMax}

Bounds=GetBounds()

Returns the bounds of the data within the layer. Computed after loading the data.

Returns: Bounds - with format {XMin,XMax,YMin,YMax}

Bounds=GetFeatureBounds()

Returns the bounds of the specified feature.

Returns: Bounds - with format {XMin,XMax,YMin,YMax}

[FeatureIndex,AreaIndex,PolyIndex,PointIndex]=GetInChain()

Gets a chain (array of indexes) to the region, area, poly, or point that was selected

Returns: [FeatureIndex,AreaIndex,PolyIndex,PointIndex] - null

InFeature(Chain, -)

Checks if the specified coordinate is in the specified feature

Parameters:
    Chain - An array of 4 entries [RegionIndex,AreaIndex,PolyIndex,CoordIndex]
    - PointsOnly: undefined for either points, line segments or polygons, true for just points, false for line segments and polygons only

InLineSegment()

Determines if a line segment in a poly was clicked on

Paint()

Paints the specified data into the view.

AddPoint()

Add a new point to the data.

AddPolyline()

Add a new poly to the data.

AddPolygon()

Add a new poly to the data.

DuplicateFeature()

Make a duplicate of the specific feature. The new feature is added at the bottom row

SetPosition()

Add a new point to the data