|
POST
|
I just tried uploading a zip file containing a simple python add-in and source code which failed at the same point as yours. Attempting to upload just the .esriaddin also fails at "X Processing initial Upload."
... View more
09-22-2015
07:19 PM
|
1
|
0
|
1236
|
|
POST
|
If the string is always separated by an underscore, you could use the string "split()" method: int('C000004N_37'.split('_')[1]) This splits the string into a list with two elements at the underscore, selects the 2nd element (python lists are numbered starting from 0) and converts that to integer.
... View more
09-17-2015
01:14 PM
|
1
|
4
|
6529
|
|
POST
|
Karolina Korzeniowska: Thank you. I did not know about this option. I have found two mistakes which I corrected. But I still have two more errors, which I do not know how to remove. The errors are: Traceback (most recent call last): File "<string>", line 41, in getParameterInfo File "c:\program files (x86)\arcgis\desktop10.3\arcpy\arcpy\arcobjects\_base.py", line 94, in _set (attr_name, self.__class__.__name__)) NameError: The attribute 'list' is not supported on this instance of Filter. You haven't specified the type of filter: Defining parameters in a Python toolbox—Help | ArcGIS for Desktop
... View more
09-16-2015
02:13 AM
|
1
|
1
|
3500
|
|
POST
|
No it's not possible. You can embed a python script tool in a binary toolbox (.tbx) and password protect it - Embedding scripts and password protecting tools—Sharing geoprocessing workflows | ArcGIS for Desktop
... View more
09-16-2015
12:04 AM
|
1
|
1
|
1390
|
|
POST
|
Freddie, your code doesn't pick up Python Toolboxes. I've tweaked your 3rd example to include .pyt's import os, uuid
import arcview, arcpy
# Third Option
def LocateToolboxes3(workspace):
walk = arcpy.da.Walk(workspace)
for dirpath, dirnames, filenames in walk:
tbxPaths = []
if (os.path.splitext(dirpath)[1] in [".tbx", ".pyt"] ):
tbxPaths.append(dirpath)
elif (dirpath.endswith(".gdb")):
for dirname in dirnames:
tbxPath = os.path.join(dirpath, dirname)
if (arcpy.Describe(tbxPath).dataType == "Toolbox"):
tbxPaths.append(tbxPath)
if (tbxPaths == []):
continue
for tbxPath in tbxPaths:
print("TBX: {0}".format(tbxPath))
alias = arcpy.ValidateFieldName(str(uuid.uuid4()).split("-")[-1])
arcpy.ImportToolbox(tbxPath, alias)
for tool in arcpy.ListTools("*_{0}".format(alias)):
print("...TOOL: {0}".format(tool))
... View more
09-09-2015
03:48 PM
|
1
|
0
|
3454
|
|
POST
|
If you have access to ENVI, the user contributed Landsat gapfill tool is very good at filling the gaps. The tool covers the three USGS gap fill methods: single image triangulation interpolation two image global histogram matching two image local histogram matching The two image methods require two SLC-Off scenes, one to be filled and one to fill with. I try to stick to scenes from the previous or next cycle but that's not always possible due to cloud. The 3rd method "two image local histogram matching" is the most computationally expensive, but produces by far the best results. Before: After local histogram matching and pansharpening:
... View more
09-03-2015
04:02 PM
|
2
|
0
|
12536
|
|
POST
|
Xander, I'm using 10.2.2 and it works. Did you find a workaround in 10.3?
... View more
08-19-2015
06:31 PM
|
1
|
2
|
2876
|
|
POST
|
Wes, this won't work because a license is checked out when arcpy is imported which defaults to highest available (arcinfo if one is available, arceditor if not, or arcview if all else fails). You need to import arcview/arceditor/arcinfo before arcpy. Like this: import arceditor
import arcpy
print arcpy.ProductInfo() ArcEditor Not like this: import arcpy
import arceditor
print arcpy.ProductInfo() ArcInfo
... View more
08-19-2015
05:42 PM
|
2
|
2
|
2876
|
|
POST
|
Do you have the mxd open when you run that code? Are you expecting changes you make to the mxd file on disk to appear in the currently open ArcMap session? Are you calling mxd.save()? Basically "CURRENT" is for interacting with the currently open ArcMap session. arcpy.mapping.MapDocument(filepath) is for interacting with an mxd file on disk. If you have the mxd file open, any changes you make to the file won't be reflected in the open ArcMap session.
... View more
08-12-2015
08:56 PM
|
1
|
7
|
4278
|
|
POST
|
Have a look at arcpy.da.walk and arcpy.management.copy. ArcGIS Help (10.2, 10.2.1, and 10.2.2) ArcGIS Help (10.2, 10.2.1, and 10.2.2)
... View more
08-12-2015
04:05 AM
|
1
|
1
|
1352
|
|
POST
|
I just added 10 parameters with no issue. The last 6 params shown below, the first 4 are visible when scrolling up in the dialog box. We might be able to assist further if you provide a little more info on how you're trying to add the parameters and confirm what type of toolbox you are using (normal ".tbx" v. python ".pyt" toolbox)?
... View more
08-03-2015
04:13 PM
|
1
|
1
|
1618
|
|
POST
|
Dan Patterson: ...one suggestion is to specify encoding at the top of the script with # -*- coding: utf-8 -*- This only applies to literal characters in the python script file itself, not any string variables when the script is run. test_noenc.py somestr = u'über còól'
print somestr test_enc.py # -*- coding: utf-8 -*-
somestr = u'über còól'
print somestr C:\Temp>python test_noenc.py File "test_noenc.py", line 1 SyntaxError: Non-ASCII character '\xfc' in file test_noenc.py on line 1, but no encoding declared; see http://python.org/dev/peps/pep-0263/ for details C:\Temp>python test_enc.py über còól
... View more
07-30-2015
10:39 PM
|
0
|
3
|
4750
|
|
POST
|
Buried in the comments of the blog post: Kevin Butler says: The goal is to have SciPy included with the 10.4 release (Server and Desktop) which will tentatively ship fourth quarter of 2015. April 21, 2015 at 9:38 am Curtis Price says: So you’ve changed plans? The article above says: At the 10.3.1 release, SciPy will be automatically installed with ArcGIS for Desktop. So I am looking at it with the 10.3.1 release – not there! Bummer! May 19, 2015 at 10:45 am Kevin Butler says: Curtis: The release strategy changed after the blog was released. The full strategy is outlined in this video from the Developer Summit: : http://video.esri.com/watch/4231/python-for-the-arcgis-platform May 20, 2015 at 10:29 am
... View more
07-23-2015
03:40 PM
|
0
|
4
|
3253
|
|
POST
|
CheckInExtension doesn't release ArcGIS licenses, only extension licenses (i.e spatial analyst, data interoperability, etc.). You can't release your ArcGIS license without closing Pythonwin. If you want to release your license when your script finishes, run it from a command prompt or use a more advanced IDE such as PyScripter, Wing or PyCharm that can run the script as an external process.
... View more
07-19-2015
05:04 PM
|
1
|
0
|
1111
|
| 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 |