|
POST
|
Your code runs fine for me, referencing a shapefile. It adds the layer to the TOC. newlayer = arcpy.mapping.Layer(r'C:\junk\points.shp') Just make sure you're writing a proper Python path (like above).
... View more
02-29-2016
01:45 PM
|
0
|
2
|
2729
|
|
POST
|
You can either split the raster, using a tool like Extract by Attributes or Con, then Raster to Point, OR Raster to Point and then split the feature class by attributes. It's up to you.
... View more
02-26-2016
03:10 PM
|
3
|
1
|
2569
|
|
POST
|
The Raster to Point tool will create a point for each pixel in the raster. If that creates too many points, then there are too many pixels. If you want fewer points, make a raster with fewer pixels. edit: what exactly are you trying to achieve and are you sure you can't do it completely with rasters?
... View more
02-26-2016
03:00 PM
|
0
|
3
|
2569
|
|
POST
|
^ This is directly copy and pasted from here (arcmap - What are the units of the calculated area from a raster in decimal degree - Geographic Information Systems Stac…), which is why it makes absolutely no sense in this context.
... View more
02-26-2016
10:06 AM
|
1
|
0
|
16997
|
|
POST
|
Is the 30 actually in the data, or just listed as the upper limit in the symbology?
... View more
02-25-2016
02:26 PM
|
0
|
1
|
1816
|
|
POST
|
As an alternative to numpy*, you can do something like this in the field calculator or using an update cursor. This is only lightly tested, and I'm sure you'll find some gotchas along the way. Code block- Python parser: def myFunc(amt, f2, f5, f10, f100, f1000):
vals = [f2, f5, f10, f100, f1000] # hardcoded
years = [2, 5, 10, 100, 1000] # hardcoded
for i in range(len(vals)): # loop through potential values
if amt < vals: # check if the amount is less than the currently evaluated field
low_yr = years # small year in range
high_yr = years[i+1] # large year in range
low_val = vals # low value in range
high_val = vals[i+1] # high value in range
prop = (amt-low_val)/(high_val - low_val) # proportional amount in range
recur = (prop * (high_yr - low_yr)) + low_yr # proportional year in range
return recur # return the recurrence year
break # stop evaluating other fields Expression: myFunc( !appt_allsi!, !wy_24h0002!, !wy_24h0005!, !wy_24h0010!, !wy_24h0100!, !wy_24h1000! ) *learning numpy for a one-off is cruel and unusual punishment, IMO.
... View more
02-25-2016
01:39 PM
|
0
|
0
|
1299
|
|
POST
|
I use PyScripter for no reason other than it's free and does everything I ask of it.
... View more
02-25-2016
12:55 PM
|
0
|
1
|
3784
|
|
POST
|
Are you looking for a perpendicular line (90 degrees to the line, as I've added below) or a vertical line (as you've drawn)?
... View more
02-25-2016
08:35 AM
|
0
|
4
|
6280
|
|
POST
|
As far as I can tell, there is no such variable as %Value%, but there is %Name%.
... View more
02-24-2016
04:11 PM
|
1
|
2
|
3187
|
|
POST
|
You're running into issues because you can only have one workspace environment at a time. You set the workspace to the region folder. The region list is populated with the names (not full paths) of the feature classes in the region workspace folder. Then, you switch the workspace to the hab workspace folder. The FClist is populated with feature class names (not full paths) of the feature classes in the hab workspace folder. Your loops cycle through the feature class names (not full paths) in your lists. Finally, your clip tool is run against two feature class names (not full paths). Since the tool is provided with feature class names (not full paths) it looks for feature classes in the workspace environment folder - your hab folder. The most direct route I see to a solution is to store the full path in your lists, some thing like: >>> import os
... arcpy.env.workspace = r'C:\junk'
... region = [os.path.join(arcpy.env.workspace,fc) for fc in arcpy.ListFeatureClasses("")]
... View more
02-24-2016
11:35 AM
|
1
|
1
|
2119
|
|
POST
|
This sounds like a job for Dissolve (or Summary Statistics if you're only interested in the attributes, not geometry).
... View more
02-23-2016
04:10 PM
|
0
|
2
|
1752
|
|
POST
|
Meter is the base unit. Lengths will be reported in meters, areas in square meters, volume in cubic meters, and hyperspatial regions to higher powers (in exponential units of meters). Likewise if the unit is feet. With that said, the units reported within a feature class' attribute table are generally calculated according to the feature class coordinate reference system's linear unit, not the data frame's reference system.
... View more
02-23-2016
12:12 PM
|
2
|
1
|
16997
|
|
POST
|
Search for "Alberta 10tm" for the standard Alberta-wide traverse Mercator projection. It doesn't come out of the box, so you'll have to make it custom.
... View more
02-21-2016
12:37 PM
|
1
|
1
|
4471
|
| 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
|