|
POST
|
The inputs need to be "raster objects" to work in teh new map algebra. Try this: import arcpy, os
arcpy.CheckOutExtension('Spatial')
arcpy.AddMessage("Creating Elevation Raster")
arcpy.env.workspace = FD_addr
list = arcpy.ListRasters("*", "ALL")
raster0 = arcpy.Raster(list[0])
raster1 = arcpy.Raster(list[1])
elevation = arcpy.sa.Con(raster1 - raster0 >= 0, raster1 - rasters0, 0)
elevation.save(FD_addr)
... View more
06-27-2013
08:25 AM
|
0
|
0
|
2585
|
|
POST
|
Another idea... Instead of using the lines themselves, use the line's start/centroid/end points (multipoint style)... which will be much faster than using the entire line geometry (but less precise of course). Then you can get, say, the closest 100 results - and then use the actual line geometry (of the closest results) to make the final determination. You could do all sorts of other high pass filtering too... Like using hull rectangles.... or sampling every other line vertex.
... View more
06-26-2013
10:17 AM
|
0
|
0
|
2828
|
|
POST
|
reading in every single line envelope that falls within the bounding box of my points Perhaps you can whittle the number of lines down by doing some conditional distance pre-processing (exclude any lines that are x distance from a point)? Also, if you are scripting this stuff - remember to take advantage of the arcpy.env.extent property. Most tools honor it (SpatialJoin, GenerateNearTable, etc.).
... View more
06-26-2013
10:08 AM
|
0
|
0
|
2828
|
|
POST
|
Curious if the GenerateNearTable tool (http://resources.arcgis.com/en/help/main/10.1/index.html#//00080000001n000000) would have any better performance than your other methods. Frankly, these tools are about as good as they come, and ESRI has done their due diligence and tweaked them about as best they can be. What sort of hardware are you running this on? Local disks, right? If you use the 64 bit background geoprocessing (v10.1 only), you should be able to load these large FCs into the in_memory workspace and see a performace boost there (be sure to write the output table/fc there as well). Only other thing would be to write some fancy Python subprocess/multiprocessing script to break the job up into smaller peices and run them concurrently, which is typically what you have to really boost performance of large jobs like this.
... View more
06-26-2013
10:03 AM
|
0
|
0
|
2828
|
|
POST
|
"SelectLayerByLocation" inside a loop that is called about 50,000 times I have some similar code. I implemented a little trick where if the total selected set gets larger than a certain amount - say 1000 features, I select only the features (SelectByAttribute) that were selected from the last few iterations. The idea being that the SelectByLocation gets slower and slower the more features that are selected. Depending on how many features you have and the spatial arangment of them, it can make add big boost in performace.
... View more
06-26-2013
09:00 AM
|
0
|
0
|
1262
|
|
POST
|
They say the biggest compliment a programmer can have is for someone to steal your code... But that said, if I significantly borrow from someone elses code, I typically have a blurb in my header that indicates that. However, if your coworker took all the credit and made it appear that he/she did all the work without putting your name in there... well that would make anyone mad!
... View more
06-26-2013
08:34 AM
|
0
|
0
|
1571
|
|
POST
|
The word 'buffer' is not a keyword in Python. See: http://forums.arcgis.com/threads/4679-Buffer-error?p=21932&viewfull=1#post21932
... View more
06-25-2013
03:53 PM
|
0
|
0
|
1463
|
|
POST
|
Try running the buffer tool without the dissolve "ALL" option: buffer = arcpy.Buffer_analysis(roads, "in_memory/buffer", "1000 Feet") Does it work?
... View more
06-25-2013
02:37 PM
|
0
|
0
|
1463
|
|
POST
|
Not sure what's going on, but where do you have arcpy.env.workspace set to? (this is where the temp scratch rasters get written) in_memory?
... View more
06-18-2013
02:20 PM
|
0
|
0
|
2166
|
|
POST
|
Can you disable your virus scan software? If so, do it and see if the issue persists... http://forums.arcgis.com/threads/66584-repeated-AddField-operations-fails-in-10.1-works-in-10.0?p=240544&viewfull=1#post240544
... View more
06-18-2013
01:45 PM
|
0
|
0
|
2080
|
|
POST
|
is there a token for: AllFieldsExceptShape@? Maybe I didn't follow everything written above, but I have always used "*" to denote all the fields (except for SHAPE). So for example, if I want all the field AND SHAPE: >>> searchRow = arcpy.da.SearchCursor(myFC, ["SHAPE@","*"]).next()
>>> searchRow
(<Polygon object at 0x2b713f0[0x2b68e80]>, 1, (1216836.715736469, 112885.83942983788), None, 5723.961799418091, 395403.18030676956, 1)
but if I just want the non-geometry fields: >>> searchRow = arcpy.da.SearchCursor(myFC, ["*"]).next()
>>> searchRow
(1, (1216836.715736469, 112885.83942983788), None, 5723.961799418091, 395403.18030676956, 1)
Note that "*" will always return the centroid x,y coordinate pair... that's the (1216836.715736469, 112885.83942983788) part... but just not the entire geometry object.
... View more
06-17-2013
01:27 PM
|
0
|
0
|
3330
|
|
POST
|
PYTHONPATH is a path that Python checks on load to find modules Yep - you are correct...
set Path=C:\Apps\Python27\ArcGISx6410.1;%Path% ...gets an upvote.
... View more
06-17-2013
12:37 PM
|
0
|
0
|
4786
|
|
POST
|
I'm sure there is a "right" way to do this, but between the stuff in the registry and the environment variables (PATH and/or PYTHONPATH), it becomes difficult to figure out what works and what doesn't... And what works and what doesn't can depend on what software you currently have... or even what different versions you have had in the past. Of course different version of Python and/or ArcGIS have used different methods to establish this path stuff over the years, so if you have an "older" machine that has had different versions of Python and/or ArcGIS installed on it at one point, then you registry is probably chock full of all sorts of keys with reference to all sorts of different paths. A clean reinstall has always worked to get things straightened out for me... except recently: http://forums.arcgis.com/threads/78704-Python-subprocess-module-and-64-bit-background-geoprocessing-in-v10.1. Maybe just searching the registry for all the refs to your D:\Python27 install and change it to C:\Python27? Likewise, look for refs like this in the envr. variables too.
... View more
06-13-2013
05:32 PM
|
0
|
0
|
2140
|
|
POST
|
Maybe not the best/fastest answer, but in the long run, probably the easiest: 1. Uninstall everything ArcGIS and Python (including 64bitbackground, 32-bit python, 64-bit Python, any other versions of Python, etc). 2. Delete the old Python folders (under C:\ and D:\) and the ArcGIS folder under C:\Program Files\ArcGIS 3. Reinstall everything using the default folders on C:\. A somewhat related tale: A while back, our IT people cleverly (because they are ***experts***) decided to call the primary hard drives on our Citrix Servers the M:\ drive (instead of C:\). Needless to say, this turned out to be a very bad decision...
... View more
06-13-2013
09:35 AM
|
0
|
0
|
2140
|
|
POST
|
>>> unknownSr = arcpy.SpatialReference() >>> unknownSr.loadFromString('{B286C06B-0879-11D2-AACA-00C04FA33C20}') >>> unknownSr.name 'Unknown' Works great! Nothing says Unknown coordinate system like '{B286C06B-0879-11D2-AACA-00C04FA33C20}'...
... View more
06-13-2013
08:15 AM
|
1
|
0
|
2843
|
| Title | Kudos | Posted |
|---|---|---|
| 1 | 03-25-2014 12:57 PM | |
| 1 | 08-29-2024 08:23 AM | |
| 1 | 08-29-2024 08:21 AM | |
| 1 | 02-13-2012 09:06 AM | |
| 2 | 10-05-2010 07:50 PM |
| Online Status |
Offline
|
| Date Last Visited |
08-30-2024
12:25 AM
|