|
POST
|
Yes, but double backslashes are more typing. As Luke points out, you can also use forward slash, but then you need to remember whether it's forward or backslashes you can't use. It's personal preference, but I use 'r'.
... View more
02-03-2016
01:52 PM
|
0
|
4
|
4659
|
|
POST
|
Your paths are wrong, for Python. '\t' happens to mean tab. You can get around it by always prefacing paths with an 'r' to denote raw string format. For example: inTable = r"c:\test.csv"
... View more
02-03-2016
01:23 PM
|
1
|
9
|
4659
|
|
POST
|
I suspect it's because the ^ Map Algebra operator is Boolean XOr (unless that's what you wanted), not exponent. Use ** (Power) instead.
... View more
02-03-2016
01:18 PM
|
1
|
1
|
1369
|
|
POST
|
You mention definition query - did you also check for a Page Definition query?
... View more
02-03-2016
12:58 PM
|
1
|
1
|
1302
|
|
POST
|
Can you elaborate on what "not exactly pretty polygon-shapes" means? Are they too detailed, or unpleasing shapes in some way? Also, you list these states and then say you want zip codes around them? Does that mean "a few zip codes within states", "all the zip codes within the states", or literally, "the zip codes around (outside) these states"?
... View more
02-01-2016
03:21 PM
|
1
|
3
|
3974
|
|
POST
|
I know you're working Pro, but here's how you would find the unit in Desktop. I assume there's something similar in Pro.
... View more
02-01-2016
12:11 PM
|
0
|
0
|
751
|
|
POST
|
You just need to get the number of points per polygon into a new field holding the number of points you want. There are many ways to do it, but this Python codeblock should work (the expression is: myFunc(!area!)): def myFunc(area):
if area == 133:
return 16
if area == 155:
return 18
return math.floor( area/10+3 ) Then, run CreateRandomPoints with your points field in the number_of_points_or_field and 100 for minimum_allowed_distance. I don't think there is a simple answer to meet your need for evenly distributing points, if possible.
... View more
02-01-2016
11:26 AM
|
1
|
0
|
2864
|
|
POST
|
The following runs in 44 seconds (12 of which are tied up in CopyFeatures), placing 100,000 points. >>> import cProfile
... def drawPoints():
... reps = 100000
... points = []
... with arcpy.da.SearchCursor("a_line",'SHAPE@') as cursor: # only one line
... for row in cursor:
... for i in range(reps):
... points.append(row[0].positionAlongLine(1000))
... arcpy.CopyFeatures_management(points, r'in_memory\points')
... cProfile.runctx('drawPoints()',None,locals())
... View more
01-30-2016
12:04 PM
|
1
|
0
|
3035
|
|
POST
|
I'll just point out that point and polygon symbol rotations are actually two separate issues. Point symbol rotation is controlled through the Advanced ArcMap Settings Utility, while I'm not sure where you can control hatching rotation, if anywhere. This thread indicates no solution to hatching rotation other than converting the hatches to graphics.
... View more
01-29-2016
12:45 PM
|
1
|
2
|
2761
|
|
POST
|
I tried to open the attribute table but it was blank. There are sometimes seemingly random issues with using Excel tables (and XY Event Layers) that can cause this. In Excel, check that there are no spaces in your field names (trailing or leading). Highlight and delete (right-click->delete) all empty columns after your data. Highlight and delete (right-click->delete) all empty rows after your data. Try bringing the points back into ArcMap and Display XY. Check the attribute table. Try exporting the XY Event table to a feature class on disk (right-click->export data). Check the attribute table. Try applying your symbology.
... View more
01-29-2016
09:07 AM
|
0
|
0
|
379
|
|
POST
|
Ah, my instructions are for ArcGIS Desktop. Sorry, I didn't register that your post had been filed in the correct place.
... View more
01-28-2016
03:44 PM
|
0
|
0
|
8149
|
|
POST
|
To create a new, blank feature class: Open the Catalog. Right-click the workspace (folder or gdb) in which you want to make your new feature class. Choose New -> Shapefile (or Feature Class). If you use a GDB feature class, it will create two new auto-populated fields, one for perimeter and one for area, so you don't have to calculate those. I'm unclear whether you want to use your existing point geometry as polygon vertices, or start fresh.
... View more
01-28-2016
02:46 PM
|
1
|
3
|
8149
|
|
POST
|
The spatial reference is set in the line: sr = arcpy.SpatialReference(3005) 3005 is the factory code/authority code/EPSG code for BC Albers. Change it to the CRS of your choosing, but keep in mind that the units of 'step' will be determined by the CRS. If you input a geographic CRS, then the 'step' will be in units of degrees.
... View more
01-28-2016
01:15 PM
|
0
|
0
|
2063
|
|
POST
|
The example uses an approximation of geographic coordinates. It's kind of cool how they set up the even/odd routine. You can (perhaps) do better letting ArcGIS handle the coordinates through a projection (spatial reference). In Python: >>> x = 0 # start x coord
... y = 0 # start y coord
... step = 10 # distance between lines
... points = [] # points list container
... line_array = arcpy.Array() # line vertices container
... sr = arcpy.SpatialReference(3005) # spatial ref
... for i in range(100): # we're going to make 100 points
... if i%2: # check even/odd
... if i/2%2: # check 1/2 even/odd
... x += step * int(i/2) # increase x
... else:
... x -= step * int(i/2) # decrease x
... else:
... if i/2%2: # check 1/2 even/odd
... y += step * int(i/2) # increase y
... else:
... y -= step * int(i/2) # decrease y
... point = arcpy.Point(x,y) # create point
... points.append(arcpy.PointGeometry(point,sr)) # add point to list
... line_array.add(point) # add location to line vertices
... line = arcpy.Polyline(line_array,sr) # create line
... arcpy.CopyFeatures_management(points, r'in_memory\points') # write points
... arcpy.CopyFeatures_management(line, r'in_memory\line') # write line
... View more
01-28-2016
09:32 AM
|
4
|
2
|
2063
|
| Title | Kudos | Posted |
|---|---|---|
| 1 | 11-25-2015 01:51 PM | |
| 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 |
| Online Status |
Offline
|
| Date Last Visited |
07-15-2023
12:11 AM
|