Rogue Wave Views |
Rogue Wave Views Documentation Home |
This class reads geometries from .shp
files.
More...
#include <ilviews/maps/format/shapefile/shpreader.h>
Public Member Functions | |
IlvShapeSHPReader (const char *fileName, const char *shxName=0) | |
Initializes an IlvShapeSHPReader to read from the Shapefile file whose name is specified. You can also specify an index (.shx ) file name if you want to perform random access on geometries through the getFeatureAt method. More... | |
IlvShapeSHPReader (IL_STDPREF istream &stream) | |
Initializes an IlvShapeSHPReader to read from the specified input stream. More... | |
IlvShapeSHPReader (IL_STDPREF istream &shpStream, IL_STDPREF istream &shxStream) | |
Initializes an IlvShapeSHPReader to read from the specified input streams. With this constructor, in addition to the stream opened on a Shapefile file, you can specify a stream opened on an index file (.shx ) in order to perform random access on geometries through the getFeatureAt method. More... | |
IlvFeatureRenderer * | getDefaultFeatureRenderer (IlvDisplay *display) |
Returns the default renderer for this feature iterator. More... | |
virtual const IlvMapFeature * | getFeatureAt (IlInt index, IlvMapsError &status) |
Returns the feature located at the specified index. More... | |
const IlvFeatureAttributeInfo * | getFeatureAttributeInfo (IlvMapsError &status) const |
Returns the description of the attributes that are generated by the shape reader. More... | |
IlvMapsError | getInitStatus () const |
Checks the initialization status of this reader. More... | |
IlBoolean | getLowerRightCorner (IlvCoordinate &result) const |
Returns the lower right corner of the rectangle containing all the map features of this iterator. More... | |
IlvMapInput * | getMapInput () |
Returns the map input of this reader. | |
const IlvMapFeature * | getNextFeature (IlvMapsError &status) |
Returns the next available feature. More... | |
virtual IlvMapFeatureId * | getNextFeatureId (IlvMapsError &status) |
virtual IlInt | getNextFeatureIndex () |
Returns the index of the next feature that is read. More... | |
const IlvProjection * | getProjection () const |
Returns the projection of geometries of this feature iterator. More... | |
IlvShapeFileIndex * | getShapeFileIndex () |
Returns the Shapefile index reader. More... | |
IlvShapeType | getShapeType () const |
Returns the shape type of the objects contained in the file. More... | |
IlBoolean | getUpperLeftCorner (IlvCoordinate &result) const |
Returns the upper left corner of the rectangle containing all the map features of this iterator. More... | |
virtual void | setNextFeatureIndex (IlInt index) |
Sets the index of the next feature that is read. | |
void | setSourceProjection (IlvProjection *projection) |
Sets the projection of geometries generated by this feature iterator. This method is to be used when feature source is not georeferenced. More... | |
virtual IlBoolean | skipNextFeature (IlvMapsError &status) |
Skips the next feature available from this feature iterator. | |
Public Member Functions inherited from IlvLookAheadFeatureIterator | |
virtual | ~IlvLookAheadFeatureIterator () |
Destructor. | |
Public Member Functions inherited from IlvMapFeatureIterator | |
virtual IlvClassInfo * | getClassInfo () const =0 |
Returns the class information for this feature iterator. More... | |
Protected Member Functions | |
IlvMapInput & | getInput () |
Returns the map input of this reader. | |
virtual IlvMapFeature * | readMultiPointMShape (IlvMapsError &status) |
Reads a MULTIPOINTM from the Shapefile. More... | |
virtual IlvMapFeature * | readMultiPointShape (IlvMapsError &status) |
Reads a MULTIPOINT from the Shapefile. More... | |
virtual IlvMapFeature * | readMultiPointZShape (IlvMapsError &status) |
Reads a MULTIPOINTZ from the Shapefile. More... | |
virtual IlvMapFeature * | readPointMShape (IlvMapsError &status) |
Reads a POINTM shape. More... | |
virtual IlvMapFeature * | readPointShape (IlvMapsError &status) |
Reads a POINT shape. More... | |
virtual IlvMapFeature * | readPointZShape (IlvMapsError &status) |
Reads a POINTZ shape. More... | |
virtual IlvMapFeature * | readPolygonMShape (IlvMapsError &status) |
Reads a POLYGONM from the Shapefile. More... | |
virtual IlvMapFeature * | readPolygonShape (IlvMapsError &status) |
Reads a POLYGON from the Shapefile. More... | |
virtual IlvMapFeature * | readPolygonZShape (IlvMapsError &status) |
Reads a POLYGONZ from the Shapefile. More... | |
virtual IlvMapFeature * | readPolylineMShape (IlvMapsError &status) |
Reads a POLYLINEM from the Shapefile. More... | |
virtual IlvMapFeature * | readPolylineShape (IlvMapsError &status) |
Reads a POLYLINE from the Shapefile. More... | |
virtual IlvMapFeature * | readPolylineZShape (IlvMapsError &status) |
Reads a POLYLINEZ from the Shapefile. More... | |
virtual void | setInitStatus (IlvMapsError status) |
Sets the initialization status of this reader. More... | |
Additional Inherited Members | |
Static Public Member Functions inherited from IlvMapFeatureIterator | |
static IlvClassInfo * | ClassInfo () |
Returns the class information of the class. More... | |
static IlvClassInfo ** | ClassInfoRef () |
Returns the address of the class information of the class. More... | |
This class reads geometries from .shp
files.
Library: ilvmaps
This class can be used to read Shapefiles with the .shp
extension. It implements the IlvMapFeatureIterator
class. This class does not read the Shapefile attributes that are stored in .dbf
files. To read .shp
and .dbf
files together, you must use an IlvShapeFileReader
.
This implementation reads only 2D geometries and stores the additonnal values of 3D geometries with values as attribute.
IlvShapeSHPReader::IlvShapeSHPReader | ( | const char * | fileName, |
const char * | shxName = 0 |
||
) |
Initializes an IlvShapeSHPReader
to read from the Shapefile file whose name is specified. You can also specify an index (.shx
) file name if you want to perform random access on geometries through the getFeatureAt
method.
fileName | The name of the .shp input file. |
shxName | The name of an .shx input file. |
IlvShapeSHPReader::IlvShapeSHPReader | ( | IL_STDPREF istream & | stream | ) |
Initializes an IlvShapeSHPReader
to read from the specified input stream.
stream | The input stream. |
IlvShapeSHPReader::IlvShapeSHPReader | ( | IL_STDPREF istream & | shpStream, |
IL_STDPREF istream & | shxStream | ||
) |
Initializes an IlvShapeSHPReader
to read from the specified input streams. With this constructor, in addition to the stream opened on a Shapefile file, you can specify a stream opened on an index file (.shx
) in order to perform random access on geometries through the getFeatureAt
method.
shpStream | The input stream opened on an .shp file. |
shxStream | The input stream opened on an .shx file. |
|
virtual |
Returns the default renderer for this feature iterator.
Returns a renderer that can be used to translate the map features returned by this iterator into graphic objects. Feature iterators that store some rendering information in the attributes of the map features, such as color, text font, line thickness and so on, can return a specific renderer which is able to take these attributes into account during the rendering process.
display | The IlvDisplay the graphic objects are attached to. |
Implements IlvMapFeatureIterator.
|
virtual |
Returns the feature located at the specified index.
IlvShapeSHPReader
has been constructed with a .shx
file. index | The location of the feature. |
status | An IlvMapsError if an error occurs. |
IlvMapFeature
read or 0
if an error occurs. const IlvFeatureAttributeInfo* IlvShapeSHPReader::getFeatureAttributeInfo | ( | IlvMapsError & | status | ) | const |
Returns the description of the attributes that are generated by the shape reader.
IlvFeatureAttributeInfo
that describes additional attributes to store the measurements of POINTM, POLYLINEM, POLYGONM and MULTIPOINTM, and to store the elevations and measurements of POINTZ, POLYLINEZ, POLYGONZ and MULTIPOINTZ. If the shape type does not require additional attributes, this method returns a null
value.
|
virtual |
Checks the initialization status of this reader.
IlvMaps::NoError()
if the initialization of this reader is successful, or an error if an error occured during the initalization. Implements IlvMapFeatureIterator.
|
virtual |
Returns the lower right corner of the rectangle containing all the map features of this iterator.
result | An IlvCoordinate to store the result. |
IlFalse
if lower right is unknown. Implements IlvMapFeatureIterator.
|
virtual |
Returns the next available feature.
Returns the next map feature of the iterator, of null
if the iteration is finished. The returned feature is owned by the iterator, and therefore must not be deleted by the application.
status | An IlvMapsError to store the read status. |
Implements IlvMapFeatureIterator.
|
virtual |
Returns the ID of the next feature. For Shapefiles, IDs are created as IlvMapFeatureIntegerId
.
new IlvMapFeatureIntegerId(getNextFeatureIndex())
. Implements IlvLookAheadFeatureIterator.
|
virtual |
Returns the index of the next feature that is read.
|
virtual |
Returns the projection of geometries of this feature iterator.
Returns the projection in which the geometric coordinates of the map features are expressed or null
if the feature iterator returns ungeoreferenced map features.
Implements IlvMapFeatureIterator.
IlvShapeFileIndex* IlvShapeSHPReader::getShapeFileIndex | ( | ) |
Returns the Shapefile index reader.
.shx
file name. If not, this method returns 0. IlvShapeType IlvShapeSHPReader::getShapeType | ( | ) | const |
Returns the shape type of the objects contained in the file.
|
virtual |
Returns the upper left corner of the rectangle containing all the map features of this iterator.
result | An IlvCoordinate to store the result. |
IlFalse
if upper left is unknown. Implements IlvMapFeatureIterator.
|
protectedvirtual |
Reads a MULTIPOINTM from the Shapefile.
The read measures are set as attributes.
status | Contains the read status. |
|
protectedvirtual |
Reads a MULTIPOINT from the Shapefile.
status | Contains the read status. |
|
protectedvirtual |
Reads a MULTIPOINTZ from the Shapefile.
The read measures and altitudes are set as attributes.
status | Contains the read status. |
|
protectedvirtual |
Reads a POINTM shape.
The read measures are set as attributes.
status | Contains the read status. |
|
protectedvirtual |
Reads a POINT shape.
status | Contains the read status. |
|
protectedvirtual |
Reads a POINTZ shape.
The read measures and altitudes are set as attributes.
status | Contains the read status. |
|
protectedvirtual |
Reads a POLYGONM from the Shapefile.
The read measures are set as attributes.
status | Contains the read status. |
|
protectedvirtual |
Reads a POLYGON from the Shapefile.
status | Contains the read status. |
|
protectedvirtual |
Reads a POLYGONZ from the Shapefile.
The read measures and altitudes are set as attributes.
status | Contains the read status. |
|
protectedvirtual |
Reads a POLYLINEM from the Shapefile.
The read measures are set as attributes.
status | Contains the read status. |
|
protectedvirtual |
Reads a POLYLINE from the Shapefile.
status | Contains the read status. |
|
protectedvirtual |
Reads a POLYLINEZ from the Shapefile.
The read measures and altitudes are set as attributes.
status | Contains the read status. |
|
protectedvirtual |
Sets the initialization status of this reader.
status | The new initialization status. |
|
virtual |
Sets the projection of geometries generated by this feature iterator. This method is to be used when feature source is not georeferenced.
projection | The projection to be set. This projection becomes shared and is locked by this feature iterator. |
Reimplemented from IlvMapFeatureIterator.
© Copyright 2015, Rogue Wave Software, Inc. All Rights Reserved.
Rogue Wave is a registered trademark of Rogue Wave Software, Inc. in the United States and other countries. All other trademarks are the property of their respective owners.