Class CMDataset extends CMBase
CMDataset Class
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.
Datasets are stored in a global CMDataset.TheDataSets[] array object
Selections within a dataset are managed by a chain which is an
array of N indexes. The array can be null for no selection and
update to 4 indexes deep. The indexes are for:
- SelectedFeatureIndex
- SelectedAreaIndex
- SelectedPolyIndex
- SelectedCoordinateIndex
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
Enumerated Types
CMDataset.GEOJSON=1CMDataset.PYRAMID=2
CMDataset.PYRAMID_OPEN_FORMAT=3
CMDataset.RASTER=4
CMDataset.SQL=5
CMDataset.LOAD_STATUS_NONE=1 - request has just been created and is not in the que yet
CMDataset.LOAD_STATUS_PENDING=4 - element is waiting in the que
CMDataset.LOAD_STATUS_LOADING=2 - request to load was sent and waiting for element to load
CMDataset.LOAD_STATUS_LOADED=3 - element is loaded
CMDataset.LOAD_STATUS_CANCELED=5 - request was canceled, probably from the user changing the zoom level (moves request out of request que)
Object Functions
Inherited From: CMBase
Returns | Function | Throws |
---|---|---|
Number | GetNumAttributeRows() | |
Number | GetNumAttributeColumns() | |
Specified | GetAttributeHeading() | |
Array | GetAttributeHeadings() | |
Array | GetAttributeIndexFromHeading() | |
Specified | GetAttributeCell(ColumnIndex, RowIndex) | |
Specified | GetAttributeCellByHeading(Heading, RowIndex) | |
AddAttributeHeading(NewHeading, DefaultValue) | ||
SetAttributeCell(ColumnIndex, RowIndex, Value) | ||
GetAttributeArray(Heading) | ||
SetProjector(NewProjector) | ||
Current | GetProjector() |
Object Functions
Number=GetNumAttributeRows()
Returns the number of rows of attributes in the current dataset. Needs to be overriden by subclasses.
@override
Returns: Number - of rows or 0 if no data loaded
Number=GetNumAttributeColumns()
Returns the number of columns of attributes in the current dataset. Needs to be overriden by subclasses.
@override
Returns: Number - of columns or 0 if no data loaded
Specified=GetAttributeHeading()
Returns the a heading for a specified column. Does not need to be overriden as it calls GetAttributeHeadings().
@override
Returns: Specified - column heading or "" if no data loaded.
Array=GetAttributeHeadings()
Gets the array of attribute headings. Needs to be overriden by subclasses.
@override
Returns: Array - with the attribute headings or null for none.
Array=GetAttributeIndexFromHeading()
Gets the array of attribute headings. Does not need to be overriden as it calls GetAttributeHeadings().
@override
Returns: Array - with the attribute headings or null for none.
Specified=GetAttributeCell(ColumnIndex, RowIndex)
Gets the contents of an attribute cell (row and column). Needs to be overriden by subclasses.
@override
Parameters:
ColumnIndex
RowIndex
Returns: Specified - value or "" if no data loaded.
Specified=GetAttributeCellByHeading(Heading, RowIndex)
Gets the contents of an attribute cell using the attribute name and a row index.
Does not need to be overriden as it calls GetAttributeIndexFromHeading().
@override
Parameters:
Heading
RowIndex
Returns: Specified - value or "" if no data loaded.
AddAttributeHeading(NewHeading, DefaultValue)
Inserts a new column into the dataset with the specified heading and
sets all values in the column to the specified DefaultValue.
Needs to be overriden by subclasses if supported.
@override
Parameters:
NewHeading
DefaultValue
SetAttributeCell(ColumnIndex, RowIndex, Value)
Sets the value of a cell in an attribute table using a row and column index.
Needs to be overriden by subclasses.
@override
Parameters:
ColumnIndex
RowIndex
Value
GetAttributeArray(Heading)
Helper function to return an entire array for an attribute
Does not need to be overriden as it calls GetNumAttributeRows() and GetAttributeCell().
Parameters:
Heading - the atribute/column heading to get the array from
SetProjector(NewProjector)
Sets up a projector for layer data to be projected on loading the data.
Parameters:
NewProjector - an STProjector object to project layer data after it is loaded.
Current=GetProjector()
Gets the current projector used to project data on load.
Returns: Current - projector or null.