public class IlvSHPWriter extends Object
IlvMapFeature
to ESRI Shape files.
The following example shows how to use an IlvSHPWriter
to dump the content of an
IlvFeatureIterator
to a set of Shapefiles (.shp
and the .shx
index file).
// Create the SHP writer. IlvSHPWriter writer = new IlvSHPWriter("foo.shp", "foo.shx"); // Loop on features. IlvMapFeature feature = sourceIterator.getNextFeature(); while (feature != null) { writer.writeFeature(feature); feature = sourceIterator.getNextFeature(); } // Important: close the writer so that the header is written. writer.close();This implementation only writes 2D geometries.
IlvDBFWriter
Constructor and Description |
---|
IlvSHPWriter(String fileName)
Constructs an
IlvSHPWriter to write on the file specified
by its name. |
IlvSHPWriter(String shpFilename,
String shxFilename)
Constructs an
IlvSHPWriter to write on the file specified by its
name. |
Modifier and Type | Method and Description |
---|---|
void |
close()
Closes the files associated to this writer, and writes the headers.
|
IlvCoordinate |
getLowerRightCorner()
Returns the lower right corner of the currently written data.
|
double |
getMaxMeasure()
Returns the maximum measure value of the currently written data.
|
double |
getMinMeasure()
Returns the minimum measure value of the currently written data.
|
int |
getShapeType()
Returns the type of current shape features written.
|
IlvCoordinate |
getUpperLeftCorner()
Returns the upper left corner of the currently written data.
|
double |
getZMax()
Returns the maximum Z value of the currently written data.
|
double |
getZMin()
Returns the minimum Z value of the currently written data.
|
void |
writeFeature(IlvMapFeature feature)
Writes the specified feature to the output of this writer.
|
public IlvSHPWriter(String fileName) throws IOException
IlvSHPWriter
to write on the file specified
by its name.fileName
- The name of the .shp
file.IOException
- If an error occurs.public IlvSHPWriter(String shpFilename, String shxFilename) throws IOException
IlvSHPWriter
to write on the file specified by its
name. When a writer is constructed using this constructor, the
.shx
index file whose name is specified is also created.shpFilename
- The name of the .shp
file.shxFilename
- The name of the .shx
file.IOException
- If an error occurs.public void close() throws IOException
IOException
- If an error occurs.public IlvCoordinate getUpperLeftCorner()
public IlvCoordinate getLowerRightCorner()
public double getMaxMeasure()
public double getMinMeasure()
public double getZMax()
public double getZMin()
public int getShapeType()
IlvSHPReader
public void writeFeature(IlvMapFeature feature) throws IOException
IlvDBFWriter
to
write the attributes of the feature.feature
- The feature.IOException
- If an error occurs.IllegalArgumentException
- If the geometry of the feature is
unknown from this writer.IlvDBFWriter
© Copyright Rogue Wave Software, Inc. 1997, 2018. All Rights Reserved.