|
||||||||||
| PREV CLASS Documentation homepage NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectilog.views.maps.format.shapefile.IlvShapeFileTiler
public class IlvShapeFileTiler
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() != null) {
updateProgressBar();
tiler.addInfo();
}
tiler.close();
| Constructor Summary | |
|---|---|
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. |
|
| Method Summary | |
|---|---|
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. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
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| Method Detail |
|---|
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
IOExceptionpublic 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.
|
||||||||||
| PREV CLASS Documentation homepage NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||