|
POST
|
Hi Cesar, It's likely due to the fact that geodatabase field names must be in brackets for SQL expressions. Try this instead for that line of code arcpy.SelectLayerByAttribute_management(Layer, "NEW_SELECTION" , "[ID] = " + ID) I'm not at a computer where I can check it right now. Also check the link below about making SQL expressions ArcGIS Desktop Hope this helps!
... View more
07-15-2014
09:23 AM
|
1
|
2
|
2221
|
|
POST
|
Peter, Have you looked at the ArcHydro downloadable extension? It should allow you to burn streams into your DTM, overriding the existing pixel values. Arc Hydro Overview | ArcGIS Resource Center Problems with Burn Stream slope and DEM Reconditioning http://www.google.com/url?sa=t&rct=j&q=&esrc=s&frm=1&source=web&cd=1&ved=0CB0QFjAA&url=http%3A%2F%2Fdownloads.esri.com%2… Hope this gets you in the right direction
... View more
07-11-2014
06:43 AM
|
0
|
6
|
2671
|
|
POST
|
Also would like to mention that the United States Interagency Elevation Inventory contains bathymetric LIDAR, bathymetric surveys, and IFSAR data as well.
... View more
07-10-2014
02:37 PM
|
1
|
0
|
1136
|
|
POST
|
Just making a discussion thread where information on LIDAR repositories can be found online. One quite beneficial one when trying to determine if there is LIDAR coverage of an area is the NOAA hosted United State Interagency Elevation Inventory. United States Interagency Elevation Inventory This resources shows where known LIDAR has been flown, who manages the data, information about the data accuracy, and contact information or links for download of the LIDAR data. If you know of other good resources for LIDAR data, please feel free to add to this discussion.
... View more
07-10-2014
02:33 PM
|
1
|
3
|
4936
|
|
POST
|
Glad you got it worked out! If you got any other questions about it, feel free to ask them here, or you can post stuff in Python and GIS Developers Also with the new system be sure to tag your post python if you got python related questions so people can find them easier.
... View more
07-10-2014
02:27 PM
|
0
|
9
|
2221
|
|
POST
|
You should be able to do a join between the geocoding output and the original table, and you can use that for your mapping purposes. As for doing so during the geocoding process, its been ages since I've geocoded, so I couldn't tell you(and since its no longer free, I'm not going to try and find out)
... View more
07-10-2014
11:30 AM
|
0
|
1
|
844
|
|
POST
|
Its crashing prior to the Select by Attribute, when its making the layer object. I changed the Layer Name Parameter to a Layer type, and it still ran, so if you want to do it that way it should work. I made it as a string originally so it could be run in ArcCatalog(which seems to speed up geoprocessing opposed to ArcMap, if you knew python better, you would just be able to change the varialbes and it could run outside of Arc entirely, which would make it even faster, but oh well.) Btw, this script is made to work only if your Layer has a field called ID, not FID or OID or anything different from that, and it should be able to handle all characters for the ID value, just make it what it shows in the attribute table. Also the layer must already be in a saved mxd file if that wasn't clear before. Also remember python is case sensitive so if the Layer Name is Arctest_01, it will crash for ArcTest_01. For the ID number just enter as it shows in the attribute table, no other characters. I've tested this on two map documents and it should work fine. If you want to change the Layer Parameters thats fine, it worked both ways for me.
... View more
07-10-2014
11:26 AM
|
2
|
11
|
2221
|
|
POST
|
Hello Again, I just unzipped a new copy of the toolbox, and the script was in there(see attached) I can go ahead and post my code, and I'll put a screenshot of how the parameters were set up as well if you want. When you open the tbx in ArcCataog it should show a script which you can double clcik and run(incidentally, what version of ArcGIS are you running? That can effect toolboxes).
#Importing Modules
import arcpy
#Declaring Variables
ID = arcpy.GetParameterAsText(0)
OutputLocation = arcpy.GetParameterAsText(1)
#Assembling Map - Selecting MXD, Dataframe, and Selecting Layer by Attribute
#Creating a Map Document Object within python, referencing the .mxd you want to work with.
mxdpath = arcpy.GetParameterAsText(2)
mxd = arcpy.mapping.MapDocument(mxdpath)
#Once you have a map document object in python, you can access its various elements, now we need to access the dataframe the layer you are using is in.
#The line of code below makes a list of all the dataframes in the map document object we made. The [0] returns the first dataframe in our map document,
#if you need to access additional dataframes, you would use a different index, we now have made a dataframe object in python and can access the layers in it
df = arcpy.mapping.ListDataFrames(mxd,"*")[0]
#Now to Create a Layer Object, the line of code below returns a list of all the layers in the dataframe, with this name. The [0] returns the first layer with that name instead of the whole list
LayerName = arcpy.GetParameterAsText(3)
Layer = arcpy.mapping.ListLayers(mxd, LayerName, df)[0]
#Selecting by Attribute, Zooming to Feature, and Setting Scale
#This line performs a select by attribute on our Layer object, using a new selection, with an SQL query of ID = the ID variable we created using getparameterAsText(0)
arcpy.SelectLayerByAttribute_management(Layer, "NEW_SELECTION" , "ID = " + ID)
scale1 = arcpy.GetParameterAsText(4)
scale2 = arcpy.GetParameterAsText(5)
scale3 = arcpy.GetParameterAsText(6)
scales = [scale1, scale2, scale3]
for scale in scales:
#Selecting by Attribute, Zooming to Feature, and Setting Scale
#This line performs a select by attribute on our Layer object, using a new selection, with an SQL query of ID = the ID variable we created using getparameterAsText(0)
arcpy.SelectLayerByAttribute_management(Layer, "NEW_SELECTION" , "ID = " + ID)
#This zooms the dataframe to the selected feature
df.zoomToSelectedFeatures()
df.scale = scale
#Clearing selected features so they do not show up selected on map
arcpy.SelectLayerByAttribute_management(Layer, "CLEAR_SELECTION")
mxdname = mxd.filePath.split("\\")[-1]
mxdname = mxdname.replace(".mxd" , "")
#Exporing map dataframe view to pdf, I have it set up to save
arcpy.mapping.ExportToPDF(mxd, OutputLocation + "/" + mxdname + "ID_" + ID + scale + ".pdf", "Page_Layout", 640, 480)
I sent a new copy of the toolbox, the two images, and the actual python script file, so you don't have to copy the code posted.
... View more
07-10-2014
09:13 AM
|
2
|
14
|
6462
|
|
POST
|
I apologize about the first script tool I loaded, I forgot to save the script I was working on as a .py, I left it as a .txt, so it couldn't be editted from the catalog. From your last response you seem to want to iterate over all the ID fields in a layer, and then export PDFs of each of those IDs at 3 pre-defined zooms. I fixed my script tool, and made it take 7 parameters, that way you don't need to modify the script at all(unless you want to change how they name when they export, I've made the script export with the mxd name, then ID Number, then the Scale Number, so they are all differnt names on export. Currently the tool, will let you export them by ID one at a time, but if you need to iterate all ID's in a Layer and export them all at the same scale, then the script could be changed to do them all at once, and should be faster that way. I've tested this script tool this time(was in a bit of a rush last time), so it should be out of the box useable, just unzip, navigate to the toolbox in ArcCatalog, open the tool, fill in the parameters and let it run. To fill in the Output Location, you can either navigate to it from the tool, or click and drag it to the input, same for the MXD parameter. For the Layer Name, make sure you copy the name exactly as it shows up in the table of contents in your map document. Hope this does what you need, if you want it editted to do all ID's in a Layer, it should be a fairly easy adjustment. Edit: To run the tool as is, it took my 5 year old computer about 42 seconds, hopefully yours goes a bit quicker.
... View more
07-10-2014
06:44 AM
|
0
|
16
|
6462
|
|
POST
|
There is an edit option under actions if I try to edit it while viewing the thread under the content tab. Right now under the home tab > recent activity (stream?), from which I am replying now, when I go to actions it says "No Actions Available." Perhaps this should be fixed
... View more
07-08-2014
08:38 AM
|
0
|
0
|
2239
|
|
POST
|
I'm terribly sorry, I didn't realize my hyperlink didn't post last time. Raster to DEM USGSDEM -- USGS ASCII DEM (and CDED)
... View more
07-08-2014
07:54 AM
|
0
|
0
|
3374
|
|
POST
|
It is somewhat infuriating that one cannot edit a post they have already made(or at least I can't figure it out!)
... View more
07-08-2014
06:40 AM
|
0
|
0
|
2239
|
|
POST
|
"As for the current Discussion Forum and its over 100,000 threads, nothing will be lost. It is all being imported into GeoNet, tagged, browsable, indexed, and searchable." That was his original post and I didn't see anything subsequent to overrule that statement. Easiest way to find posts are by going to the contents tab, then you can search by text. Also, it would help if we follow streams, or people then we can search by who we are following as well. You can also find topics you have authored, or ones you are following(i.e. you replied to in the past) by selected them over on the right side.
... View more
07-08-2014
06:39 AM
|
1
|
3
|
2239
|
|
POST
|
The old forums did get ported over, if you search content and show oldest date created it has threads from 2009 to present in the new geonet community. I agree though this new format for the forums will take alot of getting use to. Perhaps if they had a forum guide or tutorial posted it would be more helpful.
... View more
07-08-2014
06:24 AM
|
0
|
15
|
1927
|
|
POST
|
You could add a script to a toolbox and make a script tool out of it. You would have to make 3 parameters in the tool, one for the input folder(make it a folder type), one for the input text(make it a string type) and one for the output text (make it a string type) You would have to replace folder = r"\\sample\sample" oldtext = "Township" newtext = "Borough" with folder = arcpy.GetParameterAsText(0) oldtext = arcpy.GetParameterAsText(1) newtext = arcpy.GetParameterAsText(2) The 0, 1, 2 pull the first, second, and third parameters you make respectively in the script tool. Check out this link on how to make a script tool. It also has links for setting up the parameters.
... View more
07-03-2014
01:36 PM
|
0
|
0
|
2677
|
| Title | Kudos | Posted |
|---|---|---|
| 1 | 02-22-2017 08:58 AM | |
| 1 | 10-05-2015 05:43 AM | |
| 1 | 05-08-2015 07:03 AM | |
| 1 | 10-20-2015 02:20 PM | |
| 1 | 10-05-2015 05:46 AM |
| Online Status |
Offline
|
| Date Last Visited |
11-11-2020
02:23 AM
|