本文整理汇总了Java中com.esri.arcgis.geodatabase.IRow.getValue方法的典型用法代码示例。如果您正苦于以下问题:Java IRow.getValue方法的具体用法?Java IRow.getValue怎么用?Java IRow.getValue使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.esri.arcgis.geodatabase.IRow
的用法示例。
在下文中一共展示了IRow.getValue方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: analyzeTable
import com.esri.arcgis.geodatabase.IRow; //导入方法依赖的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;
}
示例2: analyzeProcedureTable
import com.esri.arcgis.geodatabase.IRow; //导入方法依赖的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;
}
示例3: createResultValue
import com.esri.arcgis.geodatabase.IRow; //导入方法依赖的package包/类
/**
*
* @param row
* @param fields
* @return
* @throws IOException
* @throws AutomationException
*/
protected MeasureResult createResultValue(IRow row,
List<String> fields) throws AutomationException, IOException
{
// start time
Date startDate = (Date) row.getValue(fields.indexOf(AccessGDBImpl.concatTableAndField(Table.VALUE, SubField.VALUE_DATETIME_BEGIN)));
ITimePosition startTimePos = TimeConverter.createTimeFromDate(startDate, null);
// end time
Date endDate = (Date) row.getValue(fields.indexOf(AccessGDBImpl.concatTableAndField(Table.VALUE, SubField.VALUE_DATETIME_END)));
ITimePosition endTimePos = TimeConverter.createTimeFromDate(endDate, null);
// validity
String validity = (String) row.getValue(fields.indexOf(AccessGDBImpl.concatTableAndField(Table.VALIDITY, SubField.VALIDITY_NOTATION)));
if (validity == null) {
validity = Constants.NULL_VALUE;
}
// verification
String verification = (String) row.getValue(fields.indexOf(AccessGDBImpl.concatTableAndField(Table.VERIFICATION, SubField.VERIFICATION_NOTATION)));
if (verification == null) {
verification = Constants.NULL_VALUE;
}
//aggregationType
String aggregationType = (String) row.getValue(fields.indexOf(AccessGDBImpl.concatTableAndField(Table.AGGREGATIONTYPE, SubField.AGGREGATIONTYPE_NOTATION)));
if (aggregationType == null) {
aggregationType = Constants.NULL_VALUE;
}
// result
Object numValue = row.getValue(fields.indexOf(AccessGDBImpl.concatTableAndField(Table.VALUE, SubField.VALUE_VALUE_NUMERIC)));
Double value = (Double) numValue;
return new MeasureResult(startTimePos, endTimePos, validity, verification, aggregationType, value);
}
示例4: getProceduresWithIdAndResource
import com.esri.arcgis.geodatabase.IRow; //导入方法依赖的package包/类
/**
* This method returns all {@link Procedure}s for the identifiers given in the procedureIdentifierArray.
* HOWEVER: this method only fills the ID and RESOURCE attributes of the Procedures.
* REASON: much better performance AND more information in the end not needed.
*/
public Collection<Procedure> getProceduresWithIdAndResource(String[] procedureIdentifierArray) throws AutomationException, IOException
{
// set tables
List<String> tables = new ArrayList<String>();
tables.add(Table.PROCEDURE);
// LOGGER.info("Table clause := " + queryDef.getTables());
// set sub fields
List<String> subFields = new ArrayList<String>();
subFields.add(AccessGDBImpl.concatTableAndField(Table.PROCEDURE, SubField.PROCEDURE_ID));
subFields.add(AccessGDBImpl.concatTableAndField(Table.PROCEDURE, SubField.PROCEDURE_RESOURCE));
// LOGGER.info("Subfields clause := " + queryDef.getSubFields());
StringBuilder whereClause = new StringBuilder();
if (procedureIdentifierArray != null) {
whereClause.append(AccessGDBImpl.createOrClause(AccessGDBImpl.concatTableAndField(Table.PROCEDURE, SubField.PROCEDURE_ID), procedureIdentifierArray));
}
// LOGGER.info(queryDef.getWhereClause());
// evaluate the database query
ICursor cursor = DatabaseUtils.evaluateQuery(AccessGDBImpl.createCommaSeparatedList(tables),
whereClause.toString(), AccessGDBImpl.createCommaSeparatedList(subFields),
gdb);
IRow row;
List<Procedure> procedures = new ArrayList<Procedure>();
while ((row = cursor.nextRow()) != null) {
String id = row.getValue(subFields.indexOf(AccessGDBImpl.concatTableAndField(Table.PROCEDURE, SubField.PROCEDURE_ID))).toString();
String resource = (String) row.getValue(subFields.indexOf(AccessGDBImpl.concatTableAndField(Table.PROCEDURE, SubField.PROCEDURE_RESOURCE)));
procedures.add(new Procedure(id, resource));
}
return procedures;
}
示例5: createMultiValueObservation
import com.esri.arcgis.geodatabase.IRow; //导入方法依赖的package包/类
protected MultiValueObservation createMultiValueObservation(IRow row,
List<String> fields) throws IOException
{
// Identifier
String obsID = row.getValue(fields.indexOf(AccessGDBImpl.concatTableAndField(Table.OBSERVATION, SubField.OBSERVATION_ID))).toString();
Identifier obsIdentifier = new Identifier(null, obsID);
// procedure
String procID = (String) row.getValue(fields.indexOf(AccessGDBImpl.concatTableAndField(Table.PROCEDURE, SubField.PROCEDURE_RESOURCE)));
if (procID == null) {
procID = Constants.NULL_VALUE;
}
// observed property
String obsPropID = (String) row.getValue(fields.indexOf(AccessGDBImpl.concatTableAndField(Table.PROPERTY, SubField.PROPERTY_ID)));
if (obsPropID == null) {
obsPropID = Constants.NULL_VALUE;
}
// featureOfInterest
String featureID = (String) row.getValue(fields.indexOf(AccessGDBImpl.concatTableAndField(Table.FEATUREOFINTEREST, SubField.FEATUREOFINTEREST_RESOURCE)));
if (featureID == null) {
featureID = Constants.NULL_VALUE;
}
// samplingFeature
String samplingPointID = (String) row.getValue(fields.indexOf(AccessGDBImpl.concatTableAndField(Table.SAMPLINGPOINT, SubField.SAMPLINGPOINT_RESOURCE)));
// in case "resource" field is null, "id" field is used:
if (samplingPointID == null || samplingPointID.equals("")) {
samplingPointID = (String) row.getValue(fields.indexOf(AccessGDBImpl.concatTableAndField(Table.SAMPLINGPOINT, SubField.SAMPLINGPOINT_ID)));
}
// unit ID
String unitID = (String) row.getValue(fields.indexOf(AccessGDBImpl.concatTableAndField(Table.UNIT, SubField.UNIT_ID)));
if (unitID == null) {
unitID = Constants.NULL_VALUE;
}
// unit notation
String unitNotation = (String) row.getValue(fields.indexOf(AccessGDBImpl.concatTableAndField(Table.UNIT, SubField.UNIT_NOTATION)));
if (unitNotation == null) {
unitNotation = Constants.NULL_VALUE;
}
// unit notation
String unitLabel = (String) row.getValue(fields.indexOf(AccessGDBImpl.concatTableAndField(Table.UNIT, SubField.UNIT_LABEL)));
if (unitLabel == null) {
unitLabel = Constants.NULL_VALUE;
}
// aggregation type
String aggregationType = (String) row.getValue(fields.indexOf(AccessGDBImpl.concatTableAndField(Table.AGGREGATIONTYPE, SubField.AGGREGATIONTYPE_DEFINITION)));
if (aggregationType == null) {
aggregationType = Constants.NULL_VALUE;
}
// result time
Date resultDate = (Date) row.getValue(fields.indexOf(AccessGDBImpl.concatTableAndField(Table.VALUE, SubField.VALUE_RESULTTIME)));
ITimePosition resultTimePos = TimeConverter.createTimeFromDate(resultDate, null);
return new MultiValueObservation(obsIdentifier, procID, obsPropID, featureID, samplingPointID, unitID, unitNotation, unitLabel, aggregationType, resultTimePos);
}
示例6: uniqueValueRenderer
import com.esri.arcgis.geodatabase.IRow; //导入方法依赖的package包/类
/**
* The method creates UniqueValueRenderer object and attach it to the map.
*/
private void uniqueValueRenderer() {
try {
IUniqueValueRenderer pUniqueValueRenderer = new UniqueValueRenderer();
ITable pTable = featureLayer;
int fieldNumber = pTable.findField(textNameField);
if (fieldNumber == -1) {
System.out.println("Can't find field : " + textNameField);
return;
}
pUniqueValueRenderer.setFieldCount(1);
pUniqueValueRenderer.setField(0, textNameField);
IRandomColorRamp pColorRamp = new RandomColorRamp();
pColorRamp.setStartHue(0);
pColorRamp.setMinValue(99);
pColorRamp.setMaxSaturation(15);
pColorRamp.setEndHue(360);
pColorRamp.setMaxValue(100);
pColorRamp.setMaxSaturation(30);
pColorRamp.setSize(100);
boolean rampBool[] = new boolean[1];
rampBool[0] = true;
pColorRamp.createRamp(rampBool);
IEnumColors pEnumRamp = pColorRamp.getColors();
IQueryFilter pQueryFilter = new QueryFilter();
pQueryFilter.addField(textNameField);
ICursor pCursor = pTable.ITable_search(pQueryFilter, true);
IRow pNextRow = pCursor.nextRow();
while (pNextRow != null) {
IRow pNextRowBuffer = pNextRow;
Object codeValue = pNextRowBuffer.getValue(fieldNumber);
IColor pNextUniqueColor = pEnumRamp.next();
if (pNextUniqueColor == null) {
pEnumRamp.reset();
pNextUniqueColor = pEnumRamp.next();
}
IFillSymbol pSym = new SimpleFillSymbol();
int k=pNextUniqueColor.getRGB();
System.out.println(k);
pSym.setColor(pNextUniqueColor);
System.out.println("addvalue:"+codeValue+","+codeValue);
pUniqueValueRenderer.addValue((String) codeValue, (String) codeValue, (ISymbol) pSym);
pNextRow = pCursor.nextRow();
}
featureLayer.setRendererByRef((IFeatureRenderer) pUniqueValueRenderer);
mapControl.refresh(esriViewDrawPhase.esriViewGeography, null, null);
System.out.println("Unique Value Renderer");
} catch (java.lang.Exception ex) {
System.out.println("Unique Value Renderer:" + ex);
}
}