featureCursor = featureClass.search(spatFilter, true); ... iFeature = featureCursor.nextFeature(); if iFeature is not null loop through the number of features loop through the number of fields get the value of each field using the index - this is where I have a problem iFeature.getValue(int).toString();
if(iFeature != null){ for(int i = 0; i < recordCount; i++){ for(int j = 0; j < fieldCount; j++){ tempValue = iFeature.getValue(j); tempVarType = iFeature.getFields().getField(j).getVarType(); // check field valueType for Long Integer (3), Double (5), or String (8) // and convert <null> data to appropriate data type value if((tempValue==null)&&(tempVarType==3)){ recordsetfields = "0"; } else if((tempValue==null)&&(tempVarType==5)){ recordsetfields = "0.0"; } else if((tempValue==null)&&(tempVarType==8)){ recordsetfields = ""; } else { recordsetfields = iFeature.getValue(j).toString(); } } ... etc
if(iFeature != null){ for(int i = 0; i < recordCount; i++){ for(int j = 0; j < fieldCount; j++){ tempValue = iFeature.getValue(j); tempVarType = iFeature.getFields().getField(j).getVarType(); System.out.println(iFeature.getFields().getField(j).getName() + " : " + tempValue + " : " + tempVarType); if((tempValue==null)||(tempVarType==1)){ } else { recordsetfields = iFeature.getValue(j).toString(); } }
Les membres connectés peuvent publier, suivre les mises à jour, et plus encore. Nouveau ici ? Inscrivez-vous gratuitement.
Find useful guides, FAQs, and documents to help you navigate and make the most of Esri Community.