public class IlvShapeSpatialIndex extends Object
IlvShapeSpatialIndex is used to store and retrieve tile
information for a given Shapefile. IlvShapeSpatialIndex is written to a file, it uses a
format that is internal to Rogue Wave JViews.| Constructor and Description |
|---|
IlvShapeSpatialIndex(int columnNum,
int rowNum,
IlvCoordinate origin,
double tileWidth,
double tileHeight)
Constructs an empty spatial index with the specified parameters.
|
IlvShapeSpatialIndex(String indexFilename)
Constructs a spatial index whose values are read from the specified
file.
|
IlvShapeSpatialIndex(URL url)
Constructs a spatial index whose values are read from the specified
url.
|
| Modifier and Type | Method and Description |
|---|---|
void |
add(int c,
int r,
int id)
Adds the object whose ID is specified in the spatial index, at the specified
position.
|
int |
getColumnCount()
Returns the number of tile columns covered by this index.
|
int[] |
getIdArray(int column,
int row)
Returns an array containing the IDs of all the shape features contained
within the specified tile.
|
IlvCoordinate |
getOrigin()
Returns the origin of the tile grid.
|
int |
getRowCount()
Returns the number of tile rows covered by this index.
|
double |
getTileHeight()
Returns the height of one tile.
|
double |
getTileWidth()
Returns the width of one tile.
|
void |
save(String filename)
Saves this spatial index to the file specified.
|
void |
write(DataOutput output)
Writes this spatial index to the specified data output.
|
public IlvShapeSpatialIndex(int columnNum,
int rowNum,
IlvCoordinate origin,
double tileWidth,
double tileHeight)
columnNum - 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.public IlvShapeSpatialIndex(String indexFilename) throws IOException
add method does not work.save() method of an IlvShapeFileIndex.indexFilename - The name of the spatial index file.IOException - if an error occurs while reading the index file.public IlvShapeSpatialIndex(URL url) throws IOException
add method does not work.save() method of an IlvShapeFileIndex.url - The url of the spatial index file.IOException - if an error occurs while reading the index file.public int[] getIdArray(int column,
int row)
throws IOException
int type and
can be accessed using IlvSHPReader.getFeatureAt().column - The column of the tile.row - The row of the tile.IOException - if tile information cannot be read from the file
containing this spatial index.IlvSHPReader.getFeatureAt(int)public void add(int c,
int r,
int id)
c - The column position.r - The row position.id - The ID to add.UnsupportedOperationException - if this spatial index is
read-only.public int getColumnCount()
public int getRowCount()
public IlvCoordinate getOrigin()
public double getTileWidth()
public double getTileHeight()
public void write(DataOutput output) throws IOException
output - The data output to write this spatial index to.IOExceptionpublic void save(String filename) throws IOException
filename - The name of the file to save this spatial index to.IOException© Copyright Rogue Wave Software, Inc. 1997, 2017. All Rights Reserved.