rwlogo

Rogue Wave Views
Maps Package API Reference Guide

Product Documentation:

Rogue Wave Views
Documentation Home

 All Classes Files Functions Variables Typedefs Enumerations Enumerator Macros
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)
 Constructs a new IlvShapeFileTiler providing a Shapefile name, a .shx file name, a target index file name, and a tile size. More...
 
 IlvShapeFileTiler (const char *shpFilename, const char *shxFileName, const char *targetFileName, IlInt numColumns, IlInt numRows)
 Constructs a new IlvShapeFileTiler providing a Shapefile name, an .shx file name, a target index file name, the number of columns, and the number of rows. 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, or 0 if the index file could not be opened or if the tiler was constructed with a null .shx file.
 
IlBoolean getLowerRightCorner (IlvCoordinate &c) const
 
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
 

Static Public Member Functions

static IlvMapsError CreateShapeSpatialIndex (const char *shpFilename, const char *targetFileName, IlInt numColumns, IlInt numRows)
 Creates a shape spatial index in one call. More...
 
static IlvMapsError CreateShapeSpatialIndex (const char *shpFilename, const char *targetFileName, IlDouble tileWidth, IlDouble tileHeight)
 Creates a shape spatial index in one call. 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::IlvShapeFileTiler ( const char *  shpFilename,
const char *  shxFileName,
const char *  targetFileName,
IlDouble  tileWidth,
IlDouble  tileHeight 
)

Constructs a new IlvShapeFileTiler providing a Shapefile name, a .shx file name, a target index file name, and a tile size.

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::IlvShapeFileTiler ( const char *  shpFilename,
const char *  shxFileName,
const char *  targetFileName,
IlInt  numColumns,
IlInt  numRows 
)

Constructs a new IlvShapeFileTiler providing a Shapefile name, an .shx file name, a target index file name, the number of columns, and the number of rows.

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

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

Creates a shape spatial index in one call.

Parameters
shpFilenameThe source shape file name.
targetFileNameThe target spatial index file name.
numColumnsThe number of columns.
numRowsThe number of rows.
static IlvMapsError IlvShapeFileTiler::CreateShapeSpatialIndex ( const char *  shpFilename,
const char *  targetFileName,
IlDouble  tileWidth,
IlDouble  tileHeight 
)
static

Creates a shape spatial index in one call.

Parameters
shpFilenameThe source shape file name.
targetFileNameThe target spatial index file name.
tileWidthThe width of the tiles.
tileHeightThe height of the tiles.
IlInt IlvShapeFileTiler::getColumnCount ( ) const

Returns the number of columns.

Returns
The number of columns.
IlInt IlvShapeFileTiler::getCurrentCount ( ) const

Returns the number of objects currently processed.

Returns
The number of objects currently processed.
IlBoolean IlvShapeFileTiler::getLowerRightCorner ( IlvCoordinate c) const

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

const IlvMapFeature* IlvShapeFileTiler::getNextFeature ( )

Returns the next feature from the shape file.

Returns
The next IlvMapFeature.
IlvCoordinate* IlvShapeFileTiler::getOrigin ( ) const

Returns the origin of the tile grid.

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

Returns the number of rows.

Returns
The number of rows.
IlvMapsError IlvShapeFileTiler::getStatus ( ) const

Returns the status of this tiler.

Returns
IlvMaps::NoError() if no error occurred, an error code otherwise.
IlDouble IlvShapeFileTiler::getTileHeight ( ) const

Returns the height of a tile in manager coordinates.

Returns
The height of a tile in manager coordinates.
IlDouble IlvShapeFileTiler::getTileWidth ( ) const

Returns the width of a tile in manager coordinates.

Returns
The width of a tile in manager coordinates.
IlBoolean IlvShapeFileTiler::getUpperLeftCorner ( IlvCoordinate c) const

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

void IlvShapeFileTiler::setStatus ( IlvMapsError  status)
protected

Sets the error status of the tiler.

Parameters
statusThe error code.

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