rwlogo
Rogue Wave Views 5.6

Rogue Wave Views
Maps Package API Reference Guide

Product Documentation:

Rogue Wave Views
Documentation Home

IlvShapeFileIndex Class Reference

This class allows applications to take advantage of ESRI Shapefile index files (.shx files).
. More...

#include <ilviews/maps/format/shapefile/shpindex.h>

List of all members.

Public Member Functions

 IlvShapeFileIndex (istream &stream)
 Initializes an IlvShapeFileIndex from the specified istream.
 IlvShapeFileIndex (const char *shxFileName)
 Initializes an IlvShapeFileIndex from the .shx file specified.
IlvMapsError getInitStatus () const
 Checks the initialization status of this reader.
IlBoolean getLowerRightCorner (IlvCoordinate &result) const
 Returns the lower right corner of the rectangle containing all the map features of the shape file corresponding to this index reader.
IlInt getRecordCount () const
 Returns the number of objects in this index.
IlvMapsError getRecordLength (IlInt index, IlInt &length)
 Retrieves the record length (in bytes) of the object at the specified index.
IlvMapsError getRecordOffset (IlInt index, IlInt &offset)
 Retrieves the file offset of the object at the specified index.
IlBoolean getUpperLeftCorner (IlvCoordinate &result) const
 Returns the upper left corner of the rectangle containing all the map features of this iterator.

Protected Member Functions

const IlvMapInputgetInput () const
 Returns the map input of this reader.
virtual void setInitStatus (IlvMapsError status)
 Sets the initialization status of this reader.

Detailed Description

This class allows applications to take advantage of ESRI Shapefile index files (.shx files).
.

Library: ilvmaps

Index files allow direct access to geometries in the main Shapefile (.shp file). Index files map record indexes to file offsets.
Index files are typically used to load geometries on demand.


Constructor & Destructor Documentation

IlvShapeFileIndex::IlvShapeFileIndex ( const char *  shxFileName  ) 

Initializes an IlvShapeFileIndex from the .shx file specified.

Parameters:
shxFileName The name of the .shx file.
IlvShapeFileIndex::IlvShapeFileIndex ( istream &  stream  ) 

Initializes an IlvShapeFileIndex from the specified istream.

Parameters:
dataInputFile The stream opened on the shape data.

Member Function Documentation

IlvMapsError IlvShapeFileIndex::getInitStatus (  )  const

Checks the initialization status of this reader.

Returns:
IlvMaps::NoError() if the initialization of this reader is successful, or an error if an error occurred during the initialization.
const IlvMapInput& IlvShapeFileIndex::getInput (  )  const [protected]

Returns the map input of this reader.

Returns:
The IlvMapInput of the reader.
IlBoolean IlvShapeFileIndex::getLowerRightCorner ( IlvCoordinate result  )  const

Returns the lower right corner of the rectangle containing all the map features of the shape file corresponding to this index reader.

Parameters:
result An IlvCoordinate to store the result.
Returns:
IlFalse if the lower right corner is unknown.
IlInt IlvShapeFileIndex::getRecordCount (  )  const

Returns the number of objects in this index.

Returns:
The number of objects in this index.
IlvMapsError IlvShapeFileIndex::getRecordLength ( IlInt  index,
IlInt length 
)

Retrieves the record length (in bytes) of the object at the specified index.

The index of objects is in the range [0,getRecordCount()].

Warning:
[note] The length is specified as the content length of the record. It does not include the 4 byte header.
Parameters:
index The index of objects.
length The returned length.
Returns:
IlvMaps::NoError() if no error occurs.
IlvMapsError IlvShapeFileIndex::getRecordOffset ( IlInt  index,
IlInt offset 
)

Retrieves the file offset of the object at the specified index.

The index of objects is in the range [0,getRecordCount()].
The file offset is expressed in bytes, from the start of the files. As there is a 100 bytes header in the .shx file, the index of the first object is at offset 100.

Parameters:
index The index of objects.
offset The returned offset.
IlBoolean IlvShapeFileIndex::getUpperLeftCorner ( IlvCoordinate result  )  const

Returns the upper left corner of the rectangle containing all the map features of this iterator.

Parameters:
result An IlvCoordinate to store the result.
Returns:
IlFalse if the upper left corner is unknown.
virtual void IlvShapeFileIndex::setInitStatus ( IlvMapsError  status  )  [protected, virtual]

Sets the initialization status of this reader.

Parameters:
status The new initialization status.
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Friends Defines

© Copyright 2012, 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.