Rogue Wave Views
Maps Package API Reference Guide
Product Documentation:

Rogue Wave Views
Documentation Home
List of all members | Public Member Functions | Static Public Member Functions | Protected Member Functions
IlvShapeFileTiler Class Reference

A Shapefile tiler. More...

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

Public Member Functions

 IlvShapeFileTiler (const char *shpFilename, const char *shxFileName, const char *targetFileName, IlDouble tileWidth, IlDouble tileHeight)
 Initializes a new IlvShapeFileTiler from a set of files and tile dimensions. More...
 
 IlvShapeFileTiler (const char *shpFilename, const char *shxFileName, const char *targetFileName, IlInt numColumns, IlInt numRows)
 Initializes a new IlvShapeFileTiler from a set of files and the number of tiles. More...
 
void addInfo ()
 Adds a single object in the spatial index.
 
void close ()
 Saves the tiling information, and closes the readers.
 
IlInt getColumnCount () const
 Returns the number of columns. More...
 
IlInt getCurrentCount () const
 Returns the number of objects currently processed. More...
 
IlInt getFeatureCount () const
 Returns the total number of objects to process. More...
 
IlBoolean getLowerRightCorner (IlvCoordinate &c) const
 Returns the lower right coordinate of the bounding box that delimits the objects contained in the shape file. More...
 
const IlvMapFeaturegetNextFeature ()
 Returns the next feature from the shape file. More...
 
IlvCoordinategetOrigin () const
 Returns the origin of the tile grid. More...
 
IlInt getRowCount () const
 Returns the number of rows. More...
 
IlvMapsError getStatus () const
 Returns the status of this tiler. More...
 
IlDouble getTileHeight () const
 Returns the height of a tile in manager coordinates. More...
 
IlDouble getTileWidth () const
 Returns the width of a tile in manager coordinates. More...
 
IlBoolean getUpperLeftCorner (IlvCoordinate &c) const
 Returns the upper left coordinate of the bounding box that delimits the objects contained in the shape file. More...
 

Static Public Member Functions

static IlvMapsError CreateShapeSpatialIndex (const char *shpFilename, const char *targetFileName, IlInt numColumns, IlInt numRows)
 Creates a shape spatial index. More...
 
static IlvMapsError CreateShapeSpatialIndex (const char *shpFilename, const char *targetFileName, IlDouble tileWidth, IlDouble tileHeight)
 Creates a shape spatial index. More...
 

Protected Member Functions

void setStatus (IlvMapsError status)
 Sets the error status of the tiler. More...
 

Detailed Description

A Shapefile tiler.

Library: ilvmaps
An IlvShapeFileTiler is used to generate and to save tile information for a given Shapefile.

There are two ways to use this class: A direct way, tile information is written in one call:

IlvShapeFileTiler::CreateShapeSpatialIndex(sourceFileName,
                                           targetFileName,
                                           tileWidth,
                                           tileHeight);

or a step by step way, allowing to update a progress bar,

IlvShapeFileTiler* tiler = new IlvShapeFileTiler(sourceFileName,
                                                 shxFileName,
                                                 targetFileName,
                                                 tileWidth,
                                                 tileHeight);
while (tiler->getNextFeature()) {
    updateProgressBar();
    tiler->addInfo();
}
tiler->close();

Constructor & Destructor Documentation

§ IlvShapeFileTiler() [1/2]

IlvShapeFileTiler::IlvShapeFileTiler ( const char *  shpFilename,
const char *  shxFileName,
const char *  targetFileName,
IlDouble  tileWidth,
IlDouble  tileHeight 
)

Initializes a new IlvShapeFileTiler from a set of files and tile dimensions.

Parameters
shpFilenameThe source shape file name.
shxFileNameThe name of the .shx file, or 0 if no progress information is needed.
targetFileNameThe target spatial index file name.
tileWidthThe width of one tile, in manager coordinates.
tileHeightThe height of one tile, in manager coordinates.

§ IlvShapeFileTiler() [2/2]

IlvShapeFileTiler::IlvShapeFileTiler ( const char *  shpFilename,
const char *  shxFileName,
const char *  targetFileName,
IlInt  numColumns,
IlInt  numRows 
)

Initializes a new IlvShapeFileTiler from a set of files and the number of tiles.

Parameters
shpFilenameThe source shape file name.
shxFileNameThe name of the .shx file, or null if no progress information is needed.
targetFileNameThe target spatial index file name.
numColumnsThe number of columns.
numRowsThe number of rows.

Member Function Documentation

§ CreateShapeSpatialIndex() [1/2]

static IlvMapsError IlvShapeFileTiler::CreateShapeSpatialIndex ( const char *  shpFilename,
const char *  targetFileName,
IlInt  numColumns,
IlInt  numRows 
)
static

Creates a shape spatial index.

Parameters
shpFilenameThe source shape file name.
targetFileNameThe target spatial index file name.
numColumnsThe number of columns.
numRowsThe number of rows.

§ CreateShapeSpatialIndex() [2/2]

static IlvMapsError IlvShapeFileTiler::CreateShapeSpatialIndex ( const char *  shpFilename,
const char *  targetFileName,
IlDouble  tileWidth,
IlDouble  tileHeight 
)
static

Creates a shape spatial index.

Parameters
shpFilenameThe source shape file name.
targetFileNameThe target spatial index file name.
tileWidthThe width of the tiles.
tileHeightThe height of the tiles.

§ getColumnCount()

IlInt IlvShapeFileTiler::getColumnCount ( ) const

Returns the number of columns.

Returns
The number of columns.

§ getCurrentCount()

IlInt IlvShapeFileTiler::getCurrentCount ( ) const

Returns the number of objects currently processed.

Returns
The number of objects currently processed.

§ getFeatureCount()

IlInt IlvShapeFileTiler::getFeatureCount ( ) const

Returns the total number of objects to process.

Returns
The total number of objects to process, or 0 if the index file could not be opened or if the tiler was constructed with no .shx file.

§ getLowerRightCorner()

IlBoolean IlvShapeFileTiler::getLowerRightCorner ( IlvCoordinate c) const

Returns the lower right coordinate of the bounding box that delimits the objects contained in the shape file.

Parameters
cSet to the lower right coordinate of the bounding box that delimits the objects contained in the shape file on return.
Returns
IlFalse if the lower right corner is unknown.

§ getNextFeature()

const IlvMapFeature* IlvShapeFileTiler::getNextFeature ( )

Returns the next feature from the shape file.

Returns
The next IlvMapFeature or 0 if there is none.

§ getOrigin()

IlvCoordinate* IlvShapeFileTiler::getOrigin ( ) const

Returns the origin of the tile grid.

Returns
The origin of the tile grid.

§ getRowCount()

IlInt IlvShapeFileTiler::getRowCount ( ) const

Returns the number of rows.

Returns
The number of rows.

§ getStatus()

IlvMapsError IlvShapeFileTiler::getStatus ( ) const

Returns the status of this tiler.

Returns
IlvMaps::NoError() if no error occurred, an error code otherwise.

§ getTileHeight()

IlDouble IlvShapeFileTiler::getTileHeight ( ) const

Returns the height of a tile in manager coordinates.

Returns
The height of a tile in manager coordinates.

§ getTileWidth()

IlDouble IlvShapeFileTiler::getTileWidth ( ) const

Returns the width of a tile in manager coordinates.

Returns
The width of a tile in manager coordinates.

§ getUpperLeftCorner()

IlBoolean IlvShapeFileTiler::getUpperLeftCorner ( IlvCoordinate c) const

Returns the upper left coordinate of the bounding box that delimits the objects contained in the shape file.

Parameters
cSet to the upper left coordinate of the bounding box that delimits the objects contained in the shape file on return.
Returns
IlFalse if the upper left corner is unknown.

§ setStatus()

void IlvShapeFileTiler::setStatus ( IlvMapsError  status)
protected

Sets the error status of the tiler.

Parameters
statusThe error code.

© 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.