|
POST
|
When dealing with large raster datasets the system memory can sometimes be the issue - when your script runs do you hit the cap on your RAM? I have run into this issue in a few cases for example with high resolution height maps of large surface areas - you can avoid it by making use of scratch workspaces and writing intermediate rasters to disk, then explicitly calling del on the raster to free up the space held in memory. It does slow down the overall script performance to work from disk so you'll need to weigh the trade-off of speed vs. file size limitations.
... View more
12-02-2016
03:58 PM
|
0
|
2
|
2542
|
|
DOC
|
Hm that's odd it appears to be working on my end. Unfortunately I don't have anything to do with the site administration, I'm on the GP/Python side of things. Perhaps try again with a different browser or disable any script blocker add-ons you might have?
... View more
11-29-2016
10:13 AM
|
0
|
0
|
8462
|
|
DOC
|
Hello Wu, Thanks for sharing your tool with us! I just wanted to point you to our code sharing site as well: ArcGIS Code Sharing Many users will check that site for tools like this, so you might find more users by posting on that site as well. Cheers!
... View more
11-28-2016
10:02 AM
|
0
|
0
|
8462
|
|
POST
|
Hi Rebecca, Win32 is a bit of a frustrating install with multiple Python versions installed, glad you were able to get it. I'll admit this is an old code snippet and I haven't used it for anything complex so it may be of limited usefulness in your situation. Essentially all that snippet is doing is re-launching a python script with the UAC dialog, if it doesn't have admin rights on the first attempt. I misunderstood that it was only part of your script to run as admin and not the whole thing. There's no easy solution to launching an admin-level sub-process from a user-level program without prompting for UAC - even using a Microsoft language like C#. My best advice in that situation is to see if you can break the workflow up into multiple tools and then chain them together in a .bat file perhaps?
... View more
11-28-2016
09:17 AM
|
1
|
2
|
14832
|
|
POST
|
The win32 module has a shell.ShellExecute method which can accept the 'runas' verb. You can use a snippet like below to relaunch the current script as admin: import os
import sys
import win32com.shell.shell as shell
ASADMIN = 'asadmin'
if sys.argv[-1] != ASADMIN:
script = os.path.abspath(sys.argv[0])
params = ' '.join([script] + sys.argv[1:] + [ASADMIN])
shell.ShellExecuteEx(lpVerb='runas', lpFile=sys.executable, lpParameters=params)
sys.exit(0) edit: Just wanted to add that this will prompt for UAC at this point so unless you have set your system to automatically accept UAC requests, there will need to be someone present to click accept. Also, since you're launching the process in a second shell, you won't get the StdOut piped to your current shell - so if you need to see the output, write it to a file instead of relying on print statements.
... View more
11-23-2016
11:51 AM
|
1
|
4
|
14832
|
|
POST
|
This is unfortunately a namespace collision in ArcPy from the early days of its design. See import arcpy tramples datetime import for more info. As a workaround you can use: import datetime datetime.datetime.now() import arcpy datetime.datetime.now() Or alternatively: from datetime import datetime as dt dt.now() import arcpy dt.now()
... View more
11-23-2016
11:38 AM
|
0
|
2
|
9967
|
|
POST
|
I know a number of people still use PyScripter successfully so I would assume that you shouldn't have any issues using the 32-bit version. As far as compatibility with ArcPy, it seems PyScripter is falling behind in maintenance - for example it has not yet been updated for Python 3.5 support to my knowledge. So while it was once the IDE we recommended, that unfortunately looks like it will have to change. I have personally been using PyCharm for all my ArcPy coding needs for over 3 years now and am happy with it.
... View more
11-21-2016
09:23 AM
|
0
|
0
|
1673
|
|
POST
|
PyScripter runs a subprocess which pipes the results back to its interface. The EOFError is saying that subprocess crashed hard and didn't return a stack trace. This usually indicates python.exe itself is crashing. It's likely happening because you didn't update the version of background geoprocessing, the DLLs and PYDs that ArcGIS uses have traditionally been tightly coupled with a Python version, so necessitates an upgrade of both.
... View more
11-16-2016
04:54 PM
|
1
|
0
|
1673
|
|
POST
|
Excellent comments already so I don't have a lot to add - Esri offers training courses. Many schools have subscriptions to training if you are a student, so check to see if you can attend for free. https://www.esri.com/training/catalog/search/ and search for Python courses, there are several and since they focus on ArcGIS you'll learn more about how to use ArcPy which is something general training won't cover. There are also interactive tutorials on websites such as Learn Python - Free Interactive Python Tutorial or Python | Codecademy which can be more effective than a textbook for some learning styles. And again +1 to 'Learn by Doing' .. Even though it's named Python, it doesn't bite Just start typing.
... View more
11-15-2016
02:36 PM
|
2
|
0
|
3283
|
|
POST
|
Okay I can see them now, thanks. It still looks to me like the destination points are not along the network. In your first screenshot several of the 'blue squares' that symbolize destinations don't actually touch the network. In the properties for your destinations, under the Network Locations tab did you set the search tolerance and snap to: closest? Help Documentation
... View more
11-15-2016
12:39 PM
|
0
|
0
|
1298
|
|
POST
|
The links to the pictures are still broken unfortunately.
... View more
11-15-2016
11:22 AM
|
0
|
2
|
1298
|
|
POST
|
Hi Raymond, I'm personally unfamiliar with the finer details of the tool itself but can offer some suggestions. However your pictures aren't showing up - any chance you could upload them to an image host like TinyPic - I think right now the ones you've linked currently are password protected for me.
... View more
11-15-2016
08:43 AM
|
1
|
4
|
1298
|
|
POST
|
I'll mention this to Drew and see if we can get this script updated in the near future. edit: There is an updated version available at http://www.arcgis.com/home/item.html?id=f4769668fc3f486a992955ce55caca18 that should work with 10.x out of the box.
... View more
11-14-2016
03:29 PM
|
1
|
6
|
3852
|
|
POST
|
In the getParameterInfo() method, you'll define your parameters as arcpy.Parameter() objects. For the respective parameter of your ValueTable ensure that you are using the 'parameterType=GPValueTable' constructor argument. Once you have created the Parameter object with the correct type, you can use the ValueTable's methods such as setColumns(), setRow() and setValue() to alter the values therein. See this link for info on creating ValueTable Parameters and this link for the ValueTable documentation
... View more
11-14-2016
03:23 PM
|
0
|
0
|
535
|
|
POST
|
Good eye, yes I believe this snippet is old enough that it predates Python 3 so it should only work on a Python 2.x install in this form.
... View more
11-10-2016
01:22 PM
|
0
|
0
|
2829
|
| Title | Kudos | Posted |
|---|---|---|
| 1 | 11-23-2016 11:51 AM | |
| 1 | 12-27-2016 03:58 PM | |
| 1 | 11-28-2016 09:17 AM | |
| 1 | 12-08-2016 05:09 PM | |
| 1 | 12-28-2016 12:00 PM |
| Online Status |
Offline
|
| Date Last Visited |
11-11-2020
02:25 AM
|