本文整理汇总了Java中com.esri.arcgis.interop.AutomationException类的典型用法代码示例。如果您正苦于以下问题:Java AutomationException类的具体用法?Java AutomationException怎么用?Java AutomationException使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
AutomationException类属于com.esri.arcgis.interop包,在下文中一共展示了AutomationException类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getSchema
import com.esri.arcgis.interop.AutomationException; //导入依赖的package包/类
@Override
public String getSchema() throws IOException, AutomationException {
try {
JSONObject mySOE = ServerUtilities.createResource(
"My SOE", "A simple template server object extension", false, false);
JSONArray subResourcesArray = new JSONArray();
subResourcesArray.put(ServerUtilities.createResource("hello",
"Hello resource", false, false));
mySOE.put("resources", subResourcesArray);
return mySOE.toString();
} catch (JSONException e) {
getLogger().debug(e.getMessage());
return ServerUtilities.sendError(500,
"Exception occurred: " + e.getMessage(), null);
}
}
示例2: delegateRestRequestToHandler
import com.esri.arcgis.interop.AutomationException; //导入依赖的package包/类
protected RestResponse delegateRestRequestToHandler(RestRequest request)
throws IOException, AutomationException {
IRESTRequestHandler restRequestHandler = findRestRequestHandlerDelegate();
if (restRequestHandler != null) {
logger.debug("Forwarding request to handler: {}", request);
String[] responseProperties = new String[1];
byte[] responseBody = restRequestHandler.handleRESTRequest(
request.getCapabilities(), request.getResourceName(),
request.getOperationName(), request.getOperationInput(),
request.getOutputFormat(), request.getRequestProperties(),
responseProperties);
return new RestResponse(responseProperties[0], responseBody);
} else {
throw new ServerObjectExtensionException(
"Cannot find the correct REST request handler delegate.");
}
}
示例3: getVIdx
import com.esri.arcgis.interop.AutomationException; //导入依赖的package包/类
/**
* 获取V值字段的Index
* @return
* @throws AutomationException
* @throws IOException
*/
protected int getVIdx() throws AutomationException, IOException
{
int vIdx = simplePoint.getFields().findField(VFieldName);
if (vIdx == -1) {
Field field = new Field();
IFieldEdit edit = new IFieldEditProxy(field);
edit.setAliasName(VFieldName);
edit.setName(VFieldName);
edit.setType(esriFieldType.esriFieldTypeDouble);
simplePoint.addField(field);
vIdx = simplePoint.findField(VFieldName);
}
return vIdx;
}
示例4: getSchema
import com.esri.arcgis.interop.AutomationException; //导入依赖的package包/类
/**
* This method returns the resource hierarchy of a REST based SOE in JSON
* format.
*/
@Override
public String getSchema() throws IOException, AutomationException
{
LOGGER.verbose("getSchema() is called...");
JSONObject arcGisSos = ServerUtilities.createResource("DB_Analyzer_for_ArcGIS_SOS_Extension", "A_DBAnalyzer_for_the_SOS_extension_for_ArcGIS_Server", false, false);
JSONArray operationArray = new JSONArray();
JSONObject tableNamesObject = ServerUtilities.createResource("ReadTableNamesFromDB", "reads all table names from DB", false, false);
JSONObject analyzeProcedureTableObject = ServerUtilities.createResource("AnalyzeTableUsingProperties", "analyzes a specified table", false, false);
// operationArray.put(ServerUtilities.createOperation("ReadTableNamesFromDB", "db", "json", false));
operationArray.put(ServerUtilities.createOperation("AnalyzeTable", "tableName", "json", false));
// operationArray.put(ServerUtilities.createOperation("AnalyzeProcedureTable", "bla", "json", false));
JSONArray resourceArray = new JSONArray();
resourceArray.put(tableNamesObject);
resourceArray.put(analyzeProcedureTableObject);
arcGisSos.put("resources", resourceArray);
// arcGisSos.put("operations", operationArray);
return arcGisSos.toString();
}
示例5: getCheckFieldIdx
import com.esri.arcgis.interop.AutomationException; //导入依赖的package包/类
public int getCheckFieldIdx(IFeatureClass fc) throws AutomationException, IOException
{
int vIdx = fc.getFields().findField(checkFieldStr);
if (vIdx == -1) {
Field field = new Field();
IFieldEdit edit = new IFieldEditProxy(field);
edit.setAliasName(checkFieldStr);
edit.setName(checkFieldStr);
edit.setType(esriFieldType.esriFieldTypeDouble);
fc.addField(field);
vIdx = fc.findField(checkFieldStr);
}
return vIdx;
}
示例6: getArea
import com.esri.arcgis.interop.AutomationException; //导入依赖的package包/类
/**
* 获取定级范围面积
*
* @return 定级范围面积
* @throws AutomationException
* @throws IOException
*/
public double getArea() throws AutomationException, IOException {
int featureCount = getFeatureClass().featureCount(null);
double area = 0;
IArea temp;
for (int i = 0; i < featureCount; i++) {
IGeometry g = getFeatureClass().getFeature(i).getShape();
IPolygon ploygon = new IPolygonProxy(g);
temp = new IAreaProxy(ploygon);
area += temp.getArea();
}
return area;
}
示例7: getObservationMaxID
import com.esri.arcgis.interop.AutomationException; //导入依赖的package包/类
/**
* @return the maximum ObjectID of all observations.
* @throws IOException
* @throws AutomationException
*/
public int getObservationMaxID() throws AutomationException, IOException
{
// TODO: insert observation needs to be adjusted to new AQ e-Reporting data model
throw new UnsupportedOperationException();
// IQueryDef queryDef = gdb.getWorkspace().createQueryDef();
//
// queryDef.setTables(Table.OBSERVATION);
//
// queryDef.setSubFields("MAX(" + SubField.OBSERVATION_OBJECTID + ")");
//
// // evaluate the database query
// ICursor cursor = queryDef.evaluate();
//
// IRow row = cursor.nextRow();
//
// return (Integer) row.getValue(0);
}
示例8: analyzeTable
import com.esri.arcgis.interop.AutomationException; //导入依赖的package包/类
/**
* @throws IOException
* @throws AutomationException
*
*/
public JSONObject analyzeTable (String tableName, String primaryKeyColumn) throws AutomationException, IOException {
JSONObject json = new JSONObject();
try {
ICursor cursor = DatabaseUtils.evaluateQuery(tableName, "", "COUNT(" + primaryKeyColumn + ")",
workspace);
json.append("Reading count of table:", tableName);
IRow row;
if ((row = cursor.nextRow()) != null) {
Object count = row.getValue(0);
String countAsString = count.toString();
json.append("Table count:", countAsString);
}
} catch (Exception e) {
LOGGER.severe(e.getLocalizedMessage(), e);
throw new IOException(e);
}
return json;
}
示例9: analyzeProcedureTable
import com.esri.arcgis.interop.AutomationException; //导入依赖的package包/类
/**
* @throws IOException
* @throws AutomationException
*
*/
public JSONObject analyzeProcedureTable () throws AutomationException, IOException {
JSONObject json = new JSONObject();
json.append("This function: ", "...checks the availability of a table as specified in the properties of this SOE (configure in ArcGIS Server Manager).");
json.append("This function: ", "...and presents the count of rows contained in that table.");
try {
ICursor cursor = DatabaseUtils.evaluateQuery(soe.getTable(), "", "COUNT(" + soe.getTablePkField() + ")", workspace);
json.append("Reading count of table:", soe.getTable());
IRow row;
if ((row = cursor.nextRow()) != null) {
Object count = row.getValue(0);
String countAsString = count.toString();
json.append("Table count:", countAsString);
}
} catch (Exception e) {
LOGGER.severe(e.getLocalizedMessage(), e);
json.append("ERROR:", "while trying to read table '" + soe.getTable() + "' with specified primary key '" + soe.getTablePkField() + "'");
}
return json;
}
示例10: execute
import com.esri.arcgis.interop.AutomationException; //导入依赖的package包/类
public void execute() throws AutomationException, IOException {
int vIdx = getVIdx();
IFeatureCursor cursor = simplePoint.IFeatureClass_update(null, false);
IFeature feature = cursor.nextFeature();
//初始化公式变量
double 总销售价格=0,同类建筑平均造价=0,房屋建筑总面积=0,开发利润=0,销售税费=0,资金利息=0,建筑密度=0,房屋占地面积=0;
double value = 0;
while (feature != null) {
//带入公式计算
//([总销售价格]-([同类建筑平均造价]*[房屋建筑总面积])-[开发利润]-[销售税费]-[资金利息])*([建筑密度]/[房屋占地面积])
总销售价格=Double.parseDouble((feature.getValue(getFieldsIdx("总销售价格"))).toString());
同类建筑平均造价=Double.parseDouble((feature.getValue(getFieldsIdx("同类建筑平均造价"))).toString());
房屋建筑总面积=Double.parseDouble((feature.getValue(getFieldsIdx("房屋建筑总面积"))).toString());
开发利润=Double.parseDouble((feature.getValue(getFieldsIdx("开发利润"))).toString());
销售税费=Double.parseDouble((feature.getValue(getFieldsIdx("销售税费"))).toString());
资金利息=Double.parseDouble((feature.getValue(getFieldsIdx("资金利息"))).toString());
建筑密度=Double.parseDouble((feature.getValue(getFieldsIdx("建筑密度"))).toString());
房屋占地面积=Double.parseDouble((feature.getValue(getFieldsIdx("房屋占地面积"))).toString());
value=(总销售价格-(同类建筑平均造价*房屋建筑总面积)-开发利润-销售税费-资金利息)*(建筑密度/房屋占地面积);
feature.setValue(vIdx, new Double(value));
cursor.updateFeature(feature);
feature = cursor.nextFeature();
}
}
示例11: onMouseUp
import com.esri.arcgis.interop.AutomationException; //导入依赖的package包/类
public void onMouseUp(int arg0, int arg1, int arg2, int arg3)
throws IOException, AutomationException {
if(!inUse)return;
inUse=false;
if(lineSymbol==null)return;
activeView.getScreenDisplay().startDrawing(activeView.getScreenDisplay().getHDC(),(short)-1);
activeView.getScreenDisplay().setSymbol(new ISymbolProxy(textSymbol));
activeView.getScreenDisplay().drawText(tp,textSymbol.getText());
activeView.getScreenDisplay().setSymbol(new ISymbolProxy(lineSymbol));
if(polyline.getLength()>0){
activeView.getScreenDisplay().drawPolyline(polyline);
}
activeView.getScreenDisplay().finishDrawing();
polyline=null;
textSymbol=null;
lineSymbol=null;
tp=null;
}
示例12: isNetwork
import com.esri.arcgis.interop.AutomationException; //导入依赖的package包/类
@Override
public boolean isNetwork(String procedureID) throws AutomationException, IOException {
ICursor cursor = DatabaseUtils.evaluateQuery(Table.NETWORK,
AccessGDBImpl.concatTableAndField(Table.NETWORK, SubField.NETWORK_ID) + " = '" + procedureID + "'",
AccessGDBImpl.concatTableAndField(Table.NETWORK, SubField.NETWORK_ID),
gdb);
IRow row;
while ((row = cursor.nextRow()) != null) {
String networkID = row.getValue(0).toString();
if (networkID != null && networkID.equalsIgnoreCase(procedureID)) {
return true;
}
}
return false;
}
示例13: isProcedure
import com.esri.arcgis.interop.AutomationException; //导入依赖的package包/类
@Override
public boolean isProcedure(String procedureResourceID) throws AutomationException, IOException {
ICursor cursor = DatabaseUtils.evaluateQuery(Table.PROCEDURE,
AccessGDBImpl.concatTableAndField(Table.PROCEDURE, SubField.PROCEDURE_RESOURCE) + " = '" + procedureResourceID + "'",
AccessGDBImpl.concatTableAndField(Table.PROCEDURE, SubField.PROCEDURE_RESOURCE),
gdb);
IRow row;
while ((row = cursor.nextRow()) != null) {
String procedureIdFromDB = row.getValue(0).toString();
if (procedureIdFromDB != null && procedureIdFromDB.equalsIgnoreCase(procedureResourceID)) {
return true;
}
}
return false;
}
示例14: execute
import com.esri.arcgis.interop.AutomationException; //导入依赖的package包/类
public void execute() throws AutomationException, IOException {
int vIdx = getVIdx();
IFeatureCursor cursor = simplePoint.IFeatureClass_update(null, false);
IFeature feature = cursor.nextFeature();
//初始化公式变量
double 出地方纯收入=0,出地方面积=0,土地还原率=0;
double value = 0;
while (feature != null) {
//带入公式计算
//([出地方纯收入]/[出地方面积])*(1/{土地还原率})
出地方纯收入=Double.parseDouble((feature.getValue(getFieldsIdx("出地方纯收入"))).toString());
出地方面积=Double.parseDouble((feature.getValue(getFieldsIdx("出地方面积"))).toString());
土地还原率=getPPValue("土地还原率");
value=(出地方纯收入/出地方面积)*(1/土地还原率);
feature.setValue(vIdx, new Double(value));
cursor.updateFeature(feature);
feature = cursor.nextFeature();
}
}
示例15: execute
import com.esri.arcgis.interop.AutomationException; //导入依赖的package包/类
public void execute() throws AutomationException, IOException {
int vIdx = getVIdx();
IFeatureCursor cursor = simplePoint.IFeatureClass_update(null, false);
IFeature feature = cursor.nextFeature();
//初始化公式变量
double 取得房屋面积=0,交易总价=0,房屋交易税费=0,房屋面积=0,出让土地面积=0;
double value = 0;
while (feature != null) {
//带入公式计算
//([取得房屋面积]*([交易总价]-[房屋交易税费])/[房屋面积])/[出让土地面积]
取得房屋面积=Double.parseDouble((feature.getValue(getFieldsIdx("取得房屋面积"))).toString());
交易总价=Double.parseDouble((feature.getValue(getFieldsIdx("交易总价"))).toString());
房屋交易税费=Double.parseDouble((feature.getValue(getFieldsIdx("房屋交易税费"))).toString());
房屋面积=Double.parseDouble((feature.getValue(getFieldsIdx("房屋面积"))).toString());
出让土地面积=Double.parseDouble((feature.getValue(getFieldsIdx("出让土地面积"))).toString());
value=(取得房屋面积*(交易总价-房屋交易税费)/房屋面积)/出让土地面积;
feature.setValue(vIdx, new Double(value));
cursor.updateFeature(feature);
feature = cursor.nextFeature();
}
}