|
POST
|
I think you're getting your terminology and tools confused. A layer (.lyr) is not data. Layers just store symbology, labelling, etc. and a link to the underlying data, which can be raster, vector, an online service of some description, or some other data type. I think you're trying to use the wrong Clip tool. Instead of the Clip tool in the Analysis toolbox, which is for vector data, use the Clip tool in the Data Management->Raster->Raster Processing toolset.
... View more
03-23-2016
08:46 PM
|
0
|
0
|
1165
|
|
POST
|
Use symbol level drawing - arcgis desktop - How to hide "internal" polygon boundaries? - Geographic Information Systems Stack Exchange
... View more
03-22-2016
05:15 PM
|
1
|
0
|
1107
|
|
POST
|
C:\Python34\Lib\site-packages\pro.pth C:\Program Files\ArcGIS Pro\bin C:\Program Files\ArcGIS Pro\Resources\ArcPy C:\Program Files\ArcGIS Pro\Resources\ArcToolBox\Scripts C:\Program Files\ArcGIS Pro\bin\Python\Lib\site-packages C:\Python34\Lib\site-packages The above didn't work for me with 1.1 (first time playing with Pro today in a training course). The following worked for me in a pth file: C:\Program Files\ArcGIS\Pro\bin C:\Program Files\ArcGIS\Pro\Resources\ArcPy C:\Program Files\ArcGIS\Pro\Resources\ArcToolBox\Scripts C:\Program Files\ArcGIS\Pro\bin\Python\Lib\site-packages C:\Python34\Lib\site-packages
... View more
03-21-2016
09:50 PM
|
1
|
0
|
5144
|
|
POST
|
Extra bracket in 23. row.setValue("test", (row.getValue(field)) Change it to: row.setValue("test", row.getValue(field)) Also, consider using arcpy.da.Search/InsertCursor instead of arcpy.Search/InsertCursor, the new (at 10.1) cursors are much faster and have easier and more "pythonic" syntax.
... View more
03-09-2016
06:42 PM
|
1
|
3
|
2723
|
|
POST
|
Can you narrow it down to a small snippet that generates the error? What database is the script connecting to? Are you using 32 or 64bit PyScripter? When run from the command line on the server, are you running in 64 or 32bit python? Do you have the appropriate database driver installed for 32/64 bit python?
... View more
03-07-2016
05:04 PM
|
1
|
1
|
1734
|
|
POST
|
Jose Sanchez wrote: So how do I declare the row object now? You don't, you pass the values as a list/tuple directly to the insertRow method - it's in the help... Methods insertRow (row) Parameter Explanation Data Type row [row,...] A list or tuple of values. The order of values must be in the same order as specified when creating the cursor. When updating fields, if the incoming values match the type of field, the values will be cast as necessary. For example, a value of 1.0 to a string field will be added as "1.0", and a value of "25" added to a float field will be added as 25.0. tuple
... View more
03-06-2016
01:29 PM
|
1
|
0
|
8150
|
|
POST
|
Just off the top of my head, you could do something like the following using a python toolbox: class SomeTool(object):
def __init__(self):
self.some_variable = None
#etc...
def getParameterInfo(self):
#etc...
return params
def updateParameters(self, parameters):
result = arcpy.ATool_SomeToolbox('somedata')
self.some_variable = result.GetOutput(0)
def updateMessages(self, parameters):
if self.some_variable is not None:
#Do something
#etc...
self.some_variable = None #reset the variable just in case
... View more
03-03-2016
08:28 PM
|
1
|
1
|
970
|
|
POST
|
03-03-2016
02:54 PM
|
2
|
1
|
5433
|
|
POST
|
Couple of ways to do this easily in the answers to the following GIS Stack Exchange question: python - Access individual bands and use them in map algebra - Geographic Information Systems Stack Exchange I'll throw this in for future reference for other users as the band names are not always guaranteed to be "Band_[1-N]"
... View more
03-03-2016
02:48 PM
|
1
|
0
|
1913
|
|
POST
|
It's not unheard of that ESRI would change a tools license level Dan Patterson, back at ArcGIS 9.0, the 'Add Join' tool was Advanced/ArcInfo only... it's now available with all licenses. But that was a slightly different case where the same functionality was available in the menus/toolbars at any license level, but not as a GP tool and ESRI was sorting that out. Whereas with 'Frequency', I assume the license level is an artifact from its origin as the Arc/INFO (workstation) frequency command. That said, it's still what I would consider a 'basic' tool, with the same functionality available via other methods even without resorting* to code... * I say resorting, but code is often my first choice. That count_combos_demo.py is a neat script btw
... View more
03-03-2016
02:37 PM
|
1
|
3
|
5433
|
|
POST
|
Dan Evans see Code Formatting... the basics++ I edited your post to add the formatting.
... View more
03-03-2016
02:26 PM
|
2
|
0
|
5433
|
|
POST
|
You can use the Frequency tool (if you have an Advanced/ArcInfo license) otherwise use the Summary Statistics tool with the fields you want to get unique combinations for as the "Case Fields". You can then access the output with a search cursor.
... View more
03-02-2016
02:42 PM
|
1
|
3
|
5433
|
|
POST
|
You can do it in one line with a list comprehension. The `if` statement in the list comprehension will handle empty strings. Field calculator expression: ' '.join([s.lstrip() for s in (!LOCN,!LOCD!,!LOCS!) if s]) Basic python (assumes LOC* variables already defined) ' '.join([s.lstrip() for s in (LOCN,LOCD,LOCS) if s])
... View more
02-23-2016
01:39 PM
|
1
|
21
|
2122
|
|
POST
|
Kludgy workaround no longer required (tested on ArcGIS 10.2.2). This simple script works fine as a script tool run multiple times in-process from a binary (tbx) toolbox: import arcpy
from osgeo import gdal
path = r'/path/to/some/raster'
ds = gdal.Open(path)
ras = arcpy.Raster(path)
arr = ds.ReadAsArray()
arcpy.AddMessage(repr(arr))
arr = ds.GetRasterBand(1).ReadAsArray()
arcpy.AddMessage(repr(arr))
arr = arcpy.RasterToNumPyArray(path)
arcpy.AddMessage(repr(arr))
... View more
02-21-2016
02:41 PM
|
0
|
0
|
8235
|
|
POST
|
This is not possible with a python toolbox. You would need to do this in ArcObjects if you want to stay within the ArcGIS geoprocessing/addin framework. Alternatively you could develop a standalone UI using a graphics toolkit, such as PyQT/PySide and embed a matplotlib graph. Something similar to http://stackoverflow.com/questions/12459811/how-to-embed-matplotib-in-pyqt-for-dummies
... View more
02-21-2016
12:37 AM
|
1
|
0
|
1706
|
| Title | Kudos | Posted |
|---|---|---|
| 1 | 07-24-2022 03:08 PM | |
| 1 | 07-30-2025 03:00 PM | |
| 1 | 06-10-2025 08:06 PM | |
| 5 | 05-20-2025 07:56 PM | |
| 1 | 05-04-2025 10:34 PM |