rwlogo
Rogue Wave Views 5.6

Rogue Wave Views
Maps Package API Reference Guide

Product Documentation:

Rogue Wave Views
Documentation Home

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>

List of all members.

Public Member Functions

 IlvShapeSpatialIndex (const char *indexFilename)
 Constructs a spatial index whose values are read from the specified file.
 IlvShapeSpatialIndex (IlInt columNum, IlInt rowNum, IlvCoordinate *origin, IlDouble tileWidth, IlDouble tileHeight)
 Constructs an empty spatial index with the specified parameters.
IlBoolean add (IlInt c, IlInt r, IlInt id)
 Adds the object whose ID is specified in the spatial index, at the specified position.
IlInt getColumnCount () const
 Returns the number of tile columns covered by this index.
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.
IlvMapsError getInitStatus () const
 Returns the status.
IlvCoordinategetOrigin () const
 Returns the origin of the tile grid.
IlInt getRowCount () const
 Returns the number of tile rows covered by this index.
IlDouble getTileHeight () const
 Returns the height of one tile.
IlDouble getTileWidth () const
 Returns the width of one tile.
IlvMapsError save (const char *filename)
 Writes this spatial index to the specified data output.

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:
columNum The number of columns.
rowNum The number of rows.
origin The origin of the grid defined by this index.
tileWidth The width of one tile, in manager coordinates.
tileHeight The 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:
indexFilename The 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:
c The column position.
r The row position.
id The 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:
column The column of the tile.
row The row of the tile.
ret A 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.
size The 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:
output The data output to write this spatial index to.
 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.