|
POST
|
I believe you'd have to list the layers (map object) and inspect the FIDSet property (layer object), and update the parameter with tool validation. Map—ArcPy | ArcGIS Desktop Layer properties—ArcPy Functions | ArcGIS Desktop Understanding validation in script tools—Geoprocessing and Python | ArcGIS Desktop
... View more
01-31-2017
12:02 AM
|
2
|
1
|
6118
|
|
POST
|
The good news is that it's a warning, not an error (i.e. the model ran to completion). The bad news is that it's up to you to troubleshoot why the output is empty even when everything ran properly (e.g. trying to intersect two layers that don't intersect will give you that warning). Can you track down which tool gives you the warning?
... View more
01-27-2017
01:54 PM
|
1
|
1
|
1011
|
|
POST
|
I'm just starting out with Survey123, too, but I believe both Connect and Web are the survey creation apps, where Connect is a desktop program, and Web is web-based.
... View more
01-27-2017
01:18 PM
|
1
|
1
|
1711
|
|
POST
|
You can do it with the following Python script: >>> fc = 'lines' # lines feature class
... fc_sr = arcpy.Describe(fc).spatialReference # spatial ref
... points = 'midpoints' # existing point feature class
... ang_field = 'ANGLE' # must have field to hold angle value, type double
... iCur = arcpy.da.InsertCursor(points,['SHAPE@',ang_field]) # insert cursor
... with arcpy.da.SearchCursor(fc,'SHAPE@',spatial_reference=fc_sr) as sCur: # loopo through lines
... for sRow in sCur:
... midpoint = sRow[0].positionAlongLine(0.5,True) # get midpoint
... pt_before = sRow[0].positionAlongLine(sRow[0].measureOnLine(midpoint)-0.1) # get a point just a little before the midpoint
... ang = pt_before.angleAndDistanceTo(midpoint) # calculate angle
... iCur.insertRow((midpoint,ang[0])) # insert feature
... View more
01-26-2017
01:08 PM
|
2
|
1
|
2251
|
|
POST
|
I believe you should generally follow this pattern, but you've got quite a few changes ahead of you. iCur = arcpy.da.InsertCursor(featureClassCopy, fieldnames) # make before any loops
with arcpy.da.SearchCursor(featureClass, fieldnames, ...) as sCur:
for sRow in sCur:
for x in range(sRow[99]) # replace 99 with whatever field index your value should be
iCur.insertRow(sRow) # insert
... View more
01-25-2017
03:12 PM
|
1
|
0
|
3416
|
|
POST
|
Can't you do it using a for loop and range? >>> sample_data = [2,5,3]
... for sample in sample_data:
... for i in range(sample):
... print "insert"
... print "done"
...
insert
insert
done
insert
insert
insert
insert
insert
done
insert
insert
insert
done
... View more
01-25-2017
01:09 PM
|
0
|
4
|
3416
|
|
POST
|
Is this the exact code that caused the error? I don't see any reason why Line 35 (pnt = xy) should be trying to access any workspace at all. Also, Line 1 should have a syntax error (the character before the comment) and Line 39 should be 'editor' not 'edit'. edit: I see that your current Line 18 should be split across several lines, which is messing up your Line numbering. What is supposed to be Line 35?
... View more
01-25-2017
01:00 PM
|
0
|
3
|
3090
|
|
POST
|
Maybe this will get you some of the way there (as usual, I cut some corners, but you get the idea): >>> fc = 'myline_Buffer' # line already buffered
... pt_spacing = 10000
... buff_outline = [i[0].boundary() for i in arcpy.da.SearchCursor(fc,'SHAPE@')][0]
... outline_pts = []
... outline_buffers = []
... for i in range(0,int(buff_outline.length),pt_spacing):
... cur_pt = buff_outline.positionAlongLine(i) # make points along buffer
... outline_pts.append(cur_pt)
... outline_buffers.append(cur_pt.buffer(pt_spacing/1.5)) # buffer and append to list
... int_lines = []
... for i in range(len(outline_buffers)):
... if i == 0:
... int_lines.append(outline_buffers[i].difference(outline_buffers[len(outline_buffers)-1]).boundary()) # take difference of first and last buffers
... else:
... int_lines.append(outline_buffers[i].difference(outline_buffers[i-1]).boundary()) # take difference of current buffer and previous buffer
... arcpy.CopyFeatures_management(outline_pts,r'in_memory\outline_pts')
... arcpy.CopyFeatures_management(outline_buffers,r'in_memory\outline_buffers')
... arcpy.CopyFeatures_management(int_lines,r'in_memory\int_lines') Finally, you would erase the original buffer from the lines. Here's the output of my script above:
... View more
01-24-2017
03:53 PM
|
3
|
0
|
3645
|
|
POST
|
Your coordinates are lat/long so it is definitely a geographic CRS. Whether you use WGS84 or NAD83 doesn't really matter for now - they are quite similar. If you can't get your points plotted with WGS84, there is a different problem with your data.
... View more
01-24-2017
12:08 PM
|
0
|
0
|
16697
|
|
POST
|
Remove all spaces and parentheses from your field names. Also, what coordinate reference system are you defining when you display XY?
... View more
01-24-2017
08:32 AM
|
1
|
2
|
16697
|
|
POST
|
You can add a new field, populate with "Pseudotsuga", and use that as the Type. I haven't found a way to add to the shortened drop-down list.
... View more
01-23-2017
10:53 AM
|
1
|
0
|
1407
|
|
POST
|
I can't seem to reproduce your issue using the following: 1.) Add XY data, using Excel sheet as source to make an event layer (42 points). 2.) Save and close the mxd. 3.) Add 3 new points to Excel (45 points). 4.) Save and close Excel. 5.) Open mxd. There's now 45 points. In your event layer, try clicking "Reload Cache" under the attribute table options. I'll add that event layers are quite mysterious to me. The only thing I ever do with them is immediately export to a permanent feature class.
... View more
01-23-2017
10:01 AM
|
1
|
0
|
3112
|
|
POST
|
Can you post the entire relevant part of the code? It sounds like you're completely deconstructing and reconstructing the exact same geometry, when you could just reference the original geometry (e.g. row[1] in your first search cursor).
... View more
01-19-2017
10:55 AM
|
0
|
1
|
3070
|
|
POST
|
I believe your formula should be: degree + min/60 + sec/3600 = DD Make sure when you do your Display XY Coordinates you choose a geographic coordinate reference system (probably WGS84 or NAD83) to uses degrees as the unit. You can project the data later once you've got them properly defined.
... View more
01-19-2017
10:07 AM
|
2
|
1
|
16697
|
| Title | Kudos | Posted |
|---|---|---|
| 1 | 08-30-2013 02:22 PM | |
| 1 | 04-12-2011 11:19 AM | |
| 1 | 09-17-2021 09:43 AM | |
| 1 | 04-04-2012 12:05 PM | |
| 2 | 07-16-2020 11:31 AM |
| Online Status |
Offline
|
| Date Last Visited |
07-15-2023
12:11 AM
|