@LcdService(service=ILcdModelDecoder.class, priority=20000) public class TLcdGDFModelDecoder extends Object implements ILcdModelDecoder, ILcdInputStreamFactoryCapable
File | Required | Entry point | Description |
---|---|---|---|
*.gdf | x | x |
Main file containing the data |
*.gdf.gz | Compressed main file containing the data | ||
*.gdf.zip | Compressed main file containing the data |
ILcdInputStreamFactory
of this decoder.ILcdGeodeticReference
.ILcdDataObject
interface, providing access to the object's
type, but since GDF does not define the attributes that can occur within a feature class, the data types do not
expose any properties.
ILcdModelDecoder decoder = new TLcdGDFModelDecoder();
ILcdModel model = decoder.decode( "streets.gdf" );
GDF record type | Decoded object (or object containing the record data) |
---|---|
Dataset Header Record |
|
Attribute Definition Record |
|
Default Attribute Value Record |
|
Section Header Record |
|
XY-coordinates Record | |
Node Record | |
Edge Record | |
Face Record | |
Point Feature Record |
|
Line Feature Record |
|
Area Feature Record |
|
Complex Feature Record |
|
Text Record | ILcdGDFText |
Time Domain Record |
|
Attribute Record | ILcdGDFAttribute |
Conversion Record | |
Relationship Record | ILcdGDFRelationship |
Constructor and Description |
---|
TLcdGDFModelDecoder() |
Modifier and Type | Method and Description |
---|---|
boolean |
canDecodeSource(String aSourceAsString)
Checks whether this model decoder can decode the specified data source.
|
ILcdModel |
decode(String aSourceName)
Creates a new model from the given data source.
|
String |
getDefaultExtension()
Returns the default extension for GDF files.
|
String |
getDisplayName()
Returns a short, displayable name for the format that is decoded by this
ILcdModelDecoder . |
ILcdFilter |
getFeatureFilter()
Returns the feature filter used in this model decoder, or null if none is used.
|
ILcdGDFFeatureThemeMap |
getFeatureThemeMap()
Returns the ILcdGDFFeatureThemeMap used by this decoder.
|
ILcdInputStreamFactory |
getInputStreamFactory()
Returns the factory that is used to create input streams from which models are decoded.
|
String[] |
getTextTypeCodes()
Returns the list of type codes whose attribute value is a pointer to a name record.
|
String[] |
getTimeDomainTypeCodes()
Returns the list of type codes whose attribute value is a pointer to a time domain record.
|
boolean |
isDecodeAttributes()
Returns true if the attribute decoding flag is set,
falseotherwise. |
boolean |
isDecodeComplexFeatures()
Returns true if the complex features decoding flag is set,
falseotherwise.
|
boolean |
isDecodeRelationships()
Returns true if the relationship decoding flag is set,
falseotherwise.
|
boolean |
isDecodeZCoordinate()
Returns true if the z coordinate decoding flag is set,
falseotherwise.
|
void |
setDecodeAttributes(boolean aDecodeAttributes)
Sets a flag indicating whether attributes should be decoded or not.
|
void |
setDecodeComplexFeatures(boolean aDecodeComplexFeatures)
Sets a flag indicating whether complex features should be decoded or not.
|
void |
setDecodeRelationships(boolean aDecodeRelationships)
Sets a flag indicating whether relationships should be decoded or not.
|
void |
setDecodeZCoordinate(boolean aDecodeZCoordinate)
Sets a flag indicating whether the Z value of coordinates should be taken into account or not.
|
void |
setFeatureFilter(ILcdFilter aFeatureFilter)
Sets a filter to select which features will be added to the decoded models and which not.
|
void |
setFeatureThemeMap(ILcdGDFFeatureThemeMap aFeatureThemeMap)
Sets the ILcdGDFFeatureThemeMap to be used by this decoder.
|
void |
setInputStreamFactory(ILcdInputStreamFactory aInputStreamFactory)
Sets the factory that will create input streams from which models can be decoded.
|
void |
setTextTypeCodes(String[] aTextTypeCodes)
Sets the array of type codes whose attribute value is a pointer to a text record.
|
void |
setTimeDomainTypeCodes(String[] aTimeDomainTypeCodes)
Sets the array of type codes whose attribute value is a pointer to a time domain record.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
canDecodeSource, decodeModelMetadata, decodeModelMetadata, decodeSource, discoverDataSources
public void setInputStreamFactory(ILcdInputStreamFactory aInputStreamFactory)
setInputStreamFactory
in interface ILcdInputStreamFactoryCapable
aInputStreamFactory
- the factory that creates an input stream based on a source name.getInputStreamFactory()
public ILcdInputStreamFactory getInputStreamFactory()
getInputStreamFactory
in interface ILcdInputStreamFactoryCapable
setInputStreamFactory(com.luciad.io.ILcdInputStreamFactory)
public void setFeatureFilter(ILcdFilter aFeatureFilter)
aFeatureFilter
- the filter to apply, or null if no filter should be used.getFeatureFilter()
public ILcdFilter getFeatureFilter()
setFeatureFilter(com.luciad.util.ILcdFilter)
public void setFeatureThemeMap(ILcdGDFFeatureThemeMap aFeatureThemeMap)
aFeatureThemeMap
- the ILcdGDFFeatureThemeMap that is to be used by this
decoder.getFeatureThemeMap()
public ILcdGDFFeatureThemeMap getFeatureThemeMap()
setFeatureThemeMap(com.luciad.format.gdf.ILcdGDFFeatureThemeMap)
public void setDecodeZCoordinate(boolean aDecodeZCoordinate)
aDecodeZCoordinate
- boolean indicating whether the Z value of coordinates should be
taken
into account or not.public boolean isDecodeZCoordinate()
public void setDecodeAttributes(boolean aDecodeAttributes)
aDecodeAttributes
- boolean indicating whether to decode attributes or not.public boolean isDecodeAttributes()
falseotherwise.
falseotherwise.
public void setDecodeRelationships(boolean aDecodeRelationships)
aDecodeRelationships
- boolean indicating whether to decode relationships or not.public boolean isDecodeRelationships()
public void setDecodeComplexFeatures(boolean aDecodeComplexFeatures)
aDecodeComplexFeatures
- boolean indicating whether to decode complex features or not.public boolean isDecodeComplexFeatures()
public void setTextTypeCodes(String[] aTextTypeCodes)
Description | Attribute Type Code |
---|---|
Official Name Prefix | OX |
Official Name Text | ON |
Alternate Name Text | AN |
Multi-media Attachment Name | MN |
Directional Prefix | DP |
Street Type Prefix | SX |
Official Street Name Text | OF |
Alternate Street Name TExt | AL |
Street Type Suffix | ST |
Directional Suffix | DS |
Pronunciation | PO |
Exit Number | EN |
Route Number | RN |
Route Number on Sign | RX |
Building Class Name | BC |
Destination Location | DL |
Other Textual Content on Traffic Sign | CT |
Brand Name | BA |
Place Name | PE |
Street Name | SN |
Telefax Number | TX |
Telephone Number | TL |
aTextTypeCodes
- array of type codes whose attribute value is a pointer to a text record.public String[] getTextTypeCodes()
public void setTimeDomainTypeCodes(String[] aTimeDomainTypeCodes)
Description | Attribute Type Code |
---|---|
Validity Period | VP |
Opening Record | OP |
aTimeDomainTypeCodes
- array of type codes whose attribute value is a pointer to a time
domain record.public String[] getTimeDomainTypeCodes()
public String getDefaultExtension()
public String getDisplayName()
ILcdModelDecoder
ILcdModelDecoder
.getDisplayName
in interface ILcdModelDecoder
ILcdModelDecoder
.public boolean canDecodeSource(String aSourceAsString)
ILcdModelDecoder
true
for a source name while decode
throws an exception for that same source name.
For performance reasons, we strongly recommend that this will only be a simple test. For example: check the file extension of a file, but not that the file exists or contains expected content.
canDecodeSource
in interface ILcdModelDecoder
aSourceAsString
- the data source to be verified; typically a file name or a URL.true
if this decoder can likely decode the data specified by the source name, false
otherwise.ILcdModelDecoder.decode(String)
,
ILcdModelDecoder.decodeModelMetadata(String)
public ILcdModel decode(String aSourceName) throws IOException
ILcdModelDecoder
decode
in interface ILcdModelDecoder
aSourceName
- the data source to be decoded; typically a file name or a URL.null
is allowed, implementors are advised to throw an error instead.IOException
- for any exceptions caused by IO problems or invalid data. Since decoding invalid data almost
always results in RunTimeExceptions (NullPointerException, IndexOutOfBoundsException,
IllegalArgumentException, ...) on unexpected places, implementations are advised to catch
RuntimeExceptions in their decode() method, and wrap them into an IOException, as illustrated
in the code snippet below.
public ILcdModel decode( String aSourceName ) throws IOException {
try (InputStream input = fInputStreamFactory.createInputStream(aSourceName)) {
// Perform decoding ...
} catch (RuntimeException e) {
throw new IOException(e);
}
}
InterruptedIOException
- When the thread on which this method is called is interrupted: it is recommended to stop the decoding
and throw an InterruptedIOException
.
This same exception can also be used if the decoder shows UI to the user, and the user cancels the decoding
through the UI.ILcdModelDecoder.canDecodeSource(String)