POST
|
You can do something like this: // Create a new spatial filter and use the polygon the geometry
ESRI.ArcGIS.Geodatabase.ISpatialFilter spatialFilter = new ESRI.ArcGIS.Geodatabase.SpatialFilterClass();
spatialFilter.Geometry = polyGeom;
spatialFilter.SpatialRel = ESRI.ArcGIS.Geodatabase.esriSpatialRelEnum.esriSpatialRelTouches;
spatialFilter.set_OutputSpatialReference(shapeFieldName, map.SpatialReference);
spatialFilter.GeometryField = shapeFieldName;
// Do the search
ESRI.ArcGIS.Geodatabase.IFeatureCursor featureCursor = featureClass.Search(spatialFilter, false); I hope this helps. You might have to show the code you have tried so far to be more specific.
... View more
09-22-2015
07:32 AM
|
1
|
1
|
877
|
POST
|
This one is different option for the purpose of exporting feature class. If you don't want to use the GP tool then you can use the create feature class option. For example IWorkspaceFactory workspaceFactory = (IWorkspaceFactory)Activator.CreateInstance(Type.GetTypeFromProgID("esriDataSourcesGDB.AccessWorkspaceFactory"));
IWorkspace workspace = workspaceFactory.OpenFromFile(@"C:\Temp\test.mdb", 0);
IWorkspace2 workspace2 = workspace as IWorkspace2;
IFeatureWorkspace featureWorkspace = workspace as IFeatureWorkspace;
IFeatureClass sourceFc = featureWorkspace.OpenFeatureClass("MySourceFC");
CreateFeatureClass(workspace2, null, "MyTargetFC", sourceFc.Fields, null, null, string.Empty); Here I am using a PGDB but you can change it to whatever you need. CreateFeatureClass function is from the snippet that I shared earlier. Thanks, Mahtab
... View more
09-21-2015
08:57 AM
|
0
|
0
|
1781
|
POST
|
I think this is what you are looking for Create Feature Class (Data Management) And just in case you need how to run this tool in ArcObjects ArcObjects Help for .NET developers - How to run a geoprocessing tool For adding layer to map ArcObjects Help for .NET developers - Add Layer File to ActiveView Snippet But I think performance wise it will be better without gp tools but then you need to write more code: So for that refer ArcObjects Help for .NET developers - Create FeatureClass Snippet In this approach you open the database feature class read it's fields and then create your feature class in FGDB with similar schema. HTH
... View more
09-18-2015
06:46 AM
|
1
|
2
|
1781
|
POST
|
This may not help, but can you try running the process in foreground. Per your screenshots currently it's running in background. Error ID 99999 is generic and doesn't tell anything. But I have seen sometimes running the tools in foreground helps. Give it a try. Refer following for processing options: Foreground and background processing
... View more
09-18-2015
06:16 AM
|
0
|
3
|
1699
|
POST
|
I am afraid this can't be done as SQL expression doesn't support advanced syntax like label expressions. But you could write a simple python addin extension A Python Addin Extension Which can be used to apply to definition query to your layer something like below: import arcpy
import pythonaddins
import getpass
class ExtensionClass1(object):
"""Implementation for pyaddins_addin.extension2 (Extension)"""
def __init__(self):
# For performance considerations, please remove all unused methods in this class.
self.enabled = True
def startup(self):
pass
def applyDefQuery(self):
lyr = arcpy.mapping.ListLayers(arcpy.mapping.MapDocument("CURRENT"))[0]
if lyr.supports("DEFINITIONQUERY"):
lyr.definitionQuery = "USERNAME='{0}'".format(getpass.getuser().upper())
arcpy.RefreshActiveView()
return
def newDocument(self):
self.applyDefQuery()
return
def openDocument(self):
self.applyDefQuery()
return
... View more
09-16-2015
12:55 PM
|
1
|
1
|
966
|
POST
|
It will work if you change change evt to event in line 120.
... View more
09-16-2015
06:49 AM
|
1
|
2
|
1136
|
POST
|
I think you can use ISpatialFilter ArcObjects Help for .NET developers First get the geometry of polygon that you want to use to get the adjacent and then use Search on feature class with SpatialRel as esriSpatialRelTouches HTH http://resources.arcgis.com/en/help/arcobjects-net/componenthelp/index.html#//00250000083n000000
... View more
09-16-2015
06:33 AM
|
1
|
3
|
877
|
POST
|
I am afraid you can't do this. Search for python obfuscation and you will get the answer.
... View more
09-16-2015
06:17 AM
|
0
|
0
|
1893
|
POST
|
Label Layer | ArcGIS API for JavaScript Labeling features client-side | Guide | ArcGIS API for JavaScript This is for JS API not sure if this will help.
... View more
09-15-2015
08:43 AM
|
0
|
1
|
3565
|
POST
|
Right click your tool that has red X and click the only option from the context menu "Why..." This will give you the details of the error.
... View more
09-15-2015
08:33 AM
|
1
|
3
|
2152
|
POST
|
Following might help a bit: # define new mappings and load default from fc or table
fieldmappings = arcpy.FieldMappings()
fieldmappings.addTable(yourFCorTable)
# now you define the ouput fields
fieldmap1 = fieldmappings.getFieldMap(1)
outField1 = fieldmap.outputField
outField1.name = "WellOID"
outField1.aliasName = "WellOID"
fieldmap1.outputField = outField1
fieldmap2 = fieldmappings.getFieldMap(2)
outField2 = fieldmap2.outputField
outField2.name = "Distance"
outField2.aliasName = "Distance"
fieldmap2.outputField = outField2
# now you can use your field mappings
... View more
09-15-2015
08:05 AM
|
0
|
0
|
1880
|
POST
|
If I understand correctly you could use following script: cursor = arcpy.UpdateCursor("testFC")
gridDict = {}
for row in cursor:
print row.getValue("GridNo")
gridNo = row.getValue("GridNo")
if(gridDict.has_key(gridNo)):
gridDict[gridNo] = gridDict[gridNo] + 1
else:
gridDict[gridNo] = 1
name = "{0}_{1}".format(gridNo, str(gridDict[gridNo]).zfill(3))
row.setValue("Name",name)
cursor.updateRow(row) Make sure to correct the feature class path and field names as they are. Thanks, Mahtab
... View more
09-15-2015
07:53 AM
|
2
|
2
|
1893
|
POST
|
I think you can't do it with python. Refer How to load image to Raster attribute field with python Thanks, Mahtab
... View more
09-11-2015
07:07 AM
|
0
|
0
|
3675
|
POST
|
You can run this within a for loop as : for fc in fcList:
arcpy.GetCount_management(fc) where fcList is a list of feature class. You can also use arcpy.ListFeatureClasses() to get a list from workspace. Thanks, Mahtab
... View more
09-10-2015
01:41 PM
|
1
|
0
|
1284
|
POST
|
Hi Yue, Thanks for your response. My implementation is similar to the one that you have shared. I got it all working except for the issue in using the JoinType which I choose as dataSource.joinType = "left-inner-join"; I will clarify it with an example: Let's say my feature layer ( A ) has 100 records and table (B) has 5 records. So in this case I was assuming to get the joined result to return only 5 features instead I got 100 records. So as I work around I added a definition query to exclude where rightTableJoinKey is null. To me it appears to be a bug. Thanks, Mahtab
... View more
06-17-2015
08:21 AM
|
1
|
1
|
887
|
Title | Kudos | Posted |
---|---|---|
1 | 09-15-2015 08:33 AM | |
1 | 09-16-2015 06:33 AM | |
1 | 09-18-2015 06:46 AM | |
1 | 09-10-2015 01:41 PM | |
1 | 09-22-2015 07:32 AM |
Online Status |
Offline
|
Date Last Visited |
11-11-2020
02:24 AM
|