ShapefileWorkspaceFactory wsf = new ShapefileWorkspaceFactory(); Workspace work = new Workspace(wsf.openFromFile(location, 0)); IFeatureClass featureClass = work.openFeatureClass("NameOfYourShapefile");
Checking some of my desktop apps, when I use the Append geoprocessing tool, I use FeatureLayer objects as inputs and targets.
public FeatureLayer getLayerByName(String layerName, com.esri.arcgis.carto.Map map) { FeatureLayer layer = null; try { for (int i = 0; i < map.getLayerCount(); i++) { if (map.getLayer(i).getName().equalsIgnoreCase(layerName)) { layer = (FeatureLayer) map.getLayer(i); break; } } } catch (AutomationException ae) { ae.printStackTrace(); } catch (IOException e) { e.printStackTrace(); } return layer; }
Ingelogde leden kunnen berichten plaatsen, updates volgen en meer. Nieuw hier? Maak gratis een account aan.
Find useful guides, FAQs, and documents to help you navigate and make the most of Esri Community.