Link Node Dataset Files¶
File extensions: Variable (e.g.: cdp, cdq, cds)
This file object supports spatial objects.
File Object¶
-
class
gsshapy.orm.
LinkNodeDatasetFile
[source]¶ Bases:
sqlalchemy.ext.declarative.api.Base
,gsshapy.base.file_base.GsshaPyFileObjectBase
Object interface for Link Node Dataset files.
As the name implies, link node datasets store output data for link node networks. In the case of GSSHA, this type of file is used to write output for the stream network nodes. The contents of this file is abstracted to several supporting objects including:
LinkNodeTimeStep
,LinkDataset
, andNodeDataset
.Note: The link node dataset must be linked with the channel input file to generate spatial visualizations.
-
tableName
= u'lnd_link_node_dataset_files'¶ Database tablename
-
id
¶ PK
-
projectFileID
¶ FK
-
channelInputFileID
¶ FK
-
fileExtension
¶ STRING
-
name
¶ STRING
-
numLinks
¶ INTEGER
-
timeStepInterval
¶ INTEGER
-
numTimeSteps
¶ INTEGER
-
startTime
¶ STRING
-
projectFile
¶ RELATIONSHIP
-
timeSteps
¶ RELATIONSHIP
-
channelInputFile
¶ RELATIONSHIP
-
linkDatasets
¶ RELATIONSHIP
-
nodeDatasets
¶ RELATIONSHIP
-
linkToChannelInputFile
(session, channelInputFile, force=False)[source]¶ Create database relationships between the link node dataset and the channel input file.
The link node dataset only stores references to the links and nodes–not the geometry. The link and node geometries are stored in the channel input file. The two files must be linked with database relationships to allow the creation of link node dataset visualizations.
This process is not performed automatically during reading, because it can be very costly in terms of read time. This operation can only be performed after both files have been read into the database.
Parameters: - session (
sqlalchemy.orm.session.Session
) – SQLAlchemy session object bound to PostGIS enabled database - channelInputFile (
gsshapy.orm.ChannelInputFile
) – Channel input file object to be associated with this link node dataset file. - force (bool, optional) – Force channel input file reassignment. When false (default), channel input file assignment is skipped if it has already been performed.
- session (
-
getAsKmlAnimation
(session, channelInputFile, path=None, documentName=None, styles={})[source]¶ Generate a KML visualization of the the link node dataset file.
Link node dataset files are time stamped link node value datasets. This will yield a value for each stream node at each time step that output is written. The resulting KML visualization will be an animation.
The stream nodes are represented by cylinders where the z dimension/elevation represents the values. A color ramp is applied to make different values stand out even more. The method attempts to identify an appropriate scale factor for the z dimension, but it can be set manually using the styles dictionary.
Parameters: - session (
sqlalchemy.orm.session.Session
) – SQLAlchemy session object bound to PostGIS enabled database - channelInputFile (
gsshapy.orm.ChannelInputFile
) – Channel input file object to be associated with this link node dataset file. - path (str, optional) – Path to file where KML will be written. Defaults to None.
- documentName (str, optional) – Name of the KML document. This will be the name that appears in the legend. Defaults to the name of the link node dataset file.
- styles (dict, optional) –
Custom styles to apply to KML geometry. Defaults to empty dictionary.
- Valid keys (styles) include:
- zScale (float): multiplier to apply to the values (z dimension)
- radius (float): radius in meters of the node cylinder
- colorRampEnum (
mapkit.ColorRampGenerator.ColorRampEnum
or dict): Use ColorRampEnum to select a default color ramp or a dictionary with keys ‘colors’ and ‘interpolatedPoints’ to specify a custom color ramp. The ‘colors’ key must be a list of RGB integer tuples (e.g.: (255, 0, 0)) and the ‘interpolatedPoints’ must be an integer representing the number of points to interpolate between each color given in the colors list.
Returns: KML string
Return type: str
- session (
-
Supporting Objects¶
-
class
gsshapy.orm.
LinkNodeTimeStep
(timeStep)[source]¶ Bases:
sqlalchemy.ext.declarative.api.Base
Object containing data for a single time step of a link node dataset file. Each link node time step will have a link dataset for each stream link in the channel input file.
-
tableName
= u'lnd_time_steps'¶ Database tablename
-
id
¶ PK
-
linkNodeDatasetFileID
¶ FK
-
linkNodeDataset
¶ RELATIONSHIP
-
linkDatasets
¶ RELATIONSHIP
-
timeStep
¶ INTEGER
-
-
class
gsshapy.orm.
LinkDataset
(**kwargs)[source]¶ Bases:
sqlalchemy.ext.declarative.api.Base
Object containing data for a single link dataset in a link node dataset file. A link dataset will have a node dataset for each of the stream nodes belonging to the stream link that it is associated with.
-
tableName
= u'lnd_link_datasets'¶ Database tablename
-
id
¶ PK
-
timeStepID
¶ FK
-
streamLinkID
¶ FK
-
linkNodeDatasetFileID
¶ FK
-
numNodeDatasets
¶ INTEGER
-
linkNodeDatasetFile
¶ RELATIONSHIP
-
timeStep
¶ RELATIONSHIP
-
nodeDatasets
¶ RELATIONSHIP
-
link
¶ RELATIONSHIP
-
-
class
gsshapy.orm.
NodeDataset
(**kwargs)[source]¶ Bases:
sqlalchemy.ext.declarative.api.Base
Object containing data for a single node dataset in a link node dataset file. The values stored in a link node dataset file are found in the node datasets.
-
tableName
= u'lnd_node_datasets'¶ Database tablename
-
id
¶ PK
-
linkDatasetID
¶ FK
-
streamNodeID
¶ FK
-
linkNodeDatasetFileID
¶ FK
-
status
¶ INTEGER
-
value
¶ FLOAT
-
linkNodeDatasetFile
¶ RELATIONSHIP
-
linkDataset
¶ RELATIONSHIP
-
node
¶ RELATIONSHIP
-