|
POST
|
You could accomplish this with a python script. Here is an example: import arcpy
from arcpy import env
env.overwriteOutput =1
env.workspace = r"C:\temp\python\test.gdb"
#create a one-to-many spatial join
arcpy.SpatialJoin_analysis("lakes", "rivers", "lakes_join", "JOIN_ONE_TO_MANY", "KEEP_ALL", "", "INTERSECT")
#create empty dictionary to store target_fid and shape length
dict = {}
#sort by river's shape length, iterate through each row, and populate dictionary with largest river length
rows = arcpy.SearchCursor("lakes_join", "", "", "", "SHAPE_LENGTH_1 A")
for row in rows:
length = '%.14f' % row.SHAPE_LENGTH_1
dict[row.TARGET_FID] = length
del row, rows
#delete all values that are not the larget river
for key in dict:
print key, dict[key]
arcpy.MakeFeatureLayer_management("lakes_join", "lakes_join_lyr", "TARGET_FID = " + str(key) + " AND NOT SHAPE_Length_1 = " + str(dict[key]))
arcpy.DeleteFeatures_management("lakes_join_lyr")
print "finished"
... View more
12-10-2013
05:28 AM
|
0
|
0
|
2172
|
|
POST
|
Hi Jackie, Assuming the river that runs through the lake will be the longest in length, you can set a Merge Rule for the Shape_Length of the rivers feature class to Maximum. This will only join the lake with the largest length. [ATTACH=CONFIG]29683[/ATTACH]
... View more
12-09-2013
07:41 AM
|
0
|
0
|
2172
|
|
POST
|
As Tim mentioned, the Spatial Join will work if both datasets are vector. If one input is vector and the other input(s) is raster, you will want to use the Extract Multi Values to Points tool.
... View more
12-09-2013
07:09 AM
|
0
|
0
|
1594
|
|
POST
|
Hi Michael, This will not cause any problems. JP2 are similar to JPG, but they use JPEG2000 compression. See the following link for more information on compression: http://resources.arcgis.com/en/help/main/10.2/index.html#//009t00000021000000
... View more
12-06-2013
02:38 AM
|
0
|
0
|
2312
|
|
POST
|
Looks like the issue was with the NULL values in your field, and the query in the MakeFeatureLayer function was slightly off. Try the following: shp = "WaEinbauten"
with arcpy.da.SearchCursor(shp, ["GelaendeH"]) as cursor:
for row in cursor:
if not vertexElevation > 0:
vertexElevation = 0
else:
vertexElevation = row[0]
arcpy.MakeFeatureLayer_management(shp, "pts_lyr", "GelaendeH = " + str(vertexElevation))
arcpy.Adjust3DZ_management("pts_lyr", "NO_REVERSE", vertexElevation)
... View more
12-06-2013
02:19 AM
|
0
|
0
|
2498
|
|
POST
|
Hi Stefan, I could not access this database. It seems to be corrupted. Can you copy the feature class to a File Geodatabase and send that?
... View more
12-04-2013
07:47 AM
|
0
|
0
|
2498
|
|
POST
|
Stefan, Is your input feature class Z-enabled? You can check by opening the attribute table. The value for the Shape field should be 'PointZ'.
... View more
12-02-2013
02:16 AM
|
0
|
0
|
3190
|
|
POST
|
Thanks for the quick responses. AMJSkinn3: All Arc applications were closed when the add-in was installed. To make sure I uninstalled the add in, recreated the project folder, compiled, and re-installed the add-in. Also, neither the python window nor the results window have any errors to report. When I added the toolbar to ArcMap, the combo box says "[Missing]". For a quick explanation to what I'm trying to accomplish.. I'd like to select a project name from the combo box. The project name selected will direct a python script to grab specific layers on file with which it will build a project map with correct Data Frame name and Spatial Reference. I'm trying to solve this issue with the simplest example possible to make sure it is do-able. What is the name of the folder directory your add-in is stored in? It cannot contain spaces. For example, if the folder directory is called 'Combo Box', you will receive the 'Missing' icon on your toolbar. Recreate the add-in and make sure there are no spaces in the directory.
... View more
11-27-2013
02:30 AM
|
0
|
0
|
1659
|
|
POST
|
Hi Karen, Unit abbreviations only work when your data frame uses a projected coordinate system rather than a geographic coordinate system. See the following help doc: http://resources.arcgis.com/en/help/main/10.2/index.html#//01m600000036000000
... View more
11-26-2013
08:44 AM
|
0
|
0
|
923
|
|
POST
|
Hi John, Are you receiving any errors in the python window in ArcMap when you click on the dropdown? Before installing the add-in, was ArcMap closed? What is the name of your add-in?
... View more
11-26-2013
02:32 AM
|
0
|
0
|
1659
|
|
POST
|
Hi Rob, I don't believe this will be possible using Python. You will most likely need to do this using one of the data transfer methods with ArcObjects: http://resources.arcgis.com/en/help/arcobjects-net/conceptualhelp/index.html#//0001000003rp000000
... View more
11-26-2013
02:27 AM
|
0
|
0
|
2236
|
|
POST
|
You can import the feature class to the feature dataset as a new name, delete the original feature class, and then rename the feature class in the feature dataset. Ex: import arcpy
from arcpy import env
env.workspace = r"C:\temp\python\redlands.gdb"
fc = "Hospitals"
dataset = "test"
arcpy.FeatureClassToFeatureClass_conversion(fc, env.workspace + "\\" + dataset, fc + "_1")
arcpy.Delete_management(fc)
arcpy.Rename_management(fc + "_1", fc)
... View more
11-26-2013
01:28 AM
|
1
|
0
|
2236
|
|
POST
|
Hi Mike, This is a bug with PyWin. Take a look at the report and workaround here.
... View more
11-25-2013
11:17 AM
|
0
|
0
|
968
|
| Title | Kudos | Posted |
|---|---|---|
| 1 | 07-08-2026 12:27 PM | |
| 4 | 05-07-2020 05:14 PM | |
| 1 | 03-25-2026 04:16 AM | |
| 1 | 03-16-2026 01:00 PM | |
| 1 | 12-22-2025 10:39 AM |
| Online Status |
Offline
|
| Date Last Visited |
yesterday
|