|
POST
|
32.11. compileall — Byte-compile Python libraries — Python 2.7.12 documentation But note that distributing pycs only won't stop people from being able to see your source code if they want to... The benefits (and limitations) of PYC-only Python distribution | Curious Efficiency https://docs.python.org/2/library/compileall.html
... View more
09-19-2016
03:59 AM
|
1
|
0
|
9431
|
|
POST
|
The left justified (fixed width) columns in the ASCII grid header lines are perfectly normal and are not corrupt. Here's an extract of one of my outputs: ncols 1015
nrows 584
xllcorner 1649685.4143459
yllcorner -2394132.3096793
cellsize 25
NODATA_value -9999
1 5 13 24 33 40 47 56 66 etc... If your script is expecting only a single space, then you need to modify your script to parse correctly. BTW If you're parsing ASCII grids, you're "doing it wrong"™. If you explain a little more about what you are trying to do, I think we can suggest some alternatives.
... View more
09-18-2016
05:06 PM
|
0
|
0
|
1363
|
|
POST
|
Additionally, if data is stored in an enterprise GDB, you may need both 32 and 64 bit versions of the database drivers. We have to install a 64 bit Oracle client to access our Enterprise GDB datasets from 64 bit Background Geoprocessing scripts.
... View more
09-16-2016
03:16 AM
|
0
|
0
|
1119
|
|
POST
|
Hi Curtis Price, Yes and no and sort of. I keep a separate Conda env for GDAL stuff and (conda create -n some_new_env -c conda-forge python=3.5 gdal) and keep my ArcGIS Pro env pristine (well pristine so far... ) I had some trouble with the old version of conda that ships with ArcGIS Pro 1.3 as it wouldn't run the GDAL pre and post activation batch files (that set and restore some environment vars). So I upgraded conda, broke ArcGIS Pro completely and had to reinstall... I then ended up installing a separate updated conda to muck around with and leaving ArcGIS Pro completely alone.
... View more
09-13-2016
09:52 PM
|
1
|
4
|
1840
|
|
POST
|
Sorry to be blunt, but that sounds like a very ugly and fragile way of doing it. If you just want Yes/No/Other, use a MessageBox. i.e result = pythonaddins.MessageBox("Press Yes, No or Cancel", "Just do it!", 3)
... View more
08-30-2016
04:33 PM
|
1
|
1
|
539
|
|
POST
|
Clinton, I agree, however... this particular topic is about addins, not tools so by definition will always have some sort of UI. I think using a tool dialog to gather input actually makes it more modular and portable as the script tool can be reused/ported/run as is without needing to rip it out of add-in UI code.
... View more
08-29-2016
07:20 PM
|
3
|
1
|
3402
|
|
POST
|
I use pythonaddins.GPToolDialog to get user input from an addin toolbar. The code that does the work with the user input is contained in the tool that is called by GPToolDialog, rather than in the addin. I package the toolbox and tool inside the addin, in the addin install directory (I use a pyt instead of tbx and py so it's in a single file). Something like: class Button(object):
"""Implementation for test_addin.button (Button)"""
def __init__(self):
self.enabled = True
self.checked = False
def onClick(self):
tbx = os.path.join(os.path.dirname(__file__), "Toolbox.pyt" )
tool = "Tool"
pythonaddins.GPToolDialog(tbx, tool)
... View more
08-28-2016
02:10 PM
|
3
|
2
|
3402
|
|
POST
|
Using the ArcMap Catalog window (or ArcCatalog itself), browse to the offending pyt (don't use the ArcToolbox -> Add Toolbox dialog for this test). Does the toolbox have the "X" or the tools inside? i.e If it's the toolbox (pyt) - right click on the .pyt and select "Check syntax...". If it's the tool - right click on the tool and select "Why...". Post the output (as text, not screenshot).
... View more
08-23-2016
05:04 PM
|
0
|
0
|
2211
|
|
POST
|
Or you can unzip the KMZ, which is just a zip file with the KML file inside. The file you need is usually called 'doc.kml' - KMZ Files Note: an XSLT is not a data format, it's an XML Stylesheet for translating between XML formats - XSLT
... View more
08-13-2016
03:28 PM
|
1
|
0
|
1643
|
|
BLOG
|
From a quick check of the last 2 months, there's almost complete coverage of the US. Have a look at Sentinel-2 on AWS, in particular the Sentinel Image browser (see screenshot below). I find it easier to download the data from the AWS public bucket, rather than from SciHub though as it's split up into 100km tiles so the download is only a few hundred MB instead of a few GB and there's no login or SciHub "maintenance" outages to deal with. The AWS Sentinel-2 data is sourced directly from SciHub.
... View more
08-03-2016
07:12 PM
|
0
|
0
|
30641
|
|
POST
|
Dan Patterson sqlite (non-spatial) is in the standard library. Joshua Bixby SQLite and ArcGIS—Help | ArcGIS for Desktop
... View more
07-17-2016
01:52 PM
|
0
|
2
|
870
|
|
POST
|
Sorry Peter, that was my bad, I missed the fact you were slicing your row list to start from the 2nd element. I've updated my answer in your other post - https://community.esri.com/message/620711#comment-620711
... View more
07-13-2016
01:34 PM
|
0
|
1
|
2635
|
|
POST
|
Peter Wilson wrote: Would you mind helping me understand why my original for loop didn't work as the printed results within the console were correct? Because you were modifying the landuse variable, not the row elements. Basically this is what you were doing row = ['a','b']
for i, landuse in enumerate(row):
landuse = landuse + "x"
print landuse, row ax a
bx b
... View more
07-13-2016
05:40 AM
|
1
|
1
|
3173
|
|
POST
|
The built-in enumerate function is what you want: with arcpy.da.UpdateCursor(output_pivot, landuse_fields) as upcur: # @UndefinedVariable
for row in upcur:
keyvalue = row[0]
if keyvalue in valuedict:
print(keyvalue)
for i, landuse in enumerate(row[1:], 1):
row = (landuse*(30*30))/(valuedict[keyvalue][0])*100
upcur.updateRow(row)
print(row)
... View more
07-13-2016
04:47 AM
|
1
|
3
|
3173
|
|
POST
|
Two suggestions: use an arcpy.da.SearchCursor, they are much quicker than the old arcpy.SearchCursor use a set to get unique values with arcpy.da.SearchCursor("BldForm", ['Combo']) as rows:
OBJECTID = sorted(set([row[0] for row in rows]))
... View more
07-13-2016
03:04 AM
|
1
|
2
|
1608
|
| 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 |