rwlogo

Rogue Wave Views
Maps Package API Reference Guide

Product Documentation:

Rogue Wave Views
Documentation Home

List of all members | Public Member Functions
IlvShapeSpatialIndex Class Reference

An IlvShapeSpatialIndex is used to store and retrieve tile information for a given Shapefile. More...

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

Public Member Functions

 IlvShapeSpatialIndex (IlInt columNum, IlInt rowNum, IlvCoordinate *origin, IlDouble tileWidth, IlDouble tileHeight)
 Constructs an empty spatial index with the specified parameters. More...
 
 IlvShapeSpatialIndex (const char *indexFilename)
 Constructs a spatial index whose values are read from the specified file. More...
 
IlBoolean add (IlInt c, IlInt r, IlInt id)
 Adds the object whose ID is specified in the spatial index, at the specified position. More...
 
IlInt getColumnCount () const
 Returns the number of tile columns covered by this index. More...
 
IlvMapsError getIdArray (IlInt column, IlInt row, IlInt *&ret, IlUInt &size)
 Returns an array containing the IDs of all the shape features contained within the specified tile. More...
 
IlvMapsError getInitStatus () const
 Returns the status. More...
 
IlvCoordinategetOrigin () const
 Returns the origin of the tile grid. More...
 
IlInt getRowCount () const
 Returns the number of tile rows covered by this index. More...
 
IlDouble getTileHeight () const
 Returns the height of one tile. More...
 
IlDouble getTileWidth () const
 Returns the width of one tile. More...
 
IlvMapsError save (const char *filename)
 Writes this spatial index to the specified data output. More...
 

Detailed Description

An IlvShapeSpatialIndex is used to store and retrieve tile information for a given Shapefile.

Library: ilvmaps

When an IlvShapeSpatialIndex is written to a file, it uses a format that is internal to Rogue Wave Views Maps.

Constructor & Destructor Documentation

IlvShapeSpatialIndex::IlvShapeSpatialIndex ( IlInt  columNum,
IlInt  rowNum,
IlvCoordinate origin,
IlDouble  tileWidth,
IlDouble  tileHeight 
)

Constructs an empty spatial index with the specified parameters.

Parameters
columNumThe number of columns.
rowNumThe number of rows.
originThe origin of the grid defined by this index.
tileWidthThe width of one tile, in manager coordinates.
tileHeightThe height of one tile, in manager coordinates.
IlvShapeSpatialIndex::IlvShapeSpatialIndex ( const char *  indexFilename)

Constructs a spatial index whose values are read from the specified file.

When a spatial index is created with this constructor, it is read-only, meaning that the add() method does not work.
The specified file must have been written using the save() method of an IlvShapeFileIndex.

Parameters
indexFilenameThe name of the spatial index file.

Member Function Documentation

IlBoolean IlvShapeSpatialIndex::add ( IlInt  c,
IlInt  r,
IlInt  id 
)

Adds the object whose ID is specified in the spatial index, at the specified position.

Parameters
cThe column position.
rThe row position.
idThe ID to add.
Returns
IlFalse if the IlvShapeSpatialIndex is read only, IlTrue otherwise.
IlInt IlvShapeSpatialIndex::getColumnCount ( ) const

Returns the number of tile columns covered by this index.

Returns
The number of tile columns.
IlvMapsError IlvShapeSpatialIndex::getIdArray ( IlInt  column,
IlInt  row,
IlInt *&  ret,
IlUInt size 
)

Returns an array containing the IDs of all the shape features contained within the specified tile.

IDs are coded as IlInt type and can be accessed using IlvShapeSHPReader::getFeatureAt().

Parameters
columnThe column of the tile.
rowThe row of the tile.
retA returned array of IlInt containing the IDs of all the shape features contained within the specified tile. This array, if nonnull, must be deleted by the caller by using the delete[] operator.
sizeThe size of the returned array of IDs.
Returns
An IlvMapsError if the array cannot be read, IlvMaps::NoError() otherwise.
IlvMapsError IlvShapeSpatialIndex::getInitStatus ( ) const

Returns the status.

This status is set when constructing a IlvShapeSpatialIndex with a file name.

IlvCoordinate* IlvShapeSpatialIndex::getOrigin ( ) const

Returns the origin of the tile grid.

Returns
The origin of the tile grid.
IlInt IlvShapeSpatialIndex::getRowCount ( ) const

Returns the number of tile rows covered by this index.

Returns
The number of tile rows.
IlDouble IlvShapeSpatialIndex::getTileHeight ( ) const

Returns the height of one tile.

Returns
The tile height.
IlDouble IlvShapeSpatialIndex::getTileWidth ( ) const

Returns the width of one tile.

Returns
The tile width.
IlvMapsError IlvShapeSpatialIndex::save ( const char *  filename)

Writes this spatial index to the specified data output.

Parameters
outputThe data output to write this spatial index to.

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