Class GISShapeFileReader
- java.lang.Object
-
- org.arakhne.afc.io.shape.AbstractCommonShapeFileReader<E>
-
- org.arakhne.afc.io.shape.AbstractShapeFileReader<MapElement>
-
- org.arakhne.afc.gis.io.shape.GISShapeFileReader
-
- All Implemented Interfaces:
AutoCloseable
,Iterable<MapElement>
public class GISShapeFileReader extends AbstractShapeFileReader<MapElement>
Reader of GIS elements from an ESRi shapefile.- Since:
- 14.0
- Version:
- 17.0 2020-01-04 14:41:54
- Author:
- Stéphane GALLAND
- Maven Group Id:
- org.arakhne.afc.gis
- Maven Artifact Id:
- gisinputoutput
-
-
Field Summary
-
Fields inherited from class org.arakhne.afc.io.shape.AbstractShapeFileReader
DEFAULT_FUSION_DISTANCE
-
Fields inherited from class org.arakhne.afc.io.shape.AbstractCommonShapeFileReader
BLOCK_SIZE, expectedShapeType, fileSize, maxm, maxx, maxy, maxz, minm, minx, miny, minz
-
-
Constructor Summary
Constructors Constructor Description GISShapeFileReader(File file)
Create a reader of shapes from specified file.GISShapeFileReader(File file, Class<? extends MapElement> elementType)
Create a reader of shapes from specified file.GISShapeFileReader(File file, Class<? extends MapElement> elementType, DBaseFileReader dbase_importer)
Create a reader of shapes from specified file.GISShapeFileReader(File file, Class<? extends MapElement> elementType, DBaseFileReader dbase_importer, URL dBaseAttributeSource)
Create a reader of shapes from specified file.GISShapeFileReader(File file, Class<? extends MapElement> elementType, DBaseFileReader dbase_importer, ShapeFileIndexReader shxReader)
Create a reader of shapes from specified file.GISShapeFileReader(File file, Class<? extends MapElement> elementType, DBaseFileReader dbase_importer, ShapeFileIndexReader shxReader, URL dBaseAttributeSource)
Create a reader of shapes from specified file.GISShapeFileReader(File file, Class<? extends MapElement> elementType, ShapeFileIndexReader shxReader)
Create a reader of shapes from specified file.GISShapeFileReader(File file, DBaseFileReader dbase_importer)
Create a reader of shapes from specified file.GISShapeFileReader(File file, DBaseFileReader dbase_importer, URL dBaseAttributeSource)
Create a reader of shapes from specified file.GISShapeFileReader(File file, DBaseFileReader dbase_importer, ShapeFileIndexReader shxReader)
Create a reader of shapes from specified file.GISShapeFileReader(File file, DBaseFileReader dbase_importer, ShapeFileIndexReader shxReader, URL dBaseAttributeSource)
Create a reader of shapes from specified file.GISShapeFileReader(File file, ShapeFileIndexReader shxReader)
Create a reader of shapes from specified file.GISShapeFileReader(InputStream stream)
Create a reader of shapes from specified channel.GISShapeFileReader(InputStream stream, Class<? extends MapElement> elementType)
Create a reader of shapes from specified channel.GISShapeFileReader(InputStream stream, Class<? extends MapElement> elementType, DBaseFileReader dbase_importer)
Create a reader of shapes from specified channel.GISShapeFileReader(InputStream stream, Class<? extends MapElement> elementType, DBaseFileReader dbase_importer, URL dBaseAttributeSource)
Create a reader of shapes from specified channel.GISShapeFileReader(InputStream stream, Class<? extends MapElement> elementType, DBaseFileReader dbase_importer, ShapeFileIndexReader shxReader)
Create a reader of shapes from specified channel.GISShapeFileReader(InputStream stream, Class<? extends MapElement> elementType, DBaseFileReader dbase_importer, ShapeFileIndexReader shxReader, URL dBaseAttributeSource)
Create a reader of shapes from specified input stream.GISShapeFileReader(InputStream stream, Class<? extends MapElement> elementType, ShapeFileIndexReader shxReader)
Create a reader of shapes from specified channel.GISShapeFileReader(InputStream stream, DBaseFileReader dbase_importer)
Create a reader of shapes from specified channel.GISShapeFileReader(InputStream stream, DBaseFileReader dbase_importer, URL dBaseAttributeSource)
Create a reader of shapes from specified channel.GISShapeFileReader(InputStream stream, DBaseFileReader dbase_importer, ShapeFileIndexReader shxReader)
Create a reader of shapes from specified channel.GISShapeFileReader(InputStream stream, DBaseFileReader dbase_importer, ShapeFileIndexReader shxReader, URL dBaseAttributeSource)
Create a reader of shapes from specified channel.GISShapeFileReader(InputStream stream, ShapeFileIndexReader shxReader)
Create a reader of shapes from specified channel.GISShapeFileReader(URL url)
Create a reader of shapes from specified URL.GISShapeFileReader(URL url, Class<? extends MapElement> elementType)
Create a reader of shapes from specified URL.GISShapeFileReader(URL url, Class<? extends MapElement> elementType, DBaseFileReader dbase_importer)
Create a reader of shapes from specified URL.GISShapeFileReader(URL url, Class<? extends MapElement> elementType, DBaseFileReader dbase_importer, URL dBaseAttributeSource)
Create a reader of shapes from specified URL.GISShapeFileReader(URL url, Class<? extends MapElement> elementType, DBaseFileReader dbase_importer, ShapeFileIndexReader shxReader)
Create a reader of shapes from specified URL.GISShapeFileReader(URL url, Class<? extends MapElement> elementType, DBaseFileReader dbase_importer, ShapeFileIndexReader shxReader, URL dBaseAttributeSource)
Create a reader of shapes from specified URL.GISShapeFileReader(URL url, Class<? extends MapElement> elementType, ShapeFileIndexReader shxReader)
Create a reader of shapes from specified URL.GISShapeFileReader(URL url, DBaseFileReader dbase_importer)
Create a reader of shapes from specified URL.GISShapeFileReader(URL url, DBaseFileReader dbase_importer, URL dBaseAttributeSource)
Create a reader of shapes from specified URL.GISShapeFileReader(URL url, DBaseFileReader dbase_importer, ShapeFileIndexReader shxReader)
Create a reader of shapes from specified URL.GISShapeFileReader(URL url, DBaseFileReader dbase_importer, ShapeFileIndexReader shxReader, URL dBaseAttributeSource)
Create a reader of shapes from specified URL.GISShapeFileReader(URL url, ShapeFileIndexReader shxReader)
Create a reader of shapes from specified URL.GISShapeFileReader(ReadableByteChannel channel)
Create a reader of shapes from specified channel.GISShapeFileReader(ReadableByteChannel channel, Class<? extends MapElement> elementType)
Create a reader of shapes from specified channel.GISShapeFileReader(ReadableByteChannel channel, Class<? extends MapElement> elementType, DBaseFileReader dbase_importer)
Create a reader of shapes from specified channel.GISShapeFileReader(ReadableByteChannel channel, Class<? extends MapElement> elementType, DBaseFileReader dbase_importer, URL dBaseAttributeSource)
Create a reader of shapes from specified channel.GISShapeFileReader(ReadableByteChannel channel, Class<? extends MapElement> elementType, DBaseFileReader dbase_importer, ShapeFileIndexReader shxReader)
Create a reader of shapes from specified channel.GISShapeFileReader(ReadableByteChannel channel, Class<? extends MapElement> elementType, DBaseFileReader dbase_importer, ShapeFileIndexReader shxReader, URL dBaseAttributeSource)
Create a reader of shapes from specified channel.GISShapeFileReader(ReadableByteChannel channel, Class<? extends MapElement> elementType, ShapeFileIndexReader shxReader)
Create a reader of shapes from specified channel.GISShapeFileReader(ReadableByteChannel channel, DBaseFileReader dbase_importer)
Create a reader of shapes from specified channel.GISShapeFileReader(ReadableByteChannel channel, DBaseFileReader dbase_importer, URL dBaseAttributeSource)
Create a reader of shapes from specified channel.GISShapeFileReader(ReadableByteChannel channel, DBaseFileReader dbase_importer, ShapeFileIndexReader shxReader)
Create a reader of shapes from specified channel.GISShapeFileReader(ReadableByteChannel channel, DBaseFileReader dbase_importer, ShapeFileIndexReader shxReader, URL dBaseAttributeSource)
Create a reader of shapes from specified channel.GISShapeFileReader(ReadableByteChannel channel, ShapeFileIndexReader shxReader)
Create a reader of shapes from specified channel.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description protected AttributeCollection
createAttributeCollection(int elementIndex)
Create an attribute provider which will be used by a new element.protected MapElement
createMultiPatch(AttributeCollection provider, int shapeIndex, int[] parts, ShapeMultiPatchType[] partTypes, ESRIPoint[] points)
Create a multipatch.protected MapElement
createMultiPoint(AttributeCollection provider, int shapeIndex, ESRIPoint[] points, boolean hasZ)
Create a multipoint.protected MapElement
createPoint(AttributeCollection provider, int shape_index, ESRIPoint point)
Create a point instance.protected MapElement
createPolygon(AttributeCollection provider, int shapeIndex, int[] parts, ESRIPoint[] points, boolean hasZ)
Create a polygon.protected MapElement
createPolyline(AttributeCollection provider, int shapeIndex, int[] parts, ESRIPoint[] points, boolean hasZ)
Create a polyline.protected static UUID
extractUUID(AttributeProvider provider)
Extract the UUID from the attributes.static Class<? extends MapElement>
fromESRI(ShapeElementType type)
Replies the type of map element which is corresponding to the given ESRI type.Class<? extends MapElement>
getMapElementType()
Replies the type of map element replied by this reader.MapMetricProjection
getMapMetricProjection()
Replies the map metric projection used by the coordinates in the source file.protected void
putAttributeIn(MapElement element, String attributeName, AttributeValue value)
Invoked to put an attribute in the element.void
setMapElementType(Class<? extends MapElement> type)
Replies the type of map element replied by this reader.void
setMapMetricProjection(MapMetricProjection projection)
Set the map metric projection used by the coordinates in the source file.-
Methods inherited from class org.arakhne.afc.io.shape.AbstractShapeFileReader
close, isSeekEnabled, postAttributeReadingStage, postHeaderReadingStage, postShapeReadingStage, readRecord, seek
-
Methods inherited from class org.arakhne.afc.io.shape.AbstractCommonShapeFileReader
disableSeek, ensureAvailableBytes, getBoundsFromHeader, getFileReadingPosition, getFileSize, getShapeElementType, getTaskProgression, isHeaderRead, iterator, iterator, iterator, iterator, postReadingStage, postRecordReadingStage, preReadingStage, read, readBEDouble, readBEInt, readHeader, readLEDouble, readLEInt, setReadingPosition, setTaskProgression, skipBytes
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface java.lang.Iterable
forEach, spliterator
-
-
-
-
Constructor Detail
-
GISShapeFileReader
public GISShapeFileReader(InputStream stream) throws IOException
Create a reader of shapes from specified channel.- Parameters:
stream
- is the input stream to read from.- Throws:
IOException
- in case of error.
-
GISShapeFileReader
public GISShapeFileReader(InputStream stream, DBaseFileReader dbase_importer) throws IOException
Create a reader of shapes from specified channel.- Parameters:
stream
- is the input stream to read from.dbase_importer
- is the dBase reader to use to read the attribute's values.- Throws:
IOException
- in case of error.
-
GISShapeFileReader
public GISShapeFileReader(InputStream stream, DBaseFileReader dbase_importer, URL dBaseAttributeSource) throws IOException
Create a reader of shapes from specified channel.- Parameters:
stream
- is the input stream to read from.dbase_importer
- is the dBase reader to use to read the attribute's values.dBaseAttributeSource
- is the URL of the dBASE file to create a dBASE-based attribute provider.- Throws:
IOException
- in case of error.
-
GISShapeFileReader
public GISShapeFileReader(InputStream stream, ShapeFileIndexReader shxReader) throws IOException
Create a reader of shapes from specified channel.- Parameters:
stream
- is the input stream to read from.shxReader
- is the shape file index reader used to access to the shape file record indexes.- Throws:
IOException
- in case of error.
-
GISShapeFileReader
public GISShapeFileReader(InputStream stream, DBaseFileReader dbase_importer, ShapeFileIndexReader shxReader) throws IOException
Create a reader of shapes from specified channel.- Parameters:
stream
- is the input stream to read from.dbase_importer
- is the dBASE reader to use to read the attribute's values.shxReader
- is the shape file index reader used to access to the shape file record indexes.- Throws:
IOException
- in case of error.
-
GISShapeFileReader
public GISShapeFileReader(InputStream stream, DBaseFileReader dbase_importer, ShapeFileIndexReader shxReader, URL dBaseAttributeSource) throws IOException
Create a reader of shapes from specified channel.- Parameters:
stream
- is the input stream to read from.dbase_importer
- is the dBASE reader to use to read the attribute's values.shxReader
- is the shape file index reader used to access to the shape file record indexes.dBaseAttributeSource
- is the URL of the dBASE file to create a dBASE-based attribute provider.- Throws:
IOException
- in case of error.
-
GISShapeFileReader
public GISShapeFileReader(InputStream stream, Class<? extends MapElement> elementType) throws IOException
Create a reader of shapes from specified channel.- Parameters:
stream
- is the input stream to read from.elementType
- is the type of the elements to create.- Throws:
IOException
- in case of error.
-
GISShapeFileReader
public GISShapeFileReader(InputStream stream, Class<? extends MapElement> elementType, DBaseFileReader dbase_importer) throws IOException
Create a reader of shapes from specified channel.- Parameters:
stream
- is the input stream to read from.elementType
- is the type of the elements to create.dbase_importer
- is the dBASE reader to use to read the attribute's values.- Throws:
IOException
- in case of error.
-
GISShapeFileReader
public GISShapeFileReader(InputStream stream, Class<? extends MapElement> elementType, DBaseFileReader dbase_importer, URL dBaseAttributeSource) throws IOException
Create a reader of shapes from specified channel.- Parameters:
stream
- is the input stream to read from.elementType
- is the type of the elements to create.dbase_importer
- is the dBASE reader to use to read the attribute's values.dBaseAttributeSource
- is the URL of the dBASE file to create a dBASE-based attribute provider.- Throws:
IOException
- in case of error.
-
GISShapeFileReader
public GISShapeFileReader(InputStream stream, Class<? extends MapElement> elementType, ShapeFileIndexReader shxReader) throws IOException
Create a reader of shapes from specified channel.- Parameters:
stream
- is the input stream to read from.elementType
- is the type of the elements to create.shxReader
- is the shape file index reader used to access to the shape file record indexes.- Throws:
IOException
- in case of error.
-
GISShapeFileReader
public GISShapeFileReader(InputStream stream, Class<? extends MapElement> elementType, DBaseFileReader dbase_importer, ShapeFileIndexReader shxReader) throws IOException
Create a reader of shapes from specified channel.- Parameters:
stream
- is the input stream to read from.elementType
- is the type of the elements to create.dbase_importer
- is the dBASE reader to use to read the attribute's values.shxReader
- is the shape file index reader used to access to the shape file record indexes.- Throws:
IOException
- in case of error.
-
GISShapeFileReader
public GISShapeFileReader(InputStream stream, Class<? extends MapElement> elementType, DBaseFileReader dbase_importer, ShapeFileIndexReader shxReader, URL dBaseAttributeSource) throws IOException
Create a reader of shapes from specified input stream.- Parameters:
stream
- is the input stream to read from.elementType
- is the type of the elements to create.dbase_importer
- is the dBASE reader to use to read the attribute's values.shxReader
- is the shape file index reader used to access to the shape file record indexes.dBaseAttributeSource
- is the URL of the dBASE file to create a dBASE-based attribute provider.- Throws:
IOException
- in case of error.
-
GISShapeFileReader
public GISShapeFileReader(ReadableByteChannel channel) throws IOException
Create a reader of shapes from specified channel.- Parameters:
channel
- is the channel to read from.- Throws:
IOException
- in case of error.
-
GISShapeFileReader
public GISShapeFileReader(ReadableByteChannel channel, DBaseFileReader dbase_importer) throws IOException
Create a reader of shapes from specified channel.- Parameters:
channel
- is the channel to read from.dbase_importer
- is the dBase reader to use to read the attribute's values.- Throws:
IOException
- in case of error.
-
GISShapeFileReader
public GISShapeFileReader(ReadableByteChannel channel, DBaseFileReader dbase_importer, URL dBaseAttributeSource) throws IOException
Create a reader of shapes from specified channel.- Parameters:
channel
- is the channel to read from.dbase_importer
- is the dBase reader to use to read the attribute's values.dBaseAttributeSource
- is the URL of the dBASE file to create a dBASE-based attribute provider.- Throws:
IOException
- in case of error.
-
GISShapeFileReader
public GISShapeFileReader(ReadableByteChannel channel, ShapeFileIndexReader shxReader) throws IOException
Create a reader of shapes from specified channel.- Parameters:
channel
- is the channel to read from.shxReader
- is the shape file index reader used to access to the shape file record indexes.- Throws:
IOException
- in case of error.
-
GISShapeFileReader
public GISShapeFileReader(ReadableByteChannel channel, DBaseFileReader dbase_importer, ShapeFileIndexReader shxReader) throws IOException
Create a reader of shapes from specified channel.- Parameters:
channel
- is the channel to read from.dbase_importer
- is the dBASE reader to use to read the attribute's values.shxReader
- is the shape file index reader used to access to the shape file record indexes.- Throws:
IOException
- in case of error.
-
GISShapeFileReader
public GISShapeFileReader(ReadableByteChannel channel, DBaseFileReader dbase_importer, ShapeFileIndexReader shxReader, URL dBaseAttributeSource) throws IOException
Create a reader of shapes from specified channel.- Parameters:
channel
- is the channel to read from.dbase_importer
- is the dBASE reader to use to read the attribute's values.shxReader
- is the shape file index reader used to access to the shape file record indexes.dBaseAttributeSource
- is the URL of the dBASE file to create a dBASE-based attribute provider.- Throws:
IOException
- in case of error.
-
GISShapeFileReader
public GISShapeFileReader(ReadableByteChannel channel, Class<? extends MapElement> elementType) throws IOException
Create a reader of shapes from specified channel.- Parameters:
channel
- is the channel to read from.elementType
- is the type of the elements to create.- Throws:
IOException
- in case of error.
-
GISShapeFileReader
public GISShapeFileReader(ReadableByteChannel channel, Class<? extends MapElement> elementType, DBaseFileReader dbase_importer) throws IOException
Create a reader of shapes from specified channel.- Parameters:
channel
- is the channel to read from.elementType
- is the type of the elements to create.dbase_importer
- is the dBASE reader to use to read the attribute's values.- Throws:
IOException
- in case of error.
-
GISShapeFileReader
public GISShapeFileReader(ReadableByteChannel channel, Class<? extends MapElement> elementType, DBaseFileReader dbase_importer, URL dBaseAttributeSource) throws IOException
Create a reader of shapes from specified channel.- Parameters:
channel
- is the channel to read from.elementType
- is the type of the elements to create.dbase_importer
- is the dBASE reader to use to read the attribute's values.dBaseAttributeSource
- is the URL of the dBASE file to create a dBASE-based attribute provider.- Throws:
IOException
- in case of error.
-
GISShapeFileReader
public GISShapeFileReader(ReadableByteChannel channel, Class<? extends MapElement> elementType, ShapeFileIndexReader shxReader) throws IOException
Create a reader of shapes from specified channel.- Parameters:
channel
- is the channel to read from.elementType
- is the type of the elements to create.shxReader
- is the shape file index reader used to access to the shape file record indexes.- Throws:
IOException
- in case of error.
-
GISShapeFileReader
public GISShapeFileReader(ReadableByteChannel channel, Class<? extends MapElement> elementType, DBaseFileReader dbase_importer, ShapeFileIndexReader shxReader) throws IOException
Create a reader of shapes from specified channel.- Parameters:
channel
- is the channel to read from.elementType
- is the type of the elements to create.dbase_importer
- is the dBASE reader to use to read the attribute's values.shxReader
- is the shape file index reader used to access to the shape file record indexes.- Throws:
IOException
- in case of error.
-
GISShapeFileReader
public GISShapeFileReader(ReadableByteChannel channel, Class<? extends MapElement> elementType, DBaseFileReader dbase_importer, ShapeFileIndexReader shxReader, URL dBaseAttributeSource) throws IOException
Create a reader of shapes from specified channel.- Parameters:
channel
- is the channel to read from.elementType
- is the type of the elements to create.dbase_importer
- is the dBASE reader to use to read the attribute's values.shxReader
- is the shape file index reader used to access to the shape file record indexes.dBaseAttributeSource
- is the URL of the dBASE file to create a dBASE-based attribute provider.- Throws:
IOException
- in case of error.
-
GISShapeFileReader
public GISShapeFileReader(File file) throws IOException
Create a reader of shapes from specified file.- Parameters:
file
- is the file of the stream to read.- Throws:
IOException
- in case of error.
-
GISShapeFileReader
public GISShapeFileReader(File file, DBaseFileReader dbase_importer) throws IOException
Create a reader of shapes from specified file.- Parameters:
file
- is the file of the stream to read.dbase_importer
- is the dBase reader to use to read the attribute's values.- Throws:
IOException
- in case of error.
-
GISShapeFileReader
public GISShapeFileReader(File file, DBaseFileReader dbase_importer, URL dBaseAttributeSource) throws IOException
Create a reader of shapes from specified file.- Parameters:
file
- is the file of the stream to read.dbase_importer
- is the dBase reader to use to read the attribute's values.dBaseAttributeSource
- is the URL of the dBASE file to create a dBASE-based attribute provider.- Throws:
IOException
- in case of error.
-
GISShapeFileReader
public GISShapeFileReader(File file, ShapeFileIndexReader shxReader) throws IOException
Create a reader of shapes from specified file.- Parameters:
file
- is the file of the stream to read.shxReader
- is the shape file index reader used to access to the shape file record indexes.- Throws:
IOException
- in case of error.
-
GISShapeFileReader
public GISShapeFileReader(File file, DBaseFileReader dbase_importer, ShapeFileIndexReader shxReader) throws IOException
Create a reader of shapes from specified file.- Parameters:
file
- is the file of the stream to read.dbase_importer
- is the dBASE reader to use to read the attribute's values.shxReader
- is the shape file index reader used to access to the shape file record indexes.- Throws:
IOException
- in case of error.
-
GISShapeFileReader
public GISShapeFileReader(File file, DBaseFileReader dbase_importer, ShapeFileIndexReader shxReader, URL dBaseAttributeSource) throws IOException
Create a reader of shapes from specified file.- Parameters:
file
- is the file of the stream to read.dbase_importer
- is the dBASE reader to use to read the attribute's values.shxReader
- is the shape file index reader used to access to the shape file record indexes.dBaseAttributeSource
- is the URL of the dBASE file to create a dBASE-based attribute provider.- Throws:
IOException
- in case of error.
-
GISShapeFileReader
public GISShapeFileReader(File file, Class<? extends MapElement> elementType) throws IOException
Create a reader of shapes from specified file.- Parameters:
file
- is the file of the stream to read.elementType
- is the type of the elements to create.- Throws:
IOException
- in case of error.
-
GISShapeFileReader
public GISShapeFileReader(File file, Class<? extends MapElement> elementType, DBaseFileReader dbase_importer) throws IOException
Create a reader of shapes from specified file.- Parameters:
file
- is the file of the stream to read.elementType
- is the type of the elements to create.dbase_importer
- is the dBASE reader to use to read the attribute's values.- Throws:
IOException
- in case of error.
-
GISShapeFileReader
public GISShapeFileReader(File file, Class<? extends MapElement> elementType, DBaseFileReader dbase_importer, URL dBaseAttributeSource) throws IOException
Create a reader of shapes from specified file.- Parameters:
file
- is the file of the stream to read.elementType
- is the type of the elements to create.dbase_importer
- is the dBASE reader to use to read the attribute's values.dBaseAttributeSource
- is the URL of the dBASE file to create a dBASE-based attribute provider.- Throws:
IOException
- in case of error.
-
GISShapeFileReader
public GISShapeFileReader(File file, Class<? extends MapElement> elementType, ShapeFileIndexReader shxReader) throws IOException
Create a reader of shapes from specified file.- Parameters:
file
- is the file of the stream to read.elementType
- is the type of the elements to create.shxReader
- is the shape file index reader used to access to the shape file record indexes.- Throws:
IOException
- in case of error.
-
GISShapeFileReader
public GISShapeFileReader(File file, Class<? extends MapElement> elementType, DBaseFileReader dbase_importer, ShapeFileIndexReader shxReader) throws IOException
Create a reader of shapes from specified file.- Parameters:
file
- is the file of the stream to read.elementType
- is the type of the elements to create.dbase_importer
- is the dBASE reader to use to read the attribute's values.shxReader
- is the shape file index reader used to access to the shape file record indexes.- Throws:
IOException
- in case of error.
-
GISShapeFileReader
public GISShapeFileReader(File file, Class<? extends MapElement> elementType, DBaseFileReader dbase_importer, ShapeFileIndexReader shxReader, URL dBaseAttributeSource) throws IOException
Create a reader of shapes from specified file.- Parameters:
file
- is the file of the stream to read.elementType
- is the type of the elements to create.dbase_importer
- is the dBASE reader to use to read the attribute's values.shxReader
- is the shape file index reader used to access to the shape file record indexes.dBaseAttributeSource
- is the URL of the dBASE file to create a dBASE-based attribute provider.- Throws:
IOException
- in case of error.
-
GISShapeFileReader
public GISShapeFileReader(URL url) throws IOException
Create a reader of shapes from specified URL.- Parameters:
url
- is the url of the stream to read.- Throws:
IOException
- in case of error.
-
GISShapeFileReader
public GISShapeFileReader(URL url, DBaseFileReader dbase_importer) throws IOException
Create a reader of shapes from specified URL.- Parameters:
url
- is the url of the stream to read.dbase_importer
- is the dBASE reader to use to read the attribute's values.- Throws:
IOException
- in case of error.
-
GISShapeFileReader
public GISShapeFileReader(URL url, DBaseFileReader dbase_importer, URL dBaseAttributeSource) throws IOException
Create a reader of shapes from specified URL.- Parameters:
url
- is the url of the stream to read.dbase_importer
- is the dBASE reader to use to read the attribute's values.dBaseAttributeSource
- is the URL of the dBASE file to create a dBASE-based attribute provider.- Throws:
IOException
- in case of error.
-
GISShapeFileReader
public GISShapeFileReader(URL url, ShapeFileIndexReader shxReader) throws IOException
Create a reader of shapes from specified URL.- Parameters:
url
- is the url of the stream to read.shxReader
- is the shape file index reader used to access to the shape file record indexes.- Throws:
IOException
- in case of error.
-
GISShapeFileReader
public GISShapeFileReader(URL url, DBaseFileReader dbase_importer, ShapeFileIndexReader shxReader) throws IOException
Create a reader of shapes from specified URL.- Parameters:
url
- is the url of the stream to read.dbase_importer
- is the dBASE reader to use to read the attribute's values.shxReader
- is the shape file index reader used to access to the shape file record indexes.- Throws:
IOException
- in case of error.
-
GISShapeFileReader
public GISShapeFileReader(URL url, DBaseFileReader dbase_importer, ShapeFileIndexReader shxReader, URL dBaseAttributeSource) throws IOException
Create a reader of shapes from specified URL.- Parameters:
url
- is the url of the stream to read.dbase_importer
- is the dBASE reader to use to read the attribute's values.shxReader
- is the shape file index reader used to access to the shape file record indexes.dBaseAttributeSource
- is the URL of the dBASE file to create a dBASE-based attribute provider.- Throws:
IOException
- in case of error.
-
GISShapeFileReader
public GISShapeFileReader(URL url, Class<? extends MapElement> elementType) throws IOException
Create a reader of shapes from specified URL.- Parameters:
url
- is the url of the stream to read.elementType
- is the type of the elements to create.- Throws:
IOException
- in case of error.
-
GISShapeFileReader
public GISShapeFileReader(URL url, Class<? extends MapElement> elementType, DBaseFileReader dbase_importer) throws IOException
Create a reader of shapes from specified URL.- Parameters:
url
- is the url of the stream to read.elementType
- is the type of the elements to create.dbase_importer
- is the dBASE reader to use to read the attribute's values.- Throws:
IOException
- in case of error.
-
GISShapeFileReader
public GISShapeFileReader(URL url, Class<? extends MapElement> elementType, DBaseFileReader dbase_importer, URL dBaseAttributeSource) throws IOException
Create a reader of shapes from specified URL.- Parameters:
url
- is the url of the stream to read.elementType
- is the type of the elements to create.dbase_importer
- is the dBASE reader to use to read the attribute's values.dBaseAttributeSource
- is the URL of the dBASE file to create a dBASE-based attribute provider.- Throws:
IOException
- in case of error.
-
GISShapeFileReader
public GISShapeFileReader(URL url, Class<? extends MapElement> elementType, ShapeFileIndexReader shxReader) throws IOException
Create a reader of shapes from specified URL.- Parameters:
url
- is the url of the stream to read.elementType
- is the type of the elements to create.shxReader
- is the shape file index reader used to access to the shape file record indexes.- Throws:
IOException
- in case of error.
-
GISShapeFileReader
public GISShapeFileReader(URL url, Class<? extends MapElement> elementType, DBaseFileReader dbase_importer, ShapeFileIndexReader shxReader) throws IOException
Create a reader of shapes from specified URL.- Parameters:
url
- is the url of the stream to read.elementType
- is the type of the elements to create.dbase_importer
- is the dBASE reader to use to read the attribute's values.shxReader
- is the shape file index reader used to access to the shape file record indexes.- Throws:
IOException
- in case of error.
-
GISShapeFileReader
public GISShapeFileReader(URL url, Class<? extends MapElement> elementType, DBaseFileReader dbase_importer, ShapeFileIndexReader shxReader, URL dBaseAttributeSource) throws IOException
Create a reader of shapes from specified URL.- Parameters:
url
- is the url of the stream to read.elementType
- is the type of the elements to create.dbase_importer
- is the dBASE reader to use to read the attribute's values.shxReader
- is the shape file index reader used to access to the shape file record indexes.dBaseAttributeSource
- is the URL of the dBASE file to create a dBASE-based attribute provider.- Throws:
IOException
- in case of error.
-
-
Method Detail
-
fromESRI
@Pure public static Class<? extends MapElement> fromESRI(ShapeElementType type)
Replies the type of map element which is corresponding to the given ESRI type.- Parameters:
type
- the type of element.- Returns:
- the type of map element.
- Throws:
IllegalArgumentException
- if the given type is not supported by the I/O API.- Since:
- 4.0
-
getMapElementType
@Pure public Class<? extends MapElement> getMapElementType()
Replies the type of map element replied by this reader.This function retrieve the element type from the header with
AbstractCommonShapeFileReader.getShapeElementType()
and matches it to the GIS API withfromESRI(ShapeElementType)
.- Returns:
- the type of map element; or
null
if unsupported. - Since:
- 4.0
-
setMapElementType
public void setMapElementType(Class<? extends MapElement> type)
Replies the type of map element replied by this reader.This function retrieve the element type from the header with
AbstractCommonShapeFileReader.getShapeElementType()
and matches it to the GIS API withfromESRI(ShapeElementType)
.- Parameters:
type
- the type of map element; ornull
to use the type within the shape file header.- Since:
- 15.0
-
extractUUID
protected static UUID extractUUID(AttributeProvider provider)
Extract the UUID from the attributes.- Parameters:
provider
- is a provider of attributes- Returns:
- the uuid if found or
null
if none.
-
createAttributeCollection
protected AttributeCollection createAttributeCollection(int elementIndex)
Description copied from class:AbstractShapeFileReader
Create an attribute provider which will be used by a new element.- Specified by:
createAttributeCollection
in classAbstractShapeFileReader<MapElement>
- Parameters:
elementIndex
- is the index of the element for which an attribute provider must be created.- Returns:
- the new attribute provider which will be passed to one of the creation functions.
- See Also:
AbstractShapeFileReader.createMultiPoint(AttributeCollection, int, ESRIPoint[], boolean)
,AbstractShapeFileReader.createPoint(AttributeCollection, int, ESRIPoint)
,AbstractShapeFileReader.createPolygon(AttributeCollection, int, int[], ESRIPoint[], boolean)
,AbstractShapeFileReader.createPolyline(AttributeCollection, int, int[], ESRIPoint[], boolean)
-
createMultiPoint
protected MapElement createMultiPoint(AttributeCollection provider, int shapeIndex, ESRIPoint[] points, boolean hasZ)
Description copied from class:AbstractShapeFileReader
Create a multipoint.- Specified by:
createMultiPoint
in classAbstractShapeFileReader<MapElement>
- Parameters:
provider
- is the attribute provider which must be used by the new element.shapeIndex
- is the index of the element in the shape file.points
- is the list of the points.hasZ
- indicates if the z-coordinates were set.- Returns:
- an object representing the creating element, depending of your implementation.
This value will be passed to
AbstractCommonShapeFileReader.postRecordReadingStage(Object)
.
-
createPoint
protected MapElement createPoint(AttributeCollection provider, int shape_index, ESRIPoint point)
Description copied from class:AbstractShapeFileReader
Create a point instance.- Specified by:
createPoint
in classAbstractShapeFileReader<MapElement>
- Parameters:
provider
- is the attribute provider which must be used by the new element.shape_index
- is the index of the element in the shape file.point
- is the location of the point.- Returns:
- an object representing the creating point, depending of your implementation.
This value will be passed to
AbstractCommonShapeFileReader.postRecordReadingStage(Object)
.
-
createPolygon
protected MapElement createPolygon(AttributeCollection provider, int shapeIndex, int[] parts, ESRIPoint[] points, boolean hasZ)
Description copied from class:AbstractShapeFileReader
Create a polygon.- Specified by:
createPolygon
in classAbstractShapeFileReader<MapElement>
- Parameters:
provider
- is the attribute provider which must be used by the new element.shapeIndex
- is the index of the element in the shape file.parts
- is the list of the parts, ie the index of the first point in the parts.points
- is the list of the points.hasZ
- indicates if the z-coordinates were set.- Returns:
- an object representing the creating element, depending of your implementation.
This value will be passed to
AbstractCommonShapeFileReader.postRecordReadingStage(Object)
.
-
createPolyline
protected MapElement createPolyline(AttributeCollection provider, int shapeIndex, int[] parts, ESRIPoint[] points, boolean hasZ)
Description copied from class:AbstractShapeFileReader
Create a polyline.- Specified by:
createPolyline
in classAbstractShapeFileReader<MapElement>
- Parameters:
provider
- is the attribute provider which must be used by the new element.shapeIndex
- is the index of the element in the shape file.parts
- is the list of the parts, ie the index of the first point in the parts.points
- is the list of the points.hasZ
- indicates if the z-coordinates were set.- Returns:
- an object representing the creating element, depending of your implementation.
This value will be passed to
AbstractCommonShapeFileReader.postRecordReadingStage(Object)
.
-
createMultiPatch
protected MapElement createMultiPatch(AttributeCollection provider, int shapeIndex, int[] parts, ShapeMultiPatchType[] partTypes, ESRIPoint[] points)
Description copied from class:AbstractShapeFileReader
Create a multipatch.A MultiPatch consists of a number of surface patches. Each surface patch describes a surface. The surface patches of a MultiPatch are referred to as its parts, and the type of part controls how the order of vertices of an MultiPatch part is interpreted.
A single Triangle Strip, or Triangle Fan, represents a single surface patch.
A sequence of parts that are rings can describe a polygonal surface patch with holes. The sequence typically consists of an Outer Ring, representing the outer boundary of the patch, followed by a number of Inner Rings representing holes. When the individual types of rings in a collection of rings representing a polygonal patch with holes are unknown, the sequence must start with First Ring, followed by a number of Rings. A sequence of Rings not preceded by an First Ring is treated as a sequence of Outer Rings without holes.
- Specified by:
createMultiPatch
in classAbstractShapeFileReader<MapElement>
- Parameters:
provider
- is the attribute provider which must be used by the new element.shapeIndex
- is the index of the element in the shape file.parts
- is the list of the parts, ie the index of the first point in the parts.partTypes
- is the list of the types of the parts.points
- is the list of the points.- Returns:
- an object representing the creating multipatch, depending of your implementation.
This value will be passed to
AbstractCommonShapeFileReader.postRecordReadingStage(Object)
.
-
putAttributeIn
protected void putAttributeIn(MapElement element, String attributeName, AttributeValue value)
Description copied from class:AbstractShapeFileReader
Invoked to put an attribute in the element.- Specified by:
putAttributeIn
in classAbstractShapeFileReader<MapElement>
- Parameters:
element
- is the element in which the attribute should be put.attributeName
- is the name of the attribute.value
- is the value of the attribute.
-
setMapMetricProjection
public void setMapMetricProjection(MapMetricProjection projection)
Set the map metric projection used by the coordinates in the source file.- Parameters:
projection
- is the map metric projection in the source file.- Since:
- 4.1
-
getMapMetricProjection
@Pure public MapMetricProjection getMapMetricProjection()
Replies the map metric projection used by the coordinates in the source file.- Returns:
- the map metric projection in the source file.
- Since:
- 4.1
-
-