Title: Arc: Getting Data
1Arc Getting Data
2Getting Data/Features from Layers
- Assign your Layer to an appropriate Interface.
- IGeoFeatureLayer Treat as geographical data
- IFeatureLayer Treat as a general Layer
- IAttributeTable Treat as an attribute table
- Get the Attribute Table or search the Layer.
3Getting data
- Once we have our Layer, we want to get data from
it.
Map
AttributeTable
FID Data
1 234
2 875
Layer
Feature
234
Values
4Getting the Attribute Table
- Assuming we have a Layer Enumeration, we set the
Layer to an IAttributeTable. - import com.esri.arcgis.geodatabase.
- IAttributeTable pAttributeTable
- (IAttributeTable) enumLayer.next()
-
- ITable table pAttributeTable.getAttributeTable()
-
- IRow row null
-
- for (int i 1 i lt table.rowCount(null) i)
- row table.getRow(i)
- int index table.findField("School")
- Object value row.getValue(index)
5Getting the Attribute Table
IAttributeTable pAttributeTable
(IAttributeTable) enumLayer.next()
ITable table pAttributeTable.getAttributeTable
() IRow row null for (int i
1 i lt table.rowCount(null) i) row
table.getRow(i) int index
table.findField("School") Object value
row.getValue(index)
6Getting data
- Alternative is to get data from a Feature.
Map
AttributeTable
FID Data
1 234
2 875
Layer
Feature
234
Values
First though, we need to get only the features we
are interested in. We can search for these.