|
deegree 2.5 (2011/06/29 09:44 build-8-official) | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.deegree.io.shpapi.ShapeFile
public class ShapeFile
Class representing an ESRI Shape File.
Constructor Summary | |
---|---|
ShapeFile(java.lang.String fileName)
constructor: Construct a ShapeFile from a file name. |
|
ShapeFile(java.lang.String url,
java.lang.String rwflag)
constructor: Construct a ShapeFile from a file name. |
Method Summary | |
---|---|
void |
close()
|
int[] |
getDataLengths()
|
java.lang.String[] |
getDataTypes()
returns the datatype of each column of the database file associated to the shape-file |
java.lang.String[] |
getDataTypes(java.lang.String[] fields)
returns the datatype of each column of the dBase associated to the shape-file specified by fields |
Feature |
getFeatureByRecNo(int RecNo)
Returns the given entry of the shape file as a Feature instance. |
FeatureProperty[] |
getFeatureProperties(FeatureCollection fc,
int n)
Copies the feature properties of a feature. |
Envelope |
getFileMBR()
returns the minimum bounding rectangle of all geometries within the shape-file |
Geometry |
getGeometryByRecNo(int recNo)
returns RecNo'th Geometrie |
int[] |
getGeoNumbersByAttribute(java.lang.String column,
java.lang.Comparable<?> value)
returns a int array that containts all the record numbers that matches the search operation |
int[] |
getGeoNumbersByRect(Envelope r)
returns a ArrayList that contains all geomeries of the shape file which mbr's are completly or partly within the rectangle r only Points, MultiPoints, PolyLines and Polygons are handled |
Envelope |
getMBRByRecNo(int recNo)
returns the minimum bound rectangle of RecNo'th Geometrie |
java.lang.String[] |
getProperties()
returns the properties (column headers) of the dBase-file associated to the shape-file |
int |
getRecordNum()
returns the number of records within a shape-file |
int |
getShapeTypeByRecNo(int RecNo)
returns the type of the RecNo'th Geometrie per definition a shape file contains onlay one shape type but null shapes are possible too! |
boolean |
hasDBaseFile()
returns true if a dBase-file is associated to the shape-file |
boolean |
hasDBaseIndex(java.lang.String column)
returns true if a column is indexed |
boolean |
hasRTreeIndex()
returns true if an R-tree index is associated to the shape-file |
boolean |
isUnique(java.lang.String property)
is a property unique? |
void |
setFeatureType(FeatureType ft,
java.util.Map<PropertyType,java.lang.String> ftMapping)
Overrides the default feature type (which is generated from all columns in the dbase file) to allow customized naming and ordering of properties. |
void |
writeShape(FeatureCollection fc)
writes a OGC FeatureCollection to a ESRI shape file. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public ShapeFile(java.lang.String fileName) throws java.io.IOException
fileName
-
java.io.IOException
public ShapeFile(java.lang.String url, java.lang.String rwflag) throws java.io.IOException
url
- rwflag
-
java.io.IOException
Method Detail |
---|
public void close()
public void setFeatureType(FeatureType ft, java.util.Map<PropertyType,java.lang.String> ftMapping)
ft
- ftMapping
- public boolean hasDBaseIndex(java.lang.String column)
column
-
public boolean hasDBaseFile()
public boolean hasRTreeIndex()
public int getRecordNum()
public Envelope getFileMBR()
public Envelope getMBRByRecNo(int recNo) throws java.io.IOException
recNo
-
java.io.IOException
public Feature getFeatureByRecNo(int RecNo) throws java.io.IOException, HasNoDBaseFileException, DBaseException
Feature
instance.
This contains the geometry as well as the attributes stored into the dbase file. The geometry property will use a default name (app:GEOM).
RecNo
-
java.io.IOException
HasNoDBaseFileException
DBaseException
public Geometry getGeometryByRecNo(int recNo) throws java.io.IOException
recNo
-
java.io.IOException
public int getShapeTypeByRecNo(int RecNo) throws java.io.IOException
RecNo
-
java.io.IOException
public int[] getGeoNumbersByAttribute(java.lang.String column, java.lang.Comparable<?> value) throws java.io.IOException, DBaseIndexException
column
- value
-
java.io.IOException
DBaseIndexException
public int[] getGeoNumbersByRect(Envelope r) throws java.io.IOException
r
-
java.io.IOException
public boolean isUnique(java.lang.String property)
property
-
public java.lang.String[] getProperties() throws HasNoDBaseFileException, DBaseException
HasNoDBaseFileException
DBaseException
public java.lang.String[] getDataTypes() throws HasNoDBaseFileException, DBaseException
HasNoDBaseFileException
DBaseException
public int[] getDataLengths() throws HasNoDBaseFileException, DBaseException
HasNoDBaseFileException
DBaseException
public java.lang.String[] getDataTypes(java.lang.String[] fields) throws HasNoDBaseFileException, DBaseException
fields
-
HasNoDBaseFileException
DBaseException
public FeatureProperty[] getFeatureProperties(FeatureCollection fc, int n)
fc
- n
- the number of the feature to get the properties for
public void writeShape(FeatureCollection fc) throws java.lang.Exception
fc
- FeatureCollection. must not be null or empty.
java.lang.Exception
|
deegree 2.5 (2011/06/29 09:44 build-8-official) | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
an open source project founded by lat/lon, Bonn, Germany.
For more information visit: http://www.deegree.org