Class DatasetVectorInfo
- java.lang.Object
-
- com.supermap.data.DatasetVectorInfo
-
public class DatasetVectorInfo extends java.lang.Object
The DatasetVectorInfo class.
Contains the vector dataset information, such as the vector dataset name, the dataset type, the encoding mode, whether to use file cache, etc. The file cache only aims at tile index.
- Example:
- The following example demonstrates how to create a vector dataset using the DatasetVectorInfo object.
public void datasetVectorInfoTest() { // Imagines that you open a workspace object, and there is a database datasource object in the workspace // The following code demonstrates the creation of vector datasets from vector dataset information Datasets datasets = datasource.getDatasets(); String name = datasets.getAvailableDatasetName("River"); // Sets the information of vector dataset DatasetVectorInfo datasetVectorInfo = new DatasetVectorInfo(); datasetVectorInfo.setType(DatasetType.LINE); datasetVectorInfo.setEncodeType(EncodeType.NONE); datasetVectorInfo.setFileCache(true); datasetVectorInfo.setName(name); System.out.println("The information of vector dataset is: " + datasetVectorInfo.toString()); // Creates a vector dataset DatasetVector datasetVector = datasets.create(datasetVectorInfo); if (datasetVector != null) { System.out.println(datasetVector.getName() + "Created!"); } // Releases resources datasetVectorInfo.dispose(); datasetVector.close(); }
-
-
Constructor Summary
Constructors Constructor and Description DatasetVectorInfo()
Constructs a new DatasetVectorInfo object.DatasetVectorInfo(DatasetVectorInfo datasetVectorInfo)
Constructs a new object identical to the given DatasetVectorInfo object.DatasetVectorInfo(java.lang.String name, DatasetType type)
Creates a new DatasetVectorInfo object according to the specified arguments.DatasetVectorInfo(java.lang.String name, DatasetVector templateDataset)
Creates a new DatasetVectorInfo object according to the specified arguments.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method and Description void
dispose()
Disposes the resources occupied by the object.EncodeType
getEncodeType()
Returns the encoding type.java.lang.String
getName()
Returns the name of the vector dataset.DatasetType
getType()
Returns the DatasetVector class.void
setEncodeType(EncodeType value)
Sets the encoding type.void
setName(java.lang.String value)
Sets the name of the vector dataset.void
setType(DatasetType value)
Sets the DatasetVector class.java.lang.String
toString()
Outputs the information of the vector dataset, including the name of the dataset, the type of the dataset, the encode type of the dataset and whether using the file cache.
-
-
-
Constructor Detail
-
DatasetVectorInfo
public DatasetVectorInfo()
Constructs a new DatasetVectorInfo object.
-
DatasetVectorInfo
public DatasetVectorInfo(java.lang.String name, DatasetType type)
Creates a new DatasetVectorInfo object according to the specified arguments.- Parameters:
name
- The name of the dataset.type
- the type of the source vector dataset.
-
DatasetVectorInfo
public DatasetVectorInfo(DatasetVectorInfo datasetVectorInfo)
Constructs a new object identical to the given DatasetVectorInfo object.- Parameters:
datasetVectorInfo
- The DatasetVectorInfo object specified.
-
DatasetVectorInfo
public DatasetVectorInfo(java.lang.String name, DatasetVector templateDataset)
Creates a new DatasetVectorInfo object according to the specified arguments.- Parameters:
name
- The specified nametemplateDataset
- Specified template dataset.
-
-
Method Detail
-
getName
public java.lang.String getName()
Returns the name of the vector dataset.The limitation of dataset name is that it can not exceed 30 characters in length, namely 30 English letters or 15 chinese characters. The characters of dataset name can be letter, number and underline but it can not initial with number or underline, if the name initials with letter. In addition, the dataset name can not conflict with the preserved keywords of database.
- Returns:
- the name of the vector dataset.
- Default:
- The default value is "UntitledDatasetVector".
-
setName
public void setName(java.lang.String value)
Sets the name of the vector dataset.The limitation of dataset name is that it can not exceed 30 characters in length, namely 30 English letters or 15 chinese characters. The characters of dataset name can be letter, number and underline but it can not initial with number or underline, if the name initials with letter. In addition, the dataset name can not conflict with the preserved keywords of database.
- Parameters:
value
- the name of the vector dataset.
-
getType
public DatasetType getType()
Returns the DatasetVector class. SuperMap There are 18 kinds of dataset types in SuperMap and the current version supports point dataset, line dataset, region dataset, text dataset and CAD dataset. For more information about dataset type, please refer to theDatasetType
class.- Returns:
- The vector dataset type.
- See Also:
DatasetType
- Default:
- default value is
POINT
type.
-
setType
public void setType(DatasetType value)
Sets the DatasetVector class. SuperMap There are 18 kinds of dataset types in SuperMap and the current version supports point dataset, line dataset, region dataset, text dataset and CAD dataset. For more information about dataset type, please refer to theDatasetType
class.- Parameters:
value
- The vector dataset type.- See Also:
DatasetType
-
getEncodeType
public EncodeType getEncodeType()
Returns the encoding type. For vector dataset, four encoding types are supported, that is single-byte, double-byte, three-byte and four-byte; for raster dataset, there are three encoding types: DCT, SGL and LZW. SeeEncodeType
.Note:
- For some encode types, SuperMap Objects .NET may automatically change it to a more suitable encode type for the dataset.
- Point and tabular datasets only supports EncodeType.None.
- Returns:
- the encoding type of the dataset.
- See Also:
EncodeType
- Default:
- default value is
NONE
type.
-
setEncodeType
public void setEncodeType(EncodeType value)
Sets the encoding type. For vector dataset, four encoding types are supported, that is single-byte, double-byte, three-byte and four-byte; for raster dataset, there are three encoding types: DCT, SGL and LZW. SeeEncodeType
.Note:
- For some encode types, SuperMap Objects .NET may automatically change it to a more suitable encode type for the dataset.
- Point and tabular datasets only supports EncodeType.None.That only support
EncodeType.NONE
- Parameters:
value
- the encoding type of the dataset.- See Also:
EncodeType
-
toString
public java.lang.String toString()
Outputs the information of the vector dataset, including the name of the dataset, the type of the dataset, the encode type of the dataset and whether using the file cache. The output format is {Name="",Type=,EncodeType=,IsMemoryCache=,IsFileCache=}.- Overrides:
toString
in classjava.lang.Object
- Returns:
- the information of the vector dataset.
-
dispose
public void dispose()
Disposes the resources occupied by the object. After calling this method, this object will not be usable.
-
-