Package com.luciad.format.shp
Class TLcdSHPModelDecoder
java.lang.Object
com.luciad.format.shp.TLcdSHPModelDecoder
- All Implemented Interfaces:
ILcdInputStreamFactoryCapable
,ILcdModelDecoder
,ILcdCharsetSettable
@LcdService(service=ILcdModelDecoder.class,
priority=50000)
public class TLcdSHPModelDecoder
extends Object
implements ILcdModelDecoder, ILcdCharsetSettable, ILcdInputStreamFactoryCapable
This model decoder decodes ESRI shape files.
Important note
This decoder does eager loading of all the geometry and property data up-front. This results in large memory footprint as well as a big decoding hit on startup, but subsequent queries are very fast. It is recommended to useTLcdSHPModelDecoder2
instead: it does lazy loading depending on the client request.
For example, it will only load data within a requested area
based on a spatial index.
Input files
File | Required | Entry point | Description |
---|---|---|---|
*.shp | x | x | Shape file containing the vector data |
*.dbf | dBASE table file containing the feature attributes of the shapes | ||
*.shx | Index file containing the offset of each record from the beginning of the main file |
The model reference is obtained from an ILcdModelReferenceDecoder
. The default reference decoder set on this
model decoder is based on all model reference decoders annotated with the LcdService
annotation, and can handle
- EPSG references (
<filename>.epsg
): seeTLcdEPSGModelReferenceDecoder
for more info. - WKT references (
<filename>.prj
): seeTLcdWKTModelReferenceDecoder
for more info. - Luciad encoded model references (
<filename>.ref
): seeTLcdModelReferenceDecoder
for more info.
Supported file transfer protocols
- This model decoder supports all transfer protocols that are supported by
the
input stream factory
of this decoder.
Model structure
- This model decoder creates a model per SHP file.
- All models returned by this model decoder implement
ILcd2DBoundsIndexedModel
.
Model descriptor
- All models returned by this model decoder have a
TLcdSHPModelDescriptor
. - The type name of the model descriptor is
SHP
.
Model elements
The supported shapes are represented by:SHP Type | Decoded Type |
---|---|
POINT | TLcd2DEditableFeaturedPoint |
POLYLINE | TLcdFeaturedShapeList with shape array of ILcd2DEditablePolyline objects |
POLYGON | TLcdFeaturedShapeList with shape array of a single TLcdComplexPolygon containing a set of ILcd2DEditablePolygon objects |
MULTI_POINT | TLcdFeaturedShapeList with shape array of ILcd2DEditablePolypoint objects |
POINT_Z | TLcd2DEditableFeaturedPoint with a TLcdSHPPointZ |
POLYLINE_Z | TLcdFeaturedShapeList with shape array of TLcdSHPPolylineZ objects |
POLYGON_Z | TLcdFeaturedShapeList with shape array of a single TLcdComplexPolygon containing a set of TLcdSHPPolygonZ objects |
MULTI_POINT_Z | TLcdFeaturedShapeList with shape array of TLcdSHPMultiPointZ objects |
POINT_M | TLcd2DEditableFeaturedPoint with a TLcdSHPPointM |
POLYLINE_M | TLcdFeaturedShapeList with shape array of TLcdSHPPolylineZ objects |
POLYGON_M | TLcdFeaturedShapeList with shape array of a single TLcdComplexPolygon containing a set of TLcdSHPPolygonZ objects |
MULTI_POINT_Z | TLcdFeaturedShapeList with shape array of TLcdSHPMultiPointZ objects |
Useful settings
- The lazyFeaturing property specifies whether the features are read at the time of
decoding or only when their feature is actually needed. When they are read, they are
kept in memory. This gives a performance increase for reading SHP files but may give some
performance loss if many features have to be read later (labeling for example).
By default this property is set to
true
. - By using the lazyFeaturingOffForHTTP the lazy feature mechanism can still be switched
off if the file is to be retrieved over an http connection. By default, this property is set to
true
.
Sample code
ILcdModelDecoder decoder = new TLcdSHPModelDecoder();
ILcdModel model = decoder.decode( "vector.shp" );
Thread safety
- The decoding of models is not thread-safe.
- The decoded models are thread-safe for read access.
Supported versions and specifications
Known limitations
- MultiPointM and MultiPatch elements are not supported
-
Constructor Summary
ConstructorDescriptionConstructs a new SHP model decoder.TLcdSHPModelDecoder
(String aDataModelName) Constructs a new SHP model decoder with a fixedTLcdDataModel
. -
Method Summary
Modifier and TypeMethodDescriptionboolean
canDecodeSource
(String aSourceName) Checks whether this model decoder can decode the specified data source.Creates a new model from the given data source.static String
formatShapeType
(int aShapeType) Returns a shape type by in human-readable form.Returns the name of the current Charset.Returns the decodingBounds of this decoder.Returns the default extension for files that can be read with this decoder.Returns the model reference to be used for models when the model reference decoder is set to null.Returns the display name to use for this decoder.int
Returns the index of the feature to be used as a default display name.Returns the factory that creates input streams from which models are decoded.Returns the factory object used for creating the output model.Returns the decoder used to produce model references.boolean
Returns whether the decoder returns shapes containing TLcdXYFloatPoints instead of the normal TLcdXYPoints.boolean
Returns whether the lazy feature mechanism should be switched of in case files are retrieved via ahttp
connection.boolean
Indicates whether or not floating point values are parsed as a Float or a Double.boolean
Deprecated.This method has been deprecated.boolean
Indicates whether or not string values are trimmed when decoding DBF files.boolean
Returns whether the decoder returns shapes containing TLcdXYFloatPoints instead of the normal TLcdXYPoints.protected boolean
isValidField
(String aField) Returns whether the field with nameaField
is a valid field in theILcdModel
produced by thisTLcdSHPModelDecoder
.static boolean
isValidShape
(int aShapeType) Checks whether a shape type is valid for this decoder.boolean
Returns whether the decoder will read the object's features with the lazy mechanism or not.protected ILcdModel
Creates aTLcdVectorModel
by callingmakeVectorModel()
and then converts it toILcd2DBoundsIndexedModel
.protected ILcdModel
Creates aTLcdVectorModel
, sets a model reference, adds all the SHP Objects in theTLcdVectorModel
and closes the inputStream.protected ILcdBounds
readBounds
(int aCoordType) Reads a bounds from the input.protected int
Reads data from the input stream into a model.protected ILcdFeatured
Reads the features to an object.protected ILcdShape[]
readMultiPoint
(int aCoordType, int aRecordByteSize) Reads a set of points as a multi point.protected ILcdShape[]
readMultiPointM
(int aCoordType, int aRecordByteSize) Reads a set of measured points as a multi point.protected ILcdShape[]
readMultiPointZ
(int aCoordType, int aRecordByteSize) Reads a set of three dimensional measured points as a multi point.protected ILcdShape[]
readOtherShapes
(int aCoordType, int aRecordByteSize) Can be redefined to order to define how to read an ESRI shape not supported by thisILcdModelDecoder
Skips the unsupported shape.protected ILcd2DEditablePoint
readPoint
(int aCoordType) Creates and reads a 2D point from the SHP file.protected ILcd2DEditablePoint
readPoint
(int aCoordType, int aDimension) Creates a point with the specified dimension (2D,3D).protected ILcd2DEditablePoint
readPointM
(int aCoordType) Reads a 2 dimensional point and a value from the input.protected ILcd3DEditablePoint
readPointZ
(int aCoordType) Reads a 2 dimensional point and a value from the input.protected ILcdShape[]
readPolygon
(int aCoordType, int aRecordByteSize) Reads a polygon from the input.protected ILcdShape[]
readPolygonM
(int aCoordType, int aRecordByteSize) Reads a polygon consisting of measured points from the input.protected ILcdShape[]
readPolygonZ
(int aCoordType, int aRecordByteSize) Reads a polygon consisting of three dimensional measured points from the input.protected ILcdShape[]
readPolyline
(int aCoordType, int aRecordByteSize) Returns null when the decodingBounds is not null and the bounds of the polyline do not interact with the decodingBounds.protected ILcdShape[]
readPolylineM
(int aCoordType, int aRecordByteSize) Reads a polyline consisting of points accompanied with a value.protected ILcdShape[]
readPolylineZ
(int aCoordType, int aRecordByteSize) Reads a polyline consisting of three dimensional points accompanied with a value.protected int
Reads one integer as a shape type.void
setCharacterSet
(String aCharacterSet) Sets the character set to use to decode DBF files.static void
setClassTraceOn
(boolean aClassTraceOn) Deprecated.This method has been deprecated.void
setDecodingBounds
(ILcdBounds aDecodingBounds) Sets the decodingBounds of the decoder to aDecodingBounds.void
setDefaultModelReference
(ILcdModelReference aDefaultModelReference) Sets the model reference to be used for models when the model reference decoder is set to null.void
setFeatureIndexForDisplayName
(int aFeatureIndexForDisplayName) Set the index of the feature to be used as default display name (e.g. the feature value to be used by the Object.toString() method).void
setInputStreamFactory
(ILcdInputStreamFactory aInputStreamFactory) Sets the factory that will create input streams from which models can be decoded.void
setLazyFeaturingOffForHTTP
(boolean aLazyFeaturingOffForHTTP) Sets whether the lazy feature mechanism should be switched of in case files are retrieved via ahttp
connection.void
setModelFactory
(ILcdModelFactory aModelFactory) Sets the factory object used for creating the output model.void
setModelReferenceDecoder
(ILcdModelReferenceDecoder aModelReferenceDecoder) Sets the decoder to use to produce model references for models created with this decoder.void
setParseFloatAsDouble
(boolean aFloatAsDouble) Specifies whether or not floating point values are parsed as a Float or a Double.void
setTraceOn
(boolean aTraceOn) Deprecated.This method has been deprecated.void
setTrimStringPropertyValues
(boolean aTrimStringPropertyValues) Specifies whether or not leading and trailing whitespace should be removed from string properties while decoding DBF files.void
setUseXYFloatPoint
(boolean aUseXYFloatPoint) Sets whether the decoder should return shapes containing TLcdXYFloatPoints instead of the normal TLcdXYPoints.final void
setWithFeatures
(boolean aReadWithFeatures) Sets whether the features of the objects should be read or not.void
setWithLazyFeaturing
(boolean aLazyFeaturing) Sets whether the features of the objects should be read with the lazy mechanism or not.protected final void
skipBytes
(int aNumberOfBytesToSkip) Skips a number of bytes from the input stream.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface com.luciad.model.ILcdModelDecoder
canDecodeSource, decodeModelMetadata, decodeModelMetadata, decodeSource, discoverDataSources
-
Constructor Details
-
TLcdSHPModelDecoder
public TLcdSHPModelDecoder()Constructs a new SHP model decoder. -
TLcdSHPModelDecoder
Constructs a new SHP model decoder with a fixedTLcdDataModel
. All files that are decoded with this decoder will use exactly the same data model. This data model will have the given name. It is the responsibility of the caller of this method to ensure that all files that are decoded have exactly the same structure; this means that the shape type is the same and that all files contain the same feature structure. The result of decoding files with different structures with a fixed data model is unspecified.
-
-
Method Details
-
setClassTraceOn
public static void setClassTraceOn(boolean aClassTraceOn) Deprecated.This method has been deprecated. It is recommended to use the standard Java logging framework directly.Enables tracing for all instances of this class. If the argument istrue
then all log messages are recorded, otherwise only the informative, warning and error messages are recorded.- Parameters:
aClassTraceOn
- if true then all log messages are recorded, otherwise only the informative, warning and error messages are recorded.
-
setTraceOn
public void setTraceOn(boolean aTraceOn) Deprecated.This method has been deprecated. It is recommended to use the standard Java logging framework directly.Enables tracing for this class instance. Calling this method with eithertrue
orfalse
as argument automatically turns off tracing for all other class instances for whichsetTraceOn
has not been called. If the argument isfalse
then only the informative, warning and error log messages are recorded.- Parameters:
aTraceOn
- if true then all log messages are recorded for this instance. If false, then only the informative, warning and error log messages are recorded.
-
isTraceOn
public boolean isTraceOn()Deprecated.This method has been deprecated. It is recommended to use the standard Java logging framework directly.Returnstrue
if tracing is enabled for this class.- Returns:
- true if tracing is enabled for this class, false otherwise.
-
setCharacterSet
Sets the character set to use to decode DBF files. Default value is "windows-1252".- Specified by:
setCharacterSet
in interfaceILcdCharsetSettable
- Parameters:
aCharacterSet
- the character set to use to decode DBF files. The supported character sets depend on the JVM implementation and can be found atString(byte[], String)
.
-
getCharacterSet
Description copied from interface:ILcdCharsetSettable
Returns the name of the current Charset.- Specified by:
getCharacterSet
in interfaceILcdCharsetSettable
- Returns:
- the name of the Charset.
-
setParseFloatAsDouble
public void setParseFloatAsDouble(boolean aFloatAsDouble) Specifies whether or not floating point values are parsed as a Float or a Double. The default setting isfalse
, parsing as Float.- Parameters:
aFloatAsDouble
- whether or not floating point values are parsed as Float or Double.
-
isParseFloatAsDouble
public boolean isParseFloatAsDouble()Indicates whether or not floating point values are parsed as a Float or a Double.false
for Float,true
for Double.- Returns:
- whether or not floating point values are parsed as Float or Double.
false
for Float,true
for Double
-
setWithFeatures
public final void setWithFeatures(boolean aReadWithFeatures) Sets whether the features of the objects should be read or not. If true the decoder will try to read the corresponding DBF file. If false the features will be read depending on the value of withLazyFeaturing. By default the value is true.- See Also:
-
setWithLazyFeaturing
public void setWithLazyFeaturing(boolean aLazyFeaturing) Sets whether the features of the objects should be read with the lazy mechanism or not. Default value is false. If withFeatures is false this property is of no importance.- Parameters:
aLazyFeaturing
- true if the features of the objects should be read with the lazy mechanism.- See Also:
-
isWithLazyFeaturing
public boolean isWithLazyFeaturing()Returns whether the decoder will read the object's features with the lazy mechanism or not.- Returns:
- whether the decoder will read the object's features with the lazy mechanism or not.
- See Also:
-
setLazyFeaturingOffForHTTP
public void setLazyFeaturingOffForHTTP(boolean aLazyFeaturingOffForHTTP) Sets whether the lazy feature mechanism should be switched of in case files are retrieved via ahttp
connection.- Parameters:
aLazyFeaturingOffForHTTP
- true if the lazy feature mechanism should be switched of in case files are retrieved via ahttp
connection.- See Also:
-
isLazyFeaturingOffForHTTP
public boolean isLazyFeaturingOffForHTTP()Returns whether the lazy feature mechanism should be switched of in case files are retrieved via ahttp
connection.- Returns:
- true if the lazy feature mechanism should be switched of in case files
are retrieved via a
http
connection. - See Also:
-
setUseXYFloatPoint
public void setUseXYFloatPoint(boolean aUseXYFloatPoint) Sets whether the decoder should return shapes containing TLcdXYFloatPoints instead of the normal TLcdXYPoints.- Parameters:
aUseXYFloatPoint
- true if the decoder should return shapes containing TLcdXYFloatPoints instead of the normal TLcdXYPoints.- See Also:
-
isUseXYFloatPoint
public boolean isUseXYFloatPoint()Returns whether the decoder returns shapes containing TLcdXYFloatPoints instead of the normal TLcdXYPoints.- Returns:
- whether the decoder returns shapes containing TLcdXYFloatPoints instead of the normal TLcdXYPoints.
- See Also:
-
getUseXYFloatPoint
public boolean getUseXYFloatPoint()Returns whether the decoder returns shapes containing TLcdXYFloatPoints instead of the normal TLcdXYPoints.- Returns:
- whether the decoder returns shapes containing TLcdXYFloatPoints instead of the normal TLcdXYPoints.
- See Also:
-
getDecodingBounds
Returns the decodingBounds of this decoder.- Returns:
- The decodingBounds of this decoder.
- See Also:
-
setDecodingBounds
Sets the decodingBounds of the decoder to aDecodingBounds. Only those elements of the SHP file of which the bounds interact with the decodingBounds end up in the decoded model. If the decodingBounds is null, no filtering is performed. Default value is null.- Parameters:
aDecodingBounds
- The new decodingBounds to be set.- See Also:
-
getDisplayName
Returns the display name to use for this decoder.- Specified by:
getDisplayName
in interfaceILcdModelDecoder
- Returns:
- "ESRI-ShapeFile".
-
getDefaultExtension
Returns the default extension for files that can be read with this decoder.- Returns:
- "shp".
-
setFeatureIndexForDisplayName
public void setFeatureIndexForDisplayName(int aFeatureIndexForDisplayName) Set the index of the feature to be used as default display name (e.g. the feature value to be used by the Object.toString() method). This index shall be chosen taking into account the feature ordering in the dbf file to decode. The default value is 0;- Parameters:
aFeatureIndexForDisplayName
- the index of the feature to be used as default display name.- See Also:
-
getFeatureIndexForDisplayName
public int getFeatureIndexForDisplayName()Returns the index of the feature to be used as a default display name.- Returns:
- the index of the feature to be used as a default display name.
- See Also:
-
canDecodeSource
Description copied from interface:ILcdModelDecoder
Checks whether this model decoder can decode the specified data source. It is acceptable for this method to returntrue
for a source name whiledecode
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.
- Specified by:
canDecodeSource
in interfaceILcdModelDecoder
- Parameters:
aSourceName
- the data source to be verified; typically a file name or a URL.- Returns:
true
if the file extension is <defaultExtension> or <defaultExtension>.gz,false
otherwise (<defaultExtension> is the String returned by getDefaultExtension.- See Also:
-
setDefaultModelReference
Sets the model reference to be used for models when the model reference decoder is set to null.- Parameters:
aDefaultModelReference
- the model reference to be used for models when the model reference decoder is set to null.- See Also:
-
getDefaultModelReference
Returns the model reference to be used for models when the model reference decoder is set to null.- Returns:
- the model reference to be used for models when the model reference decoder is set to null.
- See Also:
-
getModelReferenceDecoder
Returns the decoder used to produce model references.- Returns:
- the decoder to produce model references.
- See Also:
-
setModelReferenceDecoder
Sets the decoder to use to produce model references for models created with this decoder.- Parameters:
aModelReferenceDecoder
- the decoder to use to produce model references for models created with this decoder.- See Also:
-
setInputStreamFactory
Sets the factory that will create input streams from which models can be decoded.- Specified by:
setInputStreamFactory
in interfaceILcdInputStreamFactoryCapable
- Parameters:
aInputStreamFactory
- the input stream factory to be used.
-
getInputStreamFactory
Returns the factory that creates input streams from which models are decoded.- Specified by:
getInputStreamFactory
in interfaceILcdInputStreamFactoryCapable
- Returns:
- the input stream factory that is used.
-
getModelFactory
Returns the factory object used for creating the output model.- Returns:
- the model factory.
-
setModelFactory
Sets the factory object used for creating the output model.- Parameters:
aModelFactory
- the model factory.
-
decode
Description copied from interface:ILcdModelDecoder
Creates a new model from the given data source.- Specified by:
decode
in interfaceILcdModelDecoder
- Parameters:
aFullPathFileName
- the data source to be decoded; typically a file name or a URL.- Returns:
- A model containing the decoded data. While
null
is allowed, implementors are advised to throw an error instead. - Throws:
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); } }
- See Also:
-
setTrimStringPropertyValues
public void setTrimStringPropertyValues(boolean aTrimStringPropertyValues) Specifies whether or not leading and trailing whitespace should be removed from string properties while decoding DBF files. The default setting istrue
.- Parameters:
aTrimStringPropertyValues
- whether or not string values in DBF files should be trimmed
-
isTrimStringPropertyValues
public boolean isTrimStringPropertyValues()Indicates whether or not string values are trimmed when decoding DBF files.- Returns:
- whether or not string values are trimmed when decoding DBF files
- See Also:
-
makeVectorModel
Creates aTLcdVectorModel
, sets a model reference, adds all the SHP Objects in theTLcdVectorModel
and closes the inputStream.- Returns:
- a
TLcdVectorModel
containing all objects retrieved from the input stream. - Throws:
IOException
- when an I/O error occurs while reading the model from the input.
-
makeIndexedModel
Creates aTLcdVectorModel
by callingmakeVectorModel()
and then converts it toILcd2DBoundsIndexedModel
.- Returns:
- an indexed model containing all objects from the input stream.
- Throws:
IOException
- when an I/O error occurs while reading the model from the input.- See Also:
-
readData
Reads data from the input stream into a model.- Parameters:
aModel
- the model the objects created from the data are put in.aCoordType
- the type of data read ( Cartesian or Geodetic ).- Returns:
- the number of words in a record.
- Throws:
IOException
- when reading the data fails due to I/O.- See Also:
-
isValidShape
public static boolean isValidShape(int aShapeType) Checks whether a shape type is valid for this decoder.- Parameters:
aShapeType
- the shape type to check.- Returns:
- true if the shape type is one of the following:
TLcdSHPModelDescriptor.POINT
TLcdSHPModelDescriptor.POINT_M
TLcdSHPModelDescriptor.POINT_Z
TLcdSHPModelDescriptor.MULTI_POINT
TLcdSHPModelDescriptor.MULTI_POINT_M
TLcdSHPModelDescriptor.MULTI_POINT_Z
TLcdSHPModelDescriptor.POLYLINE
TLcdSHPModelDescriptor.POLYLINE_M
TLcdSHPModelDescriptor.POLYLINE_Z
TLcdSHPModelDescriptor.POLYGON_M
TLcdSHPModelDescriptor.POLYGON_Z
TLcdSHPModelDescriptor.POLYGON
-
readShapeType
Reads one integer as a shape type.- Returns:
- the code for the shape type.
- Throws:
IOException
- when reading fails due to I/O.
-
readFeaturedObject
Reads the features to an object.- Returns:
- the features of an object.
- Throws:
IOException
- when reading fails due to I/O.
-
readPoint
Creates and reads a 2D point from the SHP file.- Parameters:
aCoordType
- the type of coordinates, cartesian or geodetic (ILcdGeoReference
).- Returns:
- a 2D point read from the SHP file.
- Throws:
IOException
- when an I/O error occurs while reading from the input.
-
readPoint
Creates a point with the specified dimension (2D,3D). The first two coordinates are read.- Parameters:
aCoordType
- the type of coordinates, cartesian or geodetic (ILcdGeoReference
).aDimension
- the dimension of the point to be read.- Returns:
- a point with the specified dimension (2D,3D) and coordinate type.
- Throws:
IOException
- when an I/O error occurs while reading from the input.
-
readPointM
Reads a 2 dimensional point and a value from the input.- Parameters:
aCoordType
- the type of coordinates, cartesian or geodetic (ILcdGeoReference
).- Returns:
- a
TLcdSHPPointM
- Throws:
IOException
- when an I/O error occurs.
-
readPointZ
Reads a 2 dimensional point and a value from the input.- Parameters:
aCoordType
- the type of coordinates, cartesian or geodetic (ILcdGeoReference
).- Returns:
- a
TLcdSHPPointZ
. - Throws:
IOException
- when an I/O error occurs.
-
readOtherShapes
Can be redefined to order to define how to read an ESRI shape not supported by thisILcdModelDecoder
Skips the unsupported shape.- Parameters:
aCoordType
- the ESRI shape type (see ESRI documentation).aRecordByteSize
- the size of the record in bytes ( read from the input stream ).- Returns:
null
.- Throws:
IOException
- when an I/O error occurs while reading from the input.
-
skipBytes
Skips a number of bytes from the input stream.- Parameters:
aNumberOfBytesToSkip
- the number of bytes to skip.- Throws:
IOException
- when an I/O error occurs.
-
readPolyline
Returns null when the decodingBounds is not null and the bounds of the polyline do not interact with the decodingBounds.- Parameters:
aCoordType
- the type of coordinates, cartesian or geodetic (ILcdGeoReference
).aRecordByteSize
- the size of the record in bytes ( read from the input stream ).- Returns:
- an array of
TLcdSHPPolylineZ
objects. - Throws:
IOException
- when an I/O error occurs.
-
readPolylineM
Reads a polyline consisting of points accompanied with a value.- Parameters:
aCoordType
- the type of coordinates, cartesian or geodetic (ILcdGeoReference
).aRecordByteSize
- the size of the record in bytes ( read from the input stream ).- Returns:
- an array of
TLcdSHPPolylineZ
- Throws:
IOException
- when an I/O error occurs.
-
readPolylineZ
Reads a polyline consisting of three dimensional points accompanied with a value.- Parameters:
aCoordType
- the type of coordinates, cartesian or geodetic (ILcdGeoReference
).aRecordByteSize
- the size of the record in bytes ( read from the input stream ).- Returns:
- an array of
TLcdSHPPolylineZ
- Throws:
IOException
- when an I/O error occurs.
-
readPolygon
Reads a polygon from the input.- Parameters:
aCoordType
- the type of coordinates, cartesian or geodetic (ILcdGeoReference
).aRecordByteSize
- the size of the record in bytes ( read from the input stream ).- Returns:
- an array containing one
TLcdComplexPolygon
. - Throws:
IOException
- when reading the data fails due to I/O.
-
readPolygonM
Reads a polygon consisting of measured points from the input.- Parameters:
aCoordType
- the type of coordinates, cartesian or geodetic (ILcdGeoReference
).aRecordByteSize
- the size of the record in bytes ( read from the input stream ).- Returns:
- an array containing one
TLcdComplexPolygon
. - Throws:
IOException
- when an I/O error occurs.
-
readPolygonZ
Reads a polygon consisting of three dimensional measured points from the input.- Parameters:
aCoordType
- the type of coordinates, cartesian or geodetic (ILcdGeoReference
).aRecordByteSize
- the size of the record in bytes ( read from the input stream ).- Returns:
- an array containing one
TLcdComplexPolygon
. - Throws:
IOException
- when an I/O error occurs.
-
readMultiPoint
Reads a set of points as a multi point.- Parameters:
aCoordType
- the type of coordinates, cartesian or geodetic (ILcdGeoReference
).aRecordByteSize
- the size of the record in bytes ( read from the input stream ).- Returns:
- an array containing one
ILcd2DEditablePolypoint
. - Throws:
IOException
- when an I/O error occurs.
-
readMultiPointM
Reads a set of measured points as a multi point.- Parameters:
aCoordType
- the type of coordinates, cartesian or geodetic (ILcdGeoReference
).aRecordByteSize
- the size of the record in bytes ( read from the input stream ).- Returns:
- an array containing one
TLcdSHPMultiPointZ
. - Throws:
IOException
- when an I/O error occurs.
-
readMultiPointZ
Reads a set of three dimensional measured points as a multi point.- Parameters:
aCoordType
- the type of coordinates, cartesian or geodetic (ILcdGeoReference
).aRecordByteSize
- the size of the record in bytes ( read from the input stream ).- Returns:
- an array containing one
TLcdSHPMultiPointZ
. - Throws:
IOException
- when an I/O error occurs.
-
readBounds
Reads a bounds from the input.- Parameters:
aCoordType
- the type of coordinates, cartesian or geodetic (ILcdGeoReference
).- Returns:
- a
ILcdBounds
- Throws:
IOException
- when an I/O error occurs.
-
formatShapeType
Returns a shape type by in human-readable form.- Parameters:
aShapeType
- the shape type to format.- Returns:
- the human-readable form of a shape type.
-
isValidField
Returns whether the field with nameaField
is a valid field in theILcdModel
produced by thisTLcdSHPModelDecoder
.- Parameters:
aField
- the field to check.- Returns:
true
if and only if the field with nameaField
is a valid field in theILcdModel
produced by thisTLcdSHPModelDecoder
.
-