Rogue Wave Views Maps Package API Reference Guide |
Rogue Wave Views Documentation Home |
This class reads geometries and attributes from Shape files. More...
#include <ilviews/maps/format/shapefile/shpfile.h>
Public Member Functions | |
IlvShapeFileReader (const char *shpFileName, const char *dbfFileName, const char *shxFileName=0) | |
Initializes a new instance of IlvShapeFileReader to read features from files. More... | |
IlvShapeFileReader (IlvShapeSHPReader *shpReader, IlvShapeDBFReader *dbfReader, IlBoolean ownerOfReaders=IlFalse) | |
Initializes a new instance of IlvShapeFileReader to read features from an IlvShapeSHPReader and an IlvShapeDBFReader . More... | |
IlvShapeFileReader (IlvShapeSHPReader *shpReader, IlvShapeDBFReader *dbfReader, IlvShapeFileIndex *shxIndex, IlBoolean ownerOfReaders=IlFalse) | |
Initializes a new instance of IlvShapeFileReader to read features from an IlvShapeSHPReader , an IlvShapeDBFReader and an IlvSHapeFileIndex . More... | |
IlvShapeDBFReader * | getDBFReader () |
Returns the IlvShapeDBFReader used by this reader. More... | |
virtual 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... | |
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... | |
const IlvMapFeature * | getNextFeature (IlvMapsError &status) |
Returns the next available feature. More... | |
virtual IlvMapFeatureId * | getNextFeatureId (IlvMapsError &status) |
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... | |
IlvShapeSHPReader * | getSHPReader () |
Returns the IlvShapeSHPReader used by this reader. More... | |
IlvShapeFileIndex * | getSHXReader () |
Returns the IlvShapeFileIndex used by this reader. More... | |
IlBoolean | getUpperLeftCorner (IlvCoordinate &result) const |
Returns the upper left corner of the rectangle containing all the map features of this iterator. More... | |
IlBoolean | isLoadingAttributes () |
Specifies whether this reader is reading auxiliary attributes. More... | |
void | setSourceProjection (IlvProjection *projection) |
Sets the projection of geometries generated by this feature iterator. More... | |
virtual IlBoolean | skipNextFeature (IlvMapsError &status) |
Skips the next feature available from this feature iterator. More... | |
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 | |
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 and attributes from Shape files.
Library: ilvmaps
The IlvShapeFileReader
class combines a IlvShapeSHPReader
and a IlvShapeDBFReader
to read geometries and attributes from ESRI Arc/Info shape files.
IlvShapeSHPReader
, IlvShapeDBFReader
. IlvShapeFileReader::IlvShapeFileReader | ( | const char * | shpFileName, |
const char * | dbfFileName, | ||
const char * | shxFileName = 0 |
||
) |
Initializes a new instance of IlvShapeFileReader
to read features from files.
shpFileName | The name of the .shp file to read. |
dbfFileName | The name of the .dbf file to read. If 0 , no attributes are read. |
shxFileName | The name of the index file to read (with a .shx or .SHX extension). |
IlvShapeFileReader::IlvShapeFileReader | ( | IlvShapeSHPReader * | shpReader, |
IlvShapeDBFReader * | dbfReader, | ||
IlBoolean | ownerOfReaders = IlFalse |
||
) |
Initializes a new instance of IlvShapeFileReader
to read features from an IlvShapeSHPReader
and an IlvShapeDBFReader
.
The flag ownerOfReaders indicates if this IlvShapeFileReader
must delete the readers when it is is deleted.
shpReader | The IlvShapeSHPReader . |
dbfReader | The IlvShapeDBFReader . If 0 , no attributes are read. |
ownerOfReaders | If IlTrue , the readers are owned by this IlvShapeFileReader , so that they will be deleted when this instance is deleted. |
IlvShapeFileReader::IlvShapeFileReader | ( | IlvShapeSHPReader * | shpReader, |
IlvShapeDBFReader * | dbfReader, | ||
IlvShapeFileIndex * | shxIndex, | ||
IlBoolean | ownerOfReaders = IlFalse |
||
) |
Initializes a new instance of IlvShapeFileReader
to read features from an IlvShapeSHPReader
, an IlvShapeDBFReader
and an IlvSHapeFileIndex
.
The flag ownerOfReaders indicates if IlvShapeFileReader
must delete the readers when IlvShapeFileReader
is deleted.
shpReader | The IlvShapeSHPReader . |
dbfReader | The IlvShapeDBFReader . If 0 , no attributes are read. |
shxIndex | The IlvShapeFileIndex . If 0 , the getFeatureAt() method will not work. |
ownerOfReaders | If IlTrue , the readers are owned by this IlvShapeFileReader , so that they will be deleted when this instance is deleted. |
IlvShapeDBFReader* IlvShapeFileReader::getDBFReader | ( | ) |
Returns the IlvShapeDBFReader
used by this reader.
Returns the reader of the .dbf
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 display instance the graphic objects are attached to. |
Implements IlvMapFeatureIterator.
|
virtual |
Returns the feature located at the specified index.
Note that this only works if this IlvShapeFileReader
has been constructed with a .shx
file.
index | The location of the feature. |
status | Set to the read status on return. |
IlvMapFeature
that was read read or 0
if an error occurs.
|
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 | Set to the result on return. |
IlFalse
if lower right is unknown. Implements IlvMapFeatureIterator.
|
virtual |
Returns the next available feature.
Returns the next map feature of the iterator, of 0
if the iteration is finished. The returned feature is owned by the iterator, and therefore must not be deleted by application.
status | Set to the read status on return. |
Implements IlvMapFeatureIterator.
|
virtual |
Returns the index of the next feature that is read.
status | Set to the read status on return. |
Implements IlvLookAheadFeatureIterator.
|
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 0
if the feature iterator returns ungeoreferenced map features.
Implements IlvMapFeatureIterator.
IlvShapeSHPReader* IlvShapeFileReader::getSHPReader | ( | ) |
Returns the IlvShapeSHPReader
used by this reader.
Returns the reader of the .shp
file.
IlvShapeFileIndex* IlvShapeFileReader::getSHXReader | ( | ) |
Returns the IlvShapeFileIndex
used by this reader.
Returns the reader of the .shx
file.
|
virtual |
Returns the upper left corner of the rectangle containing all the map features of this iterator.
result | Set to the result on return. |
IlFalse
if upper left is unknown. Implements IlvMapFeatureIterator.
IlBoolean IlvShapeFileReader::isLoadingAttributes | ( | ) |
Specifies whether this reader is reading auxiliary attributes.
IlTrue
if this reader is reading auxiliary attributes.
|
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.
|
virtual |
Skips the next feature available from this feature iterator.
status | Set to the read status on return. |
IlTrue
if the feature is skipped properly, and IlFalse
if an error occurs. Implements IlvLookAheadFeatureIterator.
© Copyright 2018, 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.