POST
|
import arcpy
arcpy.env.overwriteOutput = 1
shapefile = r"S:\General-Offices-GO-Trans\SLR-Mapping\GIS_Projects_2018\Smart_T_Line_Model\geodata\LineBuf.shp"
raster = r"S:\General-Offices-GO-Trans\SLR-Mapping\GIS_Projects_2018\Smart_T_Line_Model\geodata\MN_DEM3second"
desc = arcpy.Describe(raster)
extent = str(desc.extent.XMin) + " " + str(desc.extent.YMin) + " " + str(desc.extent.XMax) + " " + str(desc.extent.YMax)
with arcpy.da.SearchCursor(shapefile, "LineNum") as cursor:
for row in cursor:
print("Creating Feature Layer for " + str(row[0]))
arcpy.MakeFeatureLayer_management(shapefile, "fLayer", "LINENUM = '" + row[0] + "'")
print("Clipping raster")
arcpy.Clip_management(raster, "", r"S:\General-Offices-GO-Trans\SLR-Mapping\GIS_Projects_2018\Smart_T_Line_Model\geodata\DEM_" + str(row[0]), "", "fLayer", "MAINTAIN_EXTENT")
del cursor
... View more
08-24-2018
08:22 AM
|
0
|
15
|
1735
|
POST
|
Getting this message now: Runtime error Traceback (most recent call last): File "<string>", line 14, in <module> File "c:\program files (x86)\arcgis\desktop10.3\arcpy\arcpy\management.py", line 13594, in Clip raise e ExecuteError: ERROR 000622: Failed to execute (Clip). Parameters are not valid. ERROR 000800: The value is not a member of ClippingGeometry | NONE.
... View more
08-24-2018
08:15 AM
|
0
|
16
|
1735
|
POST
|
Thanks, Jake and Dan but now I'm getting this message: Runtime error Traceback (most recent call last): File "<string>", line 12, in <module> File "c:\program files (x86)\arcgis\desktop10.3\arcpy\arcpy\management.py", line 13594, in Clip raise e ExecuteError: ERROR 000622: Failed to execute (Clip). Parameters are not valid. ERROR 000800: The value is not a member of ClippingGeometry | NONE. >>> Probably something easy with the ClippingGeometry arguments? Jim
... View more
08-24-2018
07:49 AM
|
0
|
18
|
1735
|
POST
|
Jake, Many thanks for script but I get the following error message. Note that I changed the folder paths to the shapefile and raster inputs. The field "LineNum" is a text field if that is an issue. >>> import arcpy arcpy.env.overwriteOutput = 1 shapefile = r"S:\General-Offices-GO-Trans\SLR-Mapping\GIS_Projects_2018\Smart_T_Line_Model\geodata\LineBuf.shp" raster = r"S:\General-Offices-GO-Trans\SLR-Mapping\GIS_Projects_2018\Smart_T_Line_Model\geodata\MN_DEM3second" with arcpy.da.SearchCursor(shapefile, "LineNum") as cursor: for row in cursor: print("Creating Feature Layer for " + str(row[0])) arcpy.MakeFeatureLayer_management(shapefile, "fLayer", "LineNum = " + row[0]) print("Clipping raster") arcpy.Clip_management(raster, "", r"S:\General-Offices-GO-Trans\SLR-Mapping\GIS_Projects_2018\Smart_T_Line_Model\geodata\DEM_" + str(row[0]), "", "fLayer", "MAINTAIN_EXTENT") del cursor Creating Feature Layer for 0517 Runtime error Traceback (most recent call last): File "<string>", line 10, in <module> File "c:\program files (x86)\arcgis\desktop10.3\arcpy\arcpy\management.py", line 6520, in MakeFeatureLayer raise e ExecuteError: ERROR 000358: Invalid expression LineNum = 0517 Failed to execute (MakeFeatureLayer). >>>
... View more
08-24-2018
07:21 AM
|
0
|
21
|
1735
|
POST
|
I'm not a python script writer thus the question. What's needed is a script that will do the following: Run a definition query for each record in a polygon shapefile called "LineBuf.shp" on an attribute field named "LINENUM". (There are 441 unique records). For each unique polygon, run a raster clip on "MN_DEM3second", the raster dataset. The option to "Use Input Features for Clipping Geometry" should be selected. The file name of the resultant raster layer (in ESRI grid format) for each record should be the value of "LINENUM" (from the original definition query). The script should create 441 raster layers.
... View more
08-24-2018
06:37 AM
|
0
|
23
|
4085
|
POST
|
Having to use social media sites (we are blocked from using them) and web links to access images seems very limiting. Is there a way to load images from computer drives instead? thanks, JF
... View more
02-24-2016
12:51 PM
|
0
|
1
|
2017
|
POST
|
Dan, Thanks for your advice but ended up using "zonal statistics as table" which retained an attribute to join with. Jim
... View more
08-25-2014
01:34 PM
|
1
|
0
|
367
|
POST
|
I would like to assign a percent slope value to individual roads in (polyline) shapefile. So far I have rasterized the road shapefile, created a slope raster (from DEM data), and run zonal statistics using the rasterized polyline file and slope raster which results in a percent slope grid. Now, how can you assign the percent slope values back to the original road shapefile? Unfortunately, the grid that is created from running zonal statistics has no attributes to join to the road attribute table. Thanks, J Fritz
... View more
08-25-2014
09:38 AM
|
0
|
3
|
848
|
POST
|
Kerry, The information in the lookup table identifys all 87 unique fips codes for Minnesota but the feature class of parcel data includes other states so that's why there is a state field in the lookup table as well, all with MN as the attribute. So yes, every fips listed in one field and another field with state abbrev (MN), see attached table. Each exported shapefile should correspond to a single fips code. Also, the path to the SDE layer is as follows: Database Connections\LAND_P.sde The feature class is called: PARCELS.PARCELS Hope this all helps! Jim Oh, I forgot the attributes of the PARCELS.PARCELS table. They are: FIPS and STATE_CODE thanks! Jim
... View more
06-24-2014
11:33 AM
|
0
|
0
|
659
|
POST
|
Hi Jim, The paths do help. It isn't clear to me, however, exactly what information is in your lookup table or how you want to use it. For example, does the lookup table identify which fips codes belong to which state? If so, how? Is every fips code listed in one field, with another field providing the name of the state the code belongs to? Will each shape file correspond to a single or multiple fips codes? I would need to understand these kinds of relationships between relevant fields, and to know the names of the fields, in order to incorporate the lookup table into the script. Kerry Kerry, The information in the lookup table identifys all 87 unique fips codes for Minnesota but the feature class of parcel data includes other states so that's why there is a state field in the lookup table as well, all with MN as the attribute. So yes, every fips listed in one field and another field with state abbrev (MN), see attached table. Each exported shapefile should correspond to a single fips code. Also, the path to the SDE layer is as follows: Database Connections\LAND_P.sde The feature class is called: PARCELS.PARCELS Hope this all helps! Jim
... View more
06-24-2014
11:14 AM
|
0
|
0
|
659
|
POST
|
Hi Kerry, Thanks for the quick response. Not being a Python script writer, I'll need some more code, please. First, the fips code field in both the sde and related table is a string field. I now have a "state" field (string) in the look-up table so I'll need those extra 4 lines of code you mentioned. For the connection to SDE, here is what the Instance field reads under Layer Properties, "sde:oracle$sde:oracle11g:LANDP.xcelenergy.com". Looks different than yours. Any assistance would be appreciated! Jim Kerry, Here is some more info that may help. Pathname to SDE layer: S:\General-Offices-GO-Trans\SLR-Mapping\GIS_Analysis\GIS_Data\LAND_P.sde\PARCELS.PARCELS Pathname to lookup table: S:\General-Offices-GO-Trans\SLR-Mapping\GIS_Analysis\GIS_Data\County_Boundaries\Minnesota\mn\County_List_MN.dbf Jim
... View more
06-24-2014
07:43 AM
|
0
|
0
|
659
|
POST
|
Hi Kerry, Thanks for the quick response. Not being a Python script writer, I'll need some more code, please. First, the fips code field in both the sde and related table is a string field. I now have a "state" field (string) in the look-up table so I'll need those extra 4 lines of code you mentioned. For the connection to SDE, here is what the Instance field reads under Layer Properties, "sde:oracle$sde:oracle11g:LANDP.xcelenergy.com". Looks different than yours. Any assistance would be appreciated! Jim
... View more
06-24-2014
06:00 AM
|
0
|
0
|
659
|
POST
|
I have an SDE layer of parcel data from which I want to export out (by state code and county fips code) each county separately into it's own shapefile. I have a list of state and fips codes in a separate dbf. I suppose there is a way to pass values from the dbf listing to perform the exports. Could someone help with providing a Python script to work with? Many thanks in advance! Jim F.
... View more
06-23-2014
12:23 PM
|
0
|
6
|
980
|
POST
|
An extra or erroneous line is being added to the pdf hardcopy. When viewing the pdf on screen, it is fine, no extra lines. When the pdf is sent to either a printer or a plotter, an extra line shows up. The extra line is the same color as the polyline data that is part of the pdf. Very annoying ..... Any help on this would be appreciated. Jim F.
... View more
07-26-2013
09:41 AM
|
1
|
18
|
19230
|
POST
|
For some reason the eraser tool is greyed out. Does anyone have any idea why this might be? Thanks!
... View more
07-08-2013
07:34 AM
|
0
|
0
|
1951
|
Title | Kudos | Posted |
---|---|---|
1 | 08-24-2018 08:48 AM | |
2 | 11-16-2018 07:17 AM | |
1 | 10-29-2018 09:11 AM | |
1 | 07-26-2013 09:41 AM | |
1 | 08-25-2014 01:34 PM |
Online Status |
Offline
|
Date Last Visited |
11-11-2020
02:23 AM
|