|
POST
|
Oops thanks for the correction Wes. Indeed, credit goes to Jon Morris for the code.
... View more
12-14-2015
06:20 AM
|
0
|
1
|
904
|
|
POST
|
Well you could still set up data drive pages especially if your maps are all consistent and using an index polygon layer for paneling such as a town boundary polygon. You could also set up a fishnet of your map area to create a panel scheme. But if you already have it up and running with the text element and python script tool you might as well stick with that.
... View more
12-14-2015
06:18 AM
|
0
|
0
|
904
|
|
POST
|
Are you using data driven pages? If you are then you can use Wes Miller's code in a display expression for your data driven page layer like so: def FindLabel ( ):
from datetime import date, timedelta
return date.strftime(date.today() - timedelta(days=1), '%m/%d/%Y') Then in your dynamic text element you would use this: <dyn type="page" property="expression" /> This works for me and should update automatically for all your maps since it uses the current date code.
... View more
12-14-2015
05:42 AM
|
1
|
5
|
904
|
|
POST
|
The double backslash or the a single forward slash can be used for storing and parsing paths. A single backslash is an escape character in the python language so that would cause problems if you were attempting to use that.
... View more
12-09-2015
11:41 AM
|
1
|
1
|
1410
|
|
POST
|
Lara, I'm guessing you are getting an error because of the search cursor. I think I forgot to finish the code for the search cursor the last time I gave it to you. It should be this: arcpy.da.SearchCursor(Catchment,["OID@","Outlet_ID"],where_clause = '{0} = {1}'.format(arcpy.AddFieldDelimiters(CHM_Input, oidField),Raster_Number)).next()[1] I'm not sure why you are getting a "\\Service" tagged to your output name. If it was working fine for you before then I would suggest going back the way you had it before. On another note it might be helpful for us to see an arc catalog screen shot of your workspace folder with the raster files.
... View more
12-09-2015
11:14 AM
|
1
|
3
|
5929
|
|
POST
|
Does this text element have an element name? I think you might be looking for something like this: import arcpy
from arcpy import env
env.workspace = # Folder with mxds
for mxds in arcpy.ListFiles("*.mxd"):
filePath = os.path.join(env.workspace, mxds)
mxd = arcpy.mapping.MapDocument(filePath)
for elm in arcpy.mapping.ListLayoutElements(mxd, "TEXT_ELEMENT"):
if elm.name == "Draft":
elm.text = ""
mxd.save()
del mxd There may be a way to actually delete the text box, but this code will at least replace the "Draft" text with an empty string, if the element name is called "Draft". If you do not have an element name then you could use something like this import arcpy
from arcpy import env
env.workspace = # Folder with mxds
for mxds in arcpy.ListFiles("*.mxd"):
filePath = os.path.join(env.workspace, mxds)
mxd = arcpy.mapping.MapDocument(filePath)
for elm in arcpy.mapping.ListLayoutElements(mxd, "TEXT_ELEMENT"):
if elm.text == "Draft":
elm.text = ""
mxd.save()
del mxd
... View more
12-09-2015
10:39 AM
|
1
|
1
|
929
|
|
POST
|
It looks like you did not assign your 'id' for the search cursor. Try something like this: Raster_Number = int(re.findall('\d+', feature)[0]) then your search cursor would be fieldValue = arcpy.da.SearchCursor(Catchment,["OID@","Outlet_ID"],where_clause = '{0} = {1}'.format(arcpy.AddFieldDelimiters(CHM_Input, oidField),Raster_Number)).next()[1] I think you can skip a step or two in creating your output string like removing the '.tif'. You could just set feature_class_string_NoNumber_NoTif = ''.join([i for i in feature if not i.isdigit()]).split(".")[0]
... View more
12-09-2015
09:48 AM
|
1
|
5
|
4520
|
|
POST
|
The iterate raster is a model builder tool only. If you want to use python. You would need to use either List Rasters or walk to get a list of rasters you want to rename. You would need to run a Data Access Search Cursor on your polygon to match the FID row and get the field value that you want. Finally you would construct a string name using the field value and run rename for each raster. Using the split tool your output rasters are named something like "Raster_0" correct? So you would need to split that name to get the FID number and then run a da search cursor on your polygon feature like this: import arcpy
from arcpy import env
env.workspace = #workspace path for your raster folder
polygon = # path to your polygon
fieldName = # Name of the field you want the value from
for raster in arcpy.ListRasters():
id = int(raster.split("_")[-1])
oidField = arcpy.Describe(feature).oidFieldName
fieldValue = arcpy.da.SearchCursor(feature,["OID@",fieldName],where_clause = '{0} = {1}'.format(arcpy.AddFieldDelimiters(feature,oidField),id)).next()[1]
newName = "Raster_"+fieldValue
arcpy.Rename_management(raster,newName) EDITED:I edited the code in hopes that it might clarify things a bit better. The raster.split("_") is assuming the raster names are something like 'Raster_0", but you may need to modify this to pull out the FID number.
... View more
12-09-2015
05:59 AM
|
1
|
7
|
4520
|
|
POST
|
You should just be able to use Unique Value symbology for one or more fields. There are also other symbology options available.
... View more
12-09-2015
05:13 AM
|
0
|
0
|
1851
|
|
POST
|
You could use the iterate rasters with the rename tool in a model builder. I almost think it would be easier to make a tool that iterates features and then clips the rasters. You could use get field value tool to generate the naming output.
... View more
12-09-2015
04:40 AM
|
0
|
9
|
4520
|
|
POST
|
What type of feature class is this? Are you looking to just have one label per feature? You Dissolve—Data Management toolbox | ArcGIS for Desktop on the Letter ID field and use the statistics type 'COUNT' option parameter on the ID field. After you do the dissolve you can label it using an expression similar to this : [Label] +"("+ [COUNT_ID] +")"
... View more
12-04-2015
04:35 AM
|
1
|
0
|
1157
|
|
POST
|
Okay. You should try it on a single polygon first to see if that gives you the desired result. If it does and you have a large dataset to work with you could easily automate this task using model builder or python to at least produce a contour line for each polygon. We could help you set it up.
... View more
12-03-2015
05:09 AM
|
0
|
0
|
3113
|
|
POST
|
Do you have a digital elevation model (DEM) that has elevation in meters to work with? If so you could find the current mean elevation of each wetland polygon using the Zonal Statistics as Table—Help | ArcGIS for Desktop . If your wetland polygons are accurate this should give you a decent mean elevation. Then you might consider using the Contour—Help | ArcGIS for Desktop tool to pick out a contour elevation line for each polygon that is the mean elevation plus 1m. The contour lines can be closed to generate a new polygon Feature To Polygon—Data Management toolbox | ArcGIS for Desktop. I would think this would give you a more accurate result because it considers the surrounding topography as opposed to just adding a horizontal buffer on to your existing wetland polygons. EDITED: I forgot to mention the USGS did a similar study of projected sea level rise impacts on salt marshes. The report is here. The approached used in the report is similar to what I suggest doing above.
... View more
12-03-2015
04:01 AM
|
1
|
2
|
3113
|
|
POST
|
Did the find identical work once you found the Shape field then?
... View more
12-03-2015
03:39 AM
|
1
|
1
|
2092
|
|
POST
|
What fields do you have in both tables? Could you maybe provide a screen shot of both tables to see if there is anything we can do to help?
... View more
12-02-2015
08:41 AM
|
0
|
0
|
3081
|
| Title | Kudos | Posted |
|---|---|---|
| 1 | 01-26-2016 10:40 AM | |
| 1 | 10-05-2015 09:10 AM | |
| 1 | 01-19-2016 06:01 AM | |
| 1 | 01-06-2016 05:27 AM | |
| 1 | 12-09-2015 05:59 AM |
| Online Status |
Offline
|
| Date Last Visited |
05-01-2024
04:58 PM
|