|
POST
|
You can try searching each band. And no it shouldn't matter if it is in a GDB or not, but I can't speak to every raster format possible. I'm sure some formats don't support this. Give this a try, assuming you are dealing with bands 1,2,3. bands = ['Band_1', 'Band_2', 'Band_3']
for band in bands:
desc = arcpy.Describe(os.path.join(raster, band))
desc.noDataValue
... View more
04-23-2014
09:29 AM
|
0
|
0
|
1404
|
|
POST
|
If they are multiple bands what are your no data values you are looking for? 0,0,0?
... View more
04-23-2014
09:10 AM
|
0
|
0
|
1404
|
|
POST
|
This link should work. http://support.esri.com/en/bugs/nimbus/TklNMDk3Mjcz
... View more
04-23-2014
08:11 AM
|
0
|
0
|
1289
|
|
POST
|
If they are single band rasters this should work. desc = arcpy.Describe(raster)
desc.noDataValue
... View more
04-23-2014
08:02 AM
|
0
|
0
|
1404
|
|
POST
|
You need to reference it using self. ToolClass is the name of your class and self is how the class is referenced when you are within that class. Result = self.MyFunction(inFeatureLayer) I don't think there is anything in the .pyt format that would prevent this functionality but I have not tested this myself.
... View more
04-23-2014
06:16 AM
|
0
|
0
|
1193
|
|
POST
|
It is sql then....'''{0} < 0'' ... fascinating. If the condition is less then 0 then ...go forward... with the .format command? It is just simple string substitution. The format method is just inserting the delimited OID field name. It's broken onto two lines to ease readability.
template_query = '''{0} < 0'''.format(arcpy.AddFieldDelimiters(input_fc, arcpy.Describe(input_fc).OIDFieldName)) https://docs.python.org/2/library/string.html#format-string-syntax
... View more
04-22-2014
10:04 AM
|
0
|
0
|
554
|
|
POST
|
Yes that should allow you to reference it within the class using self.
... View more
04-22-2014
09:39 AM
|
0
|
0
|
1193
|
|
POST
|
It's for constructing a query that returns no results. It's the quick and dirty way of creating an empty template from an existing feature class.
... View more
04-22-2014
09:17 AM
|
0
|
0
|
554
|
|
POST
|
You are trying to reference it at the class level without using self which won't work. You need to pass self to the function so the class can reference it, declare it within another function, or reference it outside the class.
... View more
04-22-2014
09:03 AM
|
0
|
0
|
1193
|
|
POST
|
Just trying to follow...you mean use an InsertCursor instead of SearchCursor? No, you will need to create an empty output feature class template based on your source feature class. Here is how I do it. You may want to use some field mapping depending on if you need to limit the fields from source to output.
template_query = '''{0} < 0'''.format(
arcpy.AddFieldDelimiters(input_fc, arcpy.Describe(input_fc).OIDFieldName))
arcpy.TableToTable_conversion(input_fc, out_dir, output_fc, template_query) Then for each row you want in your output, you put it directly in the output with the insert cursor. Maybe something like this all together. import arcpy
def find_overlaps(input_features, output_features):
template_query = '''{0} < 0'''.format(
arcpy.AddFieldDelimiters(input_features, arcpy.Describe(input_features).OIDFieldName))
arcpy.FeatureClassToFeatureClass_conversion(
input_features, out_dir, output_features, template_query)
field_list = ('OBJECTID', 'SHAPE@', 'name')
with arcpy.da.InsertCursor(input_features, field_list) as insert_cursor:
uniqueList = []
for row in arcpy.da.SearchCursor(input_features, field_list):
for shape in uniqueList:
if row[1].equals(shape):
foundMatch = True
break
if not foundMatch:
insert_cursor.insertRow(row)
uniqueList.append(row[1])
... View more
04-22-2014
08:38 AM
|
0
|
0
|
2362
|
|
POST
|
Yes you will need to make your features a layer of some sort before you copy them out. It will not accept a raw list of features as tuples. A better way to go about this might be to use an insert cursor.
... View more
04-22-2014
07:42 AM
|
0
|
0
|
2362
|
|
POST
|
Nothing after your return is run. Return basically ends the function.
... View more
04-22-2014
07:31 AM
|
0
|
0
|
2362
|
|
POST
|
You have your brackets off. You don't need the whole term in brackets just your listed items. Good DescTerm in ("", " ", None) Bad (DescTerm in '', " ", None) For your second part the easiest way is using the in method. if 'road' in DescGroup
... View more
04-22-2014
06:47 AM
|
0
|
0
|
1236
|
|
POST
|
DescTerm == <Null> is an invalid statement. This should capture any blank or null entries in a string field. if DescTerm in ("", " ", None):
...
... View more
04-22-2014
06:28 AM
|
1
|
0
|
1236
|
|
POST
|
You need to installed the 64-bit GP upgrade from Esri. From the sounds of what you've done on your environment I would uninstall everything and start from scratch.
... View more
04-14-2014
12:07 PM
|
0
|
0
|
602
|
| Title | Kudos | Posted |
|---|---|---|
| 1 | 05-17-2011 10:36 AM | |
| 1 | 08-16-2012 10:48 AM | |
| 1 | 10-31-2012 08:39 AM | |
| 1 | 07-16-2012 01:52 PM | |
| 1 | 03-15-2012 10:57 AM |
| Online Status |
Offline
|
| Date Last Visited |
08-22-2024
11:12 PM
|