|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.deegree_impl.io.sdeapi.SpatialQuery
This class handles a complete ArcSDE request: If instanciated, the class can open a connection/instance of the specified ArcSDE server, set a bounding box as a spatial filter to query the defined layer. The resultset of the query contains the geometries as well as the tabular data associated with them. The table is stored as a deegree Table object whereas the geometries are stored as an array of deegree GM_Objects. Depending on the datatype of the geometries, the array of GM_Objects might be GM_Point, GM_Curve etc.
Some bits of sample code to create a query:
SpatialQuery sq = new SpatialQuery();
try {
sq.openConnection(server, instance, database, user, password);
sq.setLayer(layer);
sq.setSpatialFilter(minX, minY, maxX, maxY);
sp.runSpatialQuery();
GM_Object[] deegree_gm_obj = sq.getGeometries();
Table deegree_table = sq.getTable();
sq.closeConnection();
} catch ( SeException sexp ) {
System.out.println("SeException : " + sexp.getSeError().getErrDesc());
}
Field Summary | |
private SeConnection |
conn
|
private GM_Object[] |
deegreeGM_Objects
|
private SeLayer |
layer
|
private SeShape |
spatialFilter
|
private SeTable |
table
|
Constructor Summary | |
SpatialQuery(java.lang.String server,
int port,
java.lang.String database,
java.lang.String user,
java.lang.String password)
Creates a new SpatialQuery object. |
Method Summary | |
void |
closeConnection()
Close the current connection to the ArcSDE server throws SeException |
private void |
createGeometry(SeShape shape,
java.util.ArrayList list)
CreateGeometry - used with every row of the SpatialQuery Depending on the layers' geometries datatype different operations are made to create the appropriate object. |
GM_Object[] |
getGeometries()
Get GM_Object[] containing the queried Geometries returns null if no query has been done yet. |
SeLayer |
getLayer()
Get the current SDE layer returns null if it not yet set. |
SeShape |
getSpatialFilter()
Get the current Spatial Filter returns null if it not yet set. |
private Table |
initTable(SeRow row)
Initialize Table object - used with first row of the SpatialQuery This method sets the TableName, TableColumnNames and their DataTypes throws SeException |
void |
openConnection(java.lang.String server,
int port,
java.lang.String database,
java.lang.String user,
java.lang.String password)
Connect to the ArcSDE server throws SeException |
Table |
runSpatialQuery(java.lang.String[] cols)
Runs a spatial query against the opened layer using the specified spatial filter. |
void |
setLayer(java.lang.String layername)
Set a SDE layer to work on and appropriate table throws SeException |
void |
setSpatialFilter(double minx,
double miny,
double maxx,
double maxy)
Set a SpatialFilter to Query (BoundingBox) throws SeException |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
private SeConnection conn
private SeLayer layer
private SeShape spatialFilter
private SeTable table
private GM_Object[] deegreeGM_Objects
Constructor Detail |
public SpatialQuery(java.lang.String server, int port, java.lang.String database, java.lang.String user, java.lang.String password) throws SeException
server
- port
- database
- user
- password
-
SeException
Method Detail |
public void openConnection(java.lang.String server, int port, java.lang.String database, java.lang.String user, java.lang.String password) throws SeException
SeException
public void closeConnection() throws SeException
SeException
public void setLayer(java.lang.String layername) throws SeException
SeException
public SeLayer getLayer()
public void setSpatialFilter(double minx, double miny, double maxx, double maxy) throws SeException
SeException
public SeShape getSpatialFilter()
public GM_Object[] getGeometries()
public Table runSpatialQuery(java.lang.String[] cols) throws SeException
SeException
private Table initTable(SeRow row) throws SeException
SeException
private void createGeometry(SeShape shape, java.util.ArrayList list) throws SeException
SeException
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |