|
POST
|
You get to the df(s) by listing the dfs in a MapDocument: >>> mxd = arcpy.mapping.MapDocument('CURRENT')
... for df in arcpy.mapping.ListDataFrames(mxd):
... print df.spatialReference.name
... print df.spatialReference.linearUnitName
...
NAD_1983_UTM_Zone_11N
Meter
NAD_1983_UTM_Zone_11N
Meter
... View more
12-02-2016
02:47 PM
|
0
|
1
|
1875
|
|
POST
|
You need to get to the DataFrame object, which has a spatialReference property (the same type of object that would be returned by arcpy.Describe().spatialReference).
... View more
12-02-2016
01:04 PM
|
0
|
3
|
1875
|
|
POST
|
There are lots of ways to do this. I'd probably add a new field, select the points to be circled, calculate those to some value in the new field, and symbolize based on that field.
... View more
12-01-2016
11:15 AM
|
0
|
0
|
693
|
|
POST
|
Look at the picture in Dan's link: and read the description: INPUT_FID: The feature ID of the input features NEAR_FID: The feature ID of the near features OBJECTID is the autonumber ID for the output table - it doesn't necessarily match with anything in the poles feature class.
... View more
11-30-2016
03:48 PM
|
2
|
0
|
4769
|
|
POST
|
Here's how you can do it with six (just realized you need it for five, which would be more complicated): - my features are points, at each location there are six points, each point has a rotation value in a field (0, 60, 120, etc.) - make a triangle symbol with one point as close as possible to the symbol origin and colour by your attribute: - make a copy of that layer and place above in the table of contents. - symbolize that feature layer with copies of the circle/line symbol to hide the gaps between your triangles:
... View more
11-30-2016
11:02 AM
|
2
|
0
|
4673
|
|
POST
|
You can avoid repeating blocks of code by using functions and loops, like below. def append2Zip(zipfolder,path):
print 'Appending to ' + zipfolder
zf = zipfile.ZipFile(zipfolder,mode='a')
try:
zf.write(path,os.path.basename(path))
finally:
zf.close()
path = r'Z:\Jared\Disclaimer - Final.txt'
zipfolders = [r'W:\Data\WillCounty_AddressPoint.zip',r'W:\Data\WillCounty_Street.zip'] # list of zip folders
for zipfolder in zipfolders: # loop through zipfolders
append2Zip(zipfolder,path) # call function above
... View more
11-30-2016
09:23 AM
|
2
|
0
|
2654
|
|
POST
|
The optional second argument is where you specify an alternate name, if needed: zf.write(r'Z:\Jared\Disclaimer - Final.txt','Disclaimer - Final.txt') ... or better yet: import zipfile, os
...
path = r'Z:\Jared\Disclaimer - Final.txt'
zf.write(path,os.path.basename(path)) ^ also, be careful how you write your paths. Should use 'r','/', or '\\'.
... View more
11-29-2016
02:27 PM
|
1
|
0
|
2654
|
|
POST
|
Can you copy/paste the first row in the CSV? Are there any special characters or spaces that might cause issues in ArcGIS?
... View more
11-29-2016
11:25 AM
|
0
|
1
|
631
|
|
POST
|
Generate near table, which requires Advanced licensing, is the out-of-the-box tool to find the distance between all features: Generate Near Table—Help | ArcGIS for Desktop Other than that, you can loop through your features using two SearchCursors, comparing geometries using the distanceTo method of the PointGeometry object. edit: after seeing Rebecca's comment, can you clarify whether you're interested in 100' distance apart or 100' elevation?
... View more
11-29-2016
09:35 AM
|
1
|
0
|
1337
|
|
POST
|
It's been so long ago that I last used one of the old-style cursors so I can't recall how to deal with geometry using them, but if you're just getting into arcpy, you should bypass those and jump straight to the modern version in the data access module: SearchCursor—Help | ArcGIS for Desktop fc = 'farms_poly_lyr'
with arcpy.da.SearchCursor(fc,['SHAPE@','Name']) as cursor:
for row in cursor:
arcpy.SelectLayerByLocation_management("turbines_lyr","INTERSECT",row[0])
arcpy.MeanCenter_stats("turbines_lyr", "turbine_center_"+row[1]) ^ untested. I'm not sure if you can run select by location against a geometry object. You may have to convert it to a layer first: Make Feature Layer—Help | ArcGIS for Desktop
... View more
11-28-2016
05:03 PM
|
1
|
2
|
3145
|
|
POST
|
I don't know why this would be the issue, but it looks like there is a space following the layer name. If there is one, try removing it. Also, have you tried restarting ArcMap since the problem started?
... View more
11-24-2016
10:07 AM
|
1
|
2
|
1849
|
|
POST
|
You could go through the tool reference section in the help: A quick tour of geoprocessing tool references—Help | ArcGIS for Desktop
... View more
11-24-2016
09:06 AM
|
1
|
0
|
976
|
|
POST
|
If you convert your list elements to a tuple and add to a set, you can compare: >>> fc_list = [[r'c:\folder1\fcs1', 'fcs1', 100, 200],[r'c:\folder2\fcs1', 'fcs1', 100, 200],[r'c:\folder3\fcs2', 'fcs2', 100, 200],[r'c:\folder4\fcs1', 'fcs1', 100, 200],[r'c:\folder5\fcs1', 'fcs1', 100, 999]]
... master_set = set([])
... for fc in fc_list:
... my_tuple = tuple(fc[1:])
... if my_tuple not in master_set:
... print "{} is not a duplicate.".format(my_tuple)
... else:
... print "{} is a duplicate.".format(my_tuple)
... master_set.add(my_tuple)
...
('fcs1', 100, 200) is not a duplicate.
('fcs1', 100, 200) is a duplicate.
('fcs2', 100, 200) is not a duplicate.
('fcs1', 100, 200) is a duplicate.
('fcs1', 100, 999) is not a duplicate. edit: you can also use a plain old list to hold the tuples, although it will still store the duplicates. >>> fc_list = [[r'c:\folder1\fcs1', 'fcs1', 100, 200],[r'c:\folder2\fcs1', 'fcs1', 100, 200],[r'c:\folder3\fcs2', 'fcs2', 100, 200],[r'c:\folder4\fcs1', 'fcs1', 100, 200],[r'c:\folder5\fcs1', 'fcs1', 100, 999]]
... master_set = []
... for fc in fc_list:
... my_tuple = tuple(fc[1:])
... if my_tuple not in master_set:
... print "{} is not a duplicate.".format(my_tuple)
... else:
... print "{} is a duplicate.".format(my_tuple)
... master_set.append(my_tuple)
...
('fcs1', 100, 200) is not a duplicate.
('fcs1', 100, 200) is a duplicate.
('fcs2', 100, 200) is not a duplicate.
('fcs1', 100, 200) is a duplicate.
('fcs1', 100, 999) is not a duplicate.
... View more
11-23-2016
04:47 PM
|
1
|
1
|
1795
|
| 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
|