|
POST
|
I am guessing you are using the wrong clip. If you are using the Clip(analysis) then it only works with vector data. If you need to clip a raster, you need to use Clip(Data Management). If that is not your problem, I would try the Extract by Mask, tool, you can use vector data for the mask. Hope this helps
... View more
06-18-2014
06:11 AM
|
0
|
0
|
803
|
|
POST
|
First off, make sure you turn off the index grid, or move it beneath your lidar points. Currently it is covering them even if they were displaying. LIDAR data is limited in display in ArcGIS to about 5 million points, and if too many are in the visible extent they will not display in some cases. I'd right click LIDAR dataset and set the point display tab to 5 million(the max), I believe the default is 800,000. Depending on how large your dataset is, you will need to zoom in futher to your map for the points to display.
... View more
06-17-2014
12:45 PM
|
2
|
0
|
9309
|
|
POST
|
Easiest thing to do would to create an empty list outside of your loop, then have each file path append itself to the list. import arcpy import os # Set the current workspace gdbInput = "Q:\PIR\GIS\Brett\GDB Import Tool\Test Data\PIR_MR98copy.gdb" gdbOutput = "Q:\PIR\GIS\Brett\GDB Import Tool\Test Data\EmptyGisDeliverables_v14.gdb" arcpy.env.workspace = gdbInput # Create list of datasets in input gdb dsInput = arcpy.ListDatasets() #print dsInput #make empty list to append file paths to. fclist = [] #Create list of fc in ds for ds in dsInput: fcInput = arcpy.ListFeatureClasses(feature_dataset=ds) for fc in fcInput: filepath = [gdbOutput+ "/" + ds + "/" + fc] fclist.append(filepath) arcpy.env.workspace = gdbOutput for path in fclist: if not arcpy.Exists(path): print "no {}".format(path) else: print "yes {}".format(path)
... View more
06-17-2014
12:21 PM
|
0
|
0
|
1030
|
|
POST
|
Easiest way to bring in excel tables is opening the catalog and navigating to the folder location. From there you can either add the table to the Table of contents, right click and select display x,y data, or right click on it in the catalog right click on the sheet in the xls file, then make feature class > from XY data. The add XY Coordinates tool adds Point_X and Point_Y fields to feature layers or feature class.
... View more
06-17-2014
10:48 AM
|
0
|
0
|
408
|
|
POST
|
Really, you just need to iterate through each feature class, and concatenate the workspace, the feature dataset and feature class name together.
import arcpy
import os
# Set the current workspace
gdbInput = "C:\Users\iamurray\Desktop\Test.gdb"
gdbOutput = "Q:\PIR\GIS\Brett\GDB Import Tool\Test Data\EmptyGisDeliverables_v14.gdb"
arcpy.env.workspace = gdbInput
# Create list of datasets in input gdb
dsInput = arcpy.ListDatasets()
#print dsInput
#Create list of fc in ds
for ds in dsInput:
fcInput = arcpy.ListFeatureClasses(feature_dataset=ds)
for fc in fcInput:
print gdbInput + "/" + ds + "/" + fc
This gives me C:\Users\iamurray\Desktop\Test.gdb/Test1/TestFC2 C:\Users\iamurray\Desktop\Test.gdb/Test/TestFC
... View more
06-17-2014
10:39 AM
|
0
|
0
|
1030
|
|
POST
|
Its likely because you need to specify the workspace path(the folder the file is in, not the file) with the first parameter, and then the workspace type (optional) then dataset name(optional) then validate(optional). If you give the workspace in the first parameter, and not the file itself, it will probably work. So it would be newpath = r"Z:\Working" layer.replaceDataSource(newPath, "None")
... View more
06-17-2014
10:27 AM
|
0
|
0
|
1049
|
|
POST
|
One last gasp at this. See if you can do a TIN Edge, to convert it to lines, then clip the lines by a the coastline boundaries(if you have them), then use create TIN using the clipped lines as your input feature class. I've never tried this so no idea if it works. Or perhaps do a clip, if you had the coastline boundaries as a shapefile or feature class to cut out all of that part of the raster?
... View more
06-17-2014
08:10 AM
|
0
|
0
|
1123
|
|
POST
|
The units are usually whatever units your data frame is in, so if you are in inches, and we are talking a large waterbody, it might need to be a pretty large edge length, though you can change your data frame units. You can do a Tin Edge conversion to convert your tin to lines and measure some of your lines to check about what length to use. Also, if these are internal watebodies, lake, pond, etc, you will need to the ALL Method, so it check the length of all lines, not just ones on the perimeter which is more for coastlines, where only one side of the map really needs to be cut out.
... View more
06-17-2014
07:08 AM
|
0
|
0
|
1123
|
|
POST
|
There is actually a good tool for this. Check out Delineate Tin Data Area. Usually since the DEM is flat for bodies of water, as there are no elevations points there for interpolating, they end up with the largest edge lengths, so you can set a threshhold length for your tin edges. If they are longer than the threshhold, they will not be include in your output TIN. Let me know if this works for you
... View more
06-17-2014
05:54 AM
|
0
|
0
|
1123
|
|
POST
|
It should be a fairly easy task. There is a good thread on this, which you can find here. All you should need to do is use a list function, to get all your wells into a list, then loop over them all and make your feature layers and add them to the map.
... View more
06-16-2014
11:18 AM
|
0
|
0
|
786
|
|
POST
|
Not sure this is it, but in the error code it threw, it shows a single quote starting your file location and no single quote ending it. Also, the file is just a fc in the gdb, not within a feature dataset or anything, if it is, you need to add the feature dataset to your file path. You shouldn't need to hard code the file path, since you set your environment, it will automatically check that location for the file, so you could do fc = "Mains", though for the sake of this particular script I'd leave it alone til it is working. Make sure you don't have the file Mains open in ArcCatalog or ArcGIS, it will have a lock on it making you unable to access it with the cursor(I think). Edit: Haha, yes always lots of error codes. I always get tons of them on scripts I write, but it feels to much better by the time works right. For future reference, I'd write small parts of code at a time, debugging each section as I go. Once you get one section working, move to the next, it makes it easier to handle errors, and you get small victories as you go, instead of a pile of possible errors at the end.
... View more
06-13-2014
12:35 PM
|
0
|
0
|
1133
|
|
POST
|
I see you switched over to arcpy.da.cursor, and that is part of what is causing the new issue. arcpy.da.SearchCursor(fc,Qry, fields) as Qry: first parameters is your fc, second parameter is fields (as a list, which you did, great job!), third parameter is the where clause so it should be
with arcpy.da.SearchCursor(fc, fields, Qry) as cursor: """(you don't want to use Qry, since that variable is already declared) """
for row in cursor:
rptMat = str(row.getValue("Material"))
rptDiam = str(row.getValue("Diameter"))
rptSys = str(row.getValue("System"))
I just finished my first python class last semester, and it frustrated a good half of the class alot, especially since almost none of us had a CS background. Edit: Greg I noticed that extra quotation as well, but I figured she had already gotten past that syntax error, with the error code she was throwing
... View more
06-13-2014
11:55 AM
|
0
|
0
|
1454
|
|
POST
|
Query expressions can be a bit annoying to put into a python script, especially if you have to store them as a string. try
Qry ="'Material' = \"Plastic\""
Check this link for more help on building query expressions
... View more
06-13-2014
11:31 AM
|
0
|
0
|
1454
|
|
POST
|
Hi Esther Out of curiousity are what version of ArcGIS are you on? If you are on 10.1 or higher I would highly recommend using the arcpy.da.SearchCursor, since they are faster and the inputs are a little easier to use. When using the old style cursors, the fields are the 4th parameter, not the third. so you would need a placeholder string between the query and your fields. Secondly, the issue is your made your field parameter fields = "Material;Diameter;System" This is likely what is causing it to crash, I would either declare the fields to a variable called fields before the cursor or just hard code the fields names in the cursor. Its looking for a string value, whereas you are making a variable there.
arcpy.SearchCursor(fc,Qry, "", "Material; Diameter; System")
alternatively:
fields = "Material; Diameter; System"
arcpy.SearchCursor(fc,Qry, "", fields)
... View more
06-13-2014
10:20 AM
|
0
|
0
|
1454
|
| 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
|