public class ConstraintReaderShapefile extends Object implements Closeable
Constructor and Description |
---|
ConstraintReaderShapefile(File file)
Constructs an instance tied to the specified file.
|
Modifier and Type | Method and Description |
---|---|
void |
close() |
ICoordinateTransform |
getCoordinateTransform()
Gets the coordinate transform associated with this instance.
|
int |
getTotalPointCount()
Gets the total number of points read from the constraint file; or zero if
the content of the constraint file hasn't been read.
|
List<IConstraint> |
read()
Read constraints from a Shapefile.
|
void |
setCoordinateTransform(ICoordinateTransform transform)
Sets a coordinate transform to be used for mapping values from the source
file to vertex coordinates.
|
void |
setDbfFieldForAppData(String dbfFieldForAppData)
Sets the name of the field in the DBF file to use as a source for
application data when creating constraints.
|
void |
setDbfFieldForZ(String dbfFieldForZ)
Sets the name of the field in the DBF file to use as a source for Z
coordinates for data.
|
void |
setVerticalCoordinateTransform(IVerticalCoordinateTransform verticalTransform)
Sets the vertical coordinate transform to be used when reading the
file (if any).
|
static void |
writeConstraintFile(File file,
List<IConstraint> list)
Writes a text file representing the content of the specified list of
constraints
|
static void |
writeConstraintFile(Path path,
List<IConstraint> list)
Writes a text file representing the content of the specified list of
constraints
|
public ConstraintReaderShapefile(File file) throws IOException
file
- a valid file reference pointing to a Shapefile.IOException
- if the specified Shapefile cannot be accessed.public List<IConstraint> read() throws IOException
IOException
- in the event of an unrecoverable IO condition.public int getTotalPointCount()
public static void writeConstraintFile(File file, List<IConstraint> list) throws IOException
file
- the output file referencelist
- a valid list of constraintsIOException
- in the event of a non-recoverable I/O conditionpublic static void writeConstraintFile(Path path, List<IConstraint> list) throws IOException
path
- the path for writing the filelist
- a valid list of constraintsIOException
- in the event of a non-recoverable I/O conditionpublic ICoordinateTransform getCoordinateTransform()
public void setCoordinateTransform(ICoordinateTransform transform)
transform
- a valid transform or a null if none is to be applied.public void setVerticalCoordinateTransform(IVerticalCoordinateTransform verticalTransform)
verticalTransform
- a valid instance if a transform is to be
applies; a null reference if no transform is required.public void setDbfFieldForZ(String dbfFieldForZ)
dbfFieldForZ
- a valid string, or a null to use the Z coordinates from
the Shapefile geometry file (the 0shp file).public void setDbfFieldForAppData(String dbfFieldForAppData)
dbfFieldForAppData
- a valid string, or a null to use the the
Shapefile record number as the application data.public void close() throws IOException
close
in interface Closeable
close
in interface AutoCloseable
IOException
Copyright © 2021. All rights reserved.