public class IlvShapeFileTiler extends Object
IlvShapeFileTiler
is used to generate
and to save tile information for a given Shapefile. 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() != null) { updateProgressBar(); tiler.addInfo(); } tiler.close();
Constructor and Description |
---|
IlvShapeFileTiler(String shpFilename,
String shxFileName,
String targetFileName,
double tileWidth,
double tileHeight)
Constructs a new
IlvShapeFileTiler providing
a shapefile name, a shx file name, a target index file name, and a tile size. |
IlvShapeFileTiler(String shpFilename,
String shxFileName,
String targetFileName,
int numColumns,
int 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. |
Modifier and Type | Method and Description |
---|---|
void |
addInfo()
Adds a single object in the spatial index.
|
void |
close()
Saves the tiling information, and closes the readers.
|
static void |
CreateShapeSpatialIndex(String shpFilename,
String targetFileName,
double tileWidth,
double tileHeight)
Creates a shape spatial index in one call.
|
static void |
CreateShapeSpatialIndex(String shpFilename,
String targetFileName,
int numColumns,
int numRows)
Creates a shape spatial index in one call.
|
double |
getColumnCount()
Returns the number of columns.
|
int |
getCurrentCount()
Returns the number of objects currently processed.
|
int |
getFeatureCount()
Returns the total number of objects to process, or
0
if the index file could not be opened. |
IlvCoordinate |
getLowerRightCorner()
Returns the lower right coordinate of the bounding box that delimits the objects
contained in the shape file.
|
IlvMapFeature |
getNextFeature()
Returns the next feature from the shape file.
|
IlvCoordinate |
getOrigin()
Returns the origin of the tile grid.
|
double |
getRowCount()
Returns the number of rows.
|
double |
getTileHeight()
Returns the height of a tile in manager coordinates.
|
double |
getTileWidth()
Returns the width of a tile in manager coordinates.
|
IlvCoordinate |
getUpperLeftCorner()
Returns the upper left coordinate of the bounding box that delimits the objects
contained in the shape file.
|
public IlvShapeFileTiler(String shpFilename, String shxFileName, String targetFileName, double tileWidth, double tileHeight) throws IOException
IlvShapeFileTiler
providing
a shapefile name, a shx file name, a target index file name, and a tile size.shpFilename
- The source shape file name.shxFileName
- The name of the shx file, or null
if no
progress information is needed.targetFileName
- The target spatial index file name.tileWidth
- The width of one tile, in manager coordinates.tileHeight
- The height of one tile, in manager coordinates.IOException
public IlvShapeFileTiler(String shpFilename, String shxFileName, String targetFileName, int numColumns, int numRows) throws IOException
IlvShapeFileTiler
providing
a shapefile name, an shx file name, a target index file name, the number of columns,
and the number of rows.shpFilename
- The source shape file name.shxFileName
- The name of the shx file, or null
if no
progress information is needed.targetFileName
- The target spatial index file name.numColumns
- The number of columns.numRows
- The number of rows.IOException
public IlvCoordinate getUpperLeftCorner()
public IlvCoordinate getLowerRightCorner()
public static void CreateShapeSpatialIndex(String shpFilename, String targetFileName, int numColumns, int numRows) throws Exception
shpFilename
- The source shape file name.targetFileName
- The target spatial index file name.numColumns
- The number of columns.numRows
- The number of rows.Exception
public static void CreateShapeSpatialIndex(String shpFilename, String targetFileName, double tileWidth, double tileHeight) throws Exception
shpFilename
- The source shape file name.targetFileName
- The target spatial index file name.tileWidth
- The tile width.tileHeight
- The tile height.Exception
public void addInfo() throws IOException
IOException
public IlvMapFeature getNextFeature() throws IOException
IOException
public void close() throws IOException
IOException
public IlvCoordinate getOrigin()
public double getTileWidth()
public double getTileHeight()
public double getColumnCount()
public double getRowCount()
public int getCurrentCount()
public int getFeatureCount()
0
if the index file could not be opened.© Copyright Rogue Wave Software, Inc. 1997, 2018. All Rights Reserved.