|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.esri.adf.web.ags.data.edit.util.EditUtil
public class EditUtil
A helper class for ArcObject related functions.
Field Summary | |
---|---|
static String |
NOT_VERSIONED
|
Constructor Summary | |
---|---|
EditUtil()
|
Method Summary | |
---|---|
static com.esri.arcgis.geometry.IGeometry |
addVertex(double searchDistance,
com.esri.arcgis.geometry.IGeometry geom,
com.esri.arcgis.geometry.IPoint point,
com.esri.arcgis.server.IServerContext ctx)
Adds a vertex the geometry if it is in the search distance. |
static com.esri.arcgis.geodatabase.IFeature |
copyFeature(com.esri.arcgis.carto.IFeatureLayer targetLayer,
com.esri.arcgis.geometry.ILine offset,
com.esri.arcgis.geodatabase.IFeature source)
Copies the feature to the target layer and move it with the given offset. |
static com.esri.arcgis.geodatabase.IFeature |
createFeature(com.esri.arcgis.carto.IFeatureLayer editLayer,
com.esri.arcgis.geometry.IGeometry geom)
Creates a geometry to a feature layer. |
static Map<Integer,Attribute> |
getAttributes(com.esri.arcgis.carto.IFeatureLayer fLayer,
com.esri.arcgis.geodatabase.IFeature feature,
AttributeFilter filter,
DateFormat dateFormat)
Gets all the editable attributes on the feature. |
static Map<Integer,Attribute> |
getAttributes(com.esri.arcgis.carto.IFeatureLayer fLayer,
com.esri.arcgis.geodatabase.IFeature feature,
AttributeFilter filter,
DateFormat dateFormat,
LayerDefinition layerDef)
Gets all the editable attributes on the feature. |
static Map<Integer,com.esri.arcgis.carto.IFeatureLayer> |
getFeatureLayers(com.esri.arcgis.carto.IMap map,
com.esri.arcgis.server.IServerContext ctx)
Gets all feature layers from the IMap. |
static com.esri.arcgis.geodatabase.IFeatureCursor |
getFeatures(com.esri.arcgis.carto.IFeatureLayer editLayer,
int[] oids,
com.esri.arcgis.server.IServerContext ctx)
Gets the features by the given object IDs. |
static com.esri.arcgis.geodatabase.IFeatureCursor |
getSelection(com.esri.arcgis.carto.IFeatureLayer editLayer,
com.esri.arcgisws.LayerDescription ldesc,
com.esri.arcgis.geometry.IGeometry geometry,
com.esri.arcgis.server.IServerContext ctx)
Deprecated. As of ArcGIS Java Server 10.0, no replacement. |
static com.esri.arcgis.geodatabase.IFeatureCursor |
getSelection(com.esri.arcgis.carto.IFeatureLayer editLayer,
com.esri.arcgisws.LayerDescription ldesc,
com.esri.arcgis.server.IServerContext ctx)
Gets the selected feature on the given layer. |
static com.esri.arcgis.geometry.ISpatialReference |
getSpatialReference(com.esri.arcgis.carto.IFeatureLayer flayer)
Gets spatial reference from a feature layer. |
static List<String> |
getVersions(com.esri.arcgis.carto.IMap map,
String wsID,
com.esri.arcgis.server.IServerContext ctx)
Retrieves versions from a map's feature layers. |
static String |
getWorkspaceID(com.esri.arcgis.carto.IFeatureLayer layer)
Creates key that uniquely distinguishes workspace connection and feature-class registration. |
static com.esri.arcgis.geodatabase.IFeature |
moveFeature(com.esri.arcgis.geometry.ILine offset,
com.esri.arcgis.geodatabase.IFeature source)
Moves the feature with the given offset. |
static com.esri.arcgis.geometry.IGeometry |
moveVertex(double searchDistance,
com.esri.arcgis.geometry.IGeometry geom,
com.esri.arcgis.geometry.ILine line,
com.esri.arcgis.server.IServerContext ctx)
Moves a vertex from the start point to the end point of the line. |
static com.esri.arcgis.geometry.IGeometry |
removeVertex(double searchDistance,
com.esri.arcgis.geometry.IGeometry geom,
com.esri.arcgis.geometry.IPoint point,
com.esri.arcgis.server.IServerContext ctx)
Removes a vertex the geometry if it is in the search distance. |
static com.esri.arcgis.geodatabase.IFeatureCursor |
search(com.esri.arcgis.geometry.IEnvelope extent,
com.esri.arcgis.carto.IFeatureLayer layer,
com.esri.arcgis.server.IServerContext ctx)
Gets all features on the layer within the given bounds. |
static com.esri.arcgis.geodatabase.IFeature |
simplifyGeometry(com.esri.arcgis.geodatabase.IFeature feature,
com.esri.arcgis.geometry.IGeometry geom)
Simplifies the geometry. |
static List<com.esri.arcgis.geodatabase.IFeature> |
splitLineFeature(com.esri.arcgis.geodatabase.IFeature feature,
com.esri.arcgis.geometry.IPoint pt,
double searchDistance,
com.esri.arcgis.server.IServerContext ctx)
Splits a line feature to two. |
static List<com.esri.arcgis.geodatabase.IFeature> |
splitPolygonFeature(com.esri.arcgis.geodatabase.IFeature feature,
com.esri.arcgis.geometry.IPolyline polyline)
Splits a polygon feature to two. |
static double |
toDistance(int pixels,
com.esri.arcgis.geometry.IEnvelope bounds,
int imageWidth,
com.esri.arcgis.geometry.ISpatialReference refTo)
Converts the screen pixels to map distance in the spatial reference's unit. |
static com.esri.arcgis.geometry.IEnvelope |
toEnvelope(double minx,
double miny,
double maxx,
double maxy,
com.esri.arcgis.geometry.ISpatialReference ref,
com.esri.arcgis.server.IServerContext ctx)
Converts the WebExtent to an Envelope. |
static com.esri.arcgis.geometry.ILine |
toILine(double x1,
double y1,
double x2,
double y2,
com.esri.arcgis.geometry.ISpatialReference ref,
com.esri.arcgis.server.IServerContext ctx)
Creates a ILine from 2 points. |
static com.esri.arcgis.geometry.ILine |
toLine(double x1,
double y1,
double x2,
double y2,
com.esri.arcgis.geometry.ISpatialReference ref,
com.esri.arcgis.server.IServerContext ctx)
Creates a ILine from 2 points. |
static com.esri.arcgis.geometry.IPoint |
toPoint(double x,
double y,
com.esri.arcgis.geometry.ISpatialReference ref,
com.esri.arcgis.server.IServerContext ctx)
Creates a IPoint from x,y. |
static com.esri.arcgis.geometry.ILine |
transformLine(com.esri.arcgis.geometry.ILine geom,
com.esri.arcgis.geometry.ISpatialReference newSpatialReference)
Re-projects the ILine geometry to the given spatial reference. |
static com.esri.arcgis.geodatabase.IFeature |
updateAttribute(com.esri.arcgis.geodatabase.IFeature feature,
Attribute att,
DateFormat dateFormat)
Deprecated. As of ArcGIS Java Server 10.0, no replacement. |
static com.esri.arcgis.geodatabase.IFeature |
updateAttribute(com.esri.arcgis.carto.IFeatureLayer layer,
com.esri.arcgis.geodatabase.IFeature feature,
Attribute att,
DateFormat format)
Updates an attribute value. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final String NOT_VERSIONED
Constructor Detail |
---|
public EditUtil()
Method Detail |
---|
public static com.esri.arcgis.geodatabase.IFeature copyFeature(com.esri.arcgis.carto.IFeatureLayer targetLayer, com.esri.arcgis.geometry.ILine offset, com.esri.arcgis.geodatabase.IFeature source) throws IOException, com.esri.arcgis.interop.AutomationException
IFeature fNew = EditorUtil.copyFeature(workspace.getLayer(), offset, feature); fNew.store();
targetLayer
- the layer to copy to.offset
- the offset of the feature position. Set to null for no offset.source
- the feature to copy.
- Returns:
- the reference of the new Feature.
- Throws:
IOException
- If there are interop problems.
com.esri.arcgis.interop.AutomationException
- If the ArcObject component throws an exception.
public static com.esri.arcgis.geodatabase.IFeature moveFeature(com.esri.arcgis.geometry.ILine offset, com.esri.arcgis.geodatabase.IFeature source) throws IOException, com.esri.arcgis.interop.AutomationException
IFeature fNew = EditorUtil.copyFeature(workspace.getLayer(), offset, feature); fNew.store();
offset
- the offset of the feature position. Set to null for no offset.source
- the feature to copy.
- Returns:
- the reference of the new Feature.
- Throws:
IOException
- If there are interop problems.
com.esri.arcgis.interop.AutomationException
- If the ArcObject component throws an exception.
public static com.esri.arcgis.geodatabase.IFeature createFeature(com.esri.arcgis.carto.IFeatureLayer editLayer, com.esri.arcgis.geometry.IGeometry geom) throws Exception
editLayer
- a feature layergeom
- geometry
Exception
public static com.esri.arcgis.geodatabase.IFeatureCursor getSelection(com.esri.arcgis.carto.IFeatureLayer editLayer, com.esri.arcgisws.LayerDescription ldesc, com.esri.arcgis.server.IServerContext ctx) throws Exception
editLayer
- the layer to search.
IOException
com.esri.arcgis.interop.AutomationException
Exception
public static com.esri.arcgis.geodatabase.IFeatureCursor getFeatures(com.esri.arcgis.carto.IFeatureLayer editLayer, int[] oids, com.esri.arcgis.server.IServerContext ctx) throws Exception
editLayer
- the layer to search.
Exception
public static String getWorkspaceID(com.esri.arcgis.carto.IFeatureLayer layer)
layer
- target feature layer.
public static Map<Integer,com.esri.arcgis.carto.IFeatureLayer> getFeatureLayers(com.esri.arcgis.carto.IMap map, com.esri.arcgis.server.IServerContext ctx) throws Exception
map
- the IMap instance.ctx
- server context
Exception
public static com.esri.arcgis.geometry.IEnvelope toEnvelope(double minx, double miny, double maxx, double maxy, com.esri.arcgis.geometry.ISpatialReference ref, com.esri.arcgis.server.IServerContext ctx) throws Exception
ctx
- set to null to use ArcObject.
Exception
public static com.esri.arcgis.geometry.IPoint toPoint(double x, double y, com.esri.arcgis.geometry.ISpatialReference ref, com.esri.arcgis.server.IServerContext ctx) throws Exception
ctx
- set to null to use ArcObject.
Exception
public static com.esri.arcgis.geometry.ILine toLine(double x1, double y1, double x2, double y2, com.esri.arcgis.geometry.ISpatialReference ref, com.esri.arcgis.server.IServerContext ctx) throws Exception
ctx
- set to null to use ArcObject.
Exception
public static com.esri.arcgis.geodatabase.IFeatureCursor search(com.esri.arcgis.geometry.IEnvelope extent, com.esri.arcgis.carto.IFeatureLayer layer, com.esri.arcgis.server.IServerContext ctx) throws Exception
extent
- the search boundslayer
- the layer to searchctx
- server context
Exception
public static com.esri.arcgis.geometry.ILine toILine(double x1, double y1, double x2, double y2, com.esri.arcgis.geometry.ISpatialReference ref, com.esri.arcgis.server.IServerContext ctx) throws Exception
Exception
public static Map<Integer,Attribute> getAttributes(com.esri.arcgis.carto.IFeatureLayer fLayer, com.esri.arcgis.geodatabase.IFeature feature, AttributeFilter filter, DateFormat dateFormat) throws Exception
fLayer
- the layer from which the feature retrieved.feature
- the feature from which the attributes retrieved.filter
- to control how to display attributes.dateFormat
- to format date type attribute. Set to null to use the default date and time format.
Exception
public static Map<Integer,Attribute> getAttributes(com.esri.arcgis.carto.IFeatureLayer fLayer, com.esri.arcgis.geodatabase.IFeature feature, AttributeFilter filter, DateFormat dateFormat, LayerDefinition layerDef) throws Exception
fLayer
- the layer from which the feature retrieved.feature
- the feature from which the attributes retrieved.filter
- to control how to display attributes.dateFormat
- to format date type attribute. Set to null to use the default date and time format.layerDef
- the layerDefinition defined in faces-config.xml
Exception
public static com.esri.arcgis.geodatabase.IFeature updateAttribute(com.esri.arcgis.geodatabase.IFeature feature, Attribute att, DateFormat dateFormat) throws Exception
feature
- the feature to updateatt
- the changed attribute.dateFormat
- the parse the date string. Set to null to use the default date and time format.
Exception
public static com.esri.arcgis.geodatabase.IFeature updateAttribute(com.esri.arcgis.carto.IFeatureLayer layer, com.esri.arcgis.geodatabase.IFeature feature, Attribute att, DateFormat format) throws Exception
layer
- the layer of the feature.feature
- the feature to updateatt
- the changed attribute.format
- the parse the date string. Set to null to use the default date and time format.
Exception
public static com.esri.arcgis.geometry.IGeometry addVertex(double searchDistance, com.esri.arcgis.geometry.IGeometry geom, com.esri.arcgis.geometry.IPoint point, com.esri.arcgis.server.IServerContext ctx) throws Exception
searchDistance
- the search distance in unit of geometry spatial reference.geom
- the geom to hit.point
- the vertex point
Exception
public static com.esri.arcgis.geometry.ISpatialReference getSpatialReference(com.esri.arcgis.carto.IFeatureLayer flayer) throws IOException, com.esri.arcgis.interop.AutomationException
flayer
- the layer
IOException
com.esri.arcgis.interop.AutomationException
public static double toDistance(int pixels, com.esri.arcgis.geometry.IEnvelope bounds, int imageWidth, com.esri.arcgis.geometry.ISpatialReference refTo) throws IOException, com.esri.arcgis.interop.AutomationException
pixels
- the pixel value.bounds
- the map bounds.imageWidth
- the map width in pixels.refTo
- the spatial reference of the target layer or map.
IOException
- If there are interop problems.
com.esri.arcgis.interop.AutomationException
- If the ArcObject component throws an exception.public static com.esri.arcgis.geometry.IGeometry moveVertex(double searchDistance, com.esri.arcgis.geometry.IGeometry geom, com.esri.arcgis.geometry.ILine line, com.esri.arcgis.server.IServerContext ctx) throws Exception
searchDistance
- the search distance in geometry's unit.geom
- the target geometryline
- the line to move along with.
Exception
public static com.esri.arcgis.geodatabase.IFeature simplifyGeometry(com.esri.arcgis.geodatabase.IFeature feature, com.esri.arcgis.geometry.IGeometry geom) throws Exception
feature
- the feature to setgeom
- the geometry to simplify
Exception
public static com.esri.arcgis.geometry.IGeometry removeVertex(double searchDistance, com.esri.arcgis.geometry.IGeometry geom, com.esri.arcgis.geometry.IPoint point, com.esri.arcgis.server.IServerContext ctx) throws Exception
searchDistance
- the search distance in unit of geometry spatial reference.geom
- the geom to hit.point
- the vertex point
Exception
public static List<com.esri.arcgis.geodatabase.IFeature> splitLineFeature(com.esri.arcgis.geodatabase.IFeature feature, com.esri.arcgis.geometry.IPoint pt, double searchDistance, com.esri.arcgis.server.IServerContext ctx) throws Exception
feature
- the feature to splitpt
- the split pointsearchDistance
- the search tolerance.
Exception
public static List<com.esri.arcgis.geodatabase.IFeature> splitPolygonFeature(com.esri.arcgis.geodatabase.IFeature feature, com.esri.arcgis.geometry.IPolyline polyline) throws Exception
feature
- the feature to splitpolyline
- the split line.
Exception
public static com.esri.arcgis.geodatabase.IFeatureCursor getSelection(com.esri.arcgis.carto.IFeatureLayer editLayer, com.esri.arcgisws.LayerDescription ldesc, com.esri.arcgis.geometry.IGeometry geometry, com.esri.arcgis.server.IServerContext ctx) throws Exception
editLayer
- the layer to search.
IOException
com.esri.arcgis.interop.AutomationException
Exception
public static List<String> getVersions(com.esri.arcgis.carto.IMap map, String wsID, com.esri.arcgis.server.IServerContext ctx) throws Exception
map
- the source map.wsID
- the optional workspace id.
Exception
public static com.esri.arcgis.geometry.ILine transformLine(com.esri.arcgis.geometry.ILine geom, com.esri.arcgis.geometry.ISpatialReference newSpatialReference) throws Exception
geom
- the ILine geometry to transformnewSpatialReference
- the spatial reference to transform.
Exception
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |