org.geotools.data.arcsde
Class ArcSDEAdapter

java.lang.Object
  extended byorg.geotools.data.arcsde.ArcSDEAdapter

public class ArcSDEAdapter
extends java.lang.Object

Utility class to deal with SDE specifics such as creating SeQuery objects from geotool's Query's, mapping SDE types to Java ones and JTS Geometries, etc.

Version:
$Id: ArcSDEAdapter.java 18116 2006-02-20 17:13:45Z groldan $
Author:
Gabriel Roldan

Constructor Summary
ArcSDEAdapter()
           
 
Method Summary
static com.esri.sde.sdk.client.SeColumnDefinition createSeColumnDefinition(AttributeType type)
          Creates the column definition as used by the ArcSDE Java API, for the given AttributeType.
static FeatureType fetchSchema(ArcSDEConnectionPool connPool, java.lang.String typeName, java.net.URI namespace)
          Fetches the schema of a given ArcSDE featureclass and creates its corresponding Geotools FeatureType
static java.lang.Class getGeometryType(int seShapeType)
          Returns the mapping JTS geometry type for the ArcSDE Shape type given by the bitmask seShapeType This bitmask is composed of a combination of the following shape types, as defined in the ArcSDE Java API: SE_NIL_TYPE_MASK = 1; SE_POINT_TYPE_MASK = 2; SE_LINE_TYPE_MASK = 4; SE_AREA_TYPE_MASK = 16; SE_MULTIPART_TYPE_MASK = 262144; (Note that the type SE_SIMPLE_LINE_TYPE_MASK is not used)
static long getNumericFid(java.lang.String fid)
          Returns the numeric identifier of a FeatureId, given by the full qualified name of the featureclass prepended to the ArcSDE feature id.
static long[] getNumericFids(java.lang.String[] stringFids)
          DOCUMENT ME!
static int guessShapeTypes(GeometryAttributeType attribute)
          DOCUMENT ME!
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ArcSDEAdapter

public ArcSDEAdapter()
Method Detail

guessShapeTypes

public static int guessShapeTypes(GeometryAttributeType attribute)
DOCUMENT ME!

Parameters:
attribute - DOCUMENT ME!
Returns:
DOCUMENT ME!
Throws:
java.lang.NullPointerException - DOCUMENT ME!
java.lang.IllegalArgumentException - DOCUMENT ME!

createSeColumnDefinition

public static com.esri.sde.sdk.client.SeColumnDefinition createSeColumnDefinition(AttributeType type)
                                                                           throws com.esri.sde.sdk.client.SeException
Creates the column definition as used by the ArcSDE Java API, for the given AttributeType.

Parameters:
type - the source attribute definition.
Returns:
an SeColumnDefinition object matching the properties of the source AttributeType.
Throws:
com.esri.sde.sdk.client.SeException - if the SeColumnDefinition constructor throws it due to some invalid parameter

fetchSchema

public static FeatureType fetchSchema(ArcSDEConnectionPool connPool,
                                      java.lang.String typeName,
                                      java.net.URI namespace)
                               throws java.io.IOException
Fetches the schema of a given ArcSDE featureclass and creates its corresponding Geotools FeatureType

Parameters:
connPool - DOCUMENT ME!
typeName - DOCUMENT ME!
Returns:
DOCUMENT ME!
Throws:
java.io.IOException - DOCUMENT ME!
DataSourceException - DOCUMENT ME!

getGeometryType

public static java.lang.Class getGeometryType(int seShapeType)
Returns the mapping JTS geometry type for the ArcSDE Shape type given by the bitmask seShapeType

This bitmask is composed of a combination of the following shape types, as defined in the ArcSDE Java API:

 SE_NIL_TYPE_MASK = 1;
 SE_POINT_TYPE_MASK = 2;
 SE_LINE_TYPE_MASK = 4;
 SE_AREA_TYPE_MASK = 16;
 SE_MULTIPART_TYPE_MASK = 262144;
 
(Note that the type SE_SIMPLE_LINE_TYPE_MASK is not used)

Parameters:
seShapeType - DOCUMENT ME!
Returns:
DOCUMENT ME!
Throws:
java.lang.IllegalArgumentException - DOCUMENT ME!

getNumericFid

public static long getNumericFid(java.lang.String fid)
                          throws java.lang.IllegalArgumentException
Returns the numeric identifier of a FeatureId, given by the full qualified name of the featureclass prepended to the ArcSDE feature id. ej: SDE.SDE.SOME_LAYER.1

Parameters:
fid - a geotools FeatureID
Returns:
an ArcSDE feature ID
Throws:
java.lang.IllegalArgumentException - If the given string is not properly formatted [anystring].[long value]

getNumericFids

public static long[] getNumericFids(java.lang.String[] stringFids)
                             throws java.lang.IllegalArgumentException
DOCUMENT ME!

Parameters:
stringFids - DOCUMENT ME!
Returns:
DOCUMENT ME!
Throws:
java.lang.IllegalArgumentException - DOCUMENT ME!


Copyright © GeoTools. All Rights Reserved.