4,511 reputation
623
bio website
location St Louis, MO
age
visits member for 2 years, 10 months
seen 11 hours ago

Apr
14
comment Python - Find the largest extent in a list of extents (tuple format)
I think it should be, but I noticed in ogr docs that Destroy is normally explicitly called.
Apr
14
comment Python - Find the largest extent in a list of extents (tuple format)
Both should be pretty fast. Shapely might be faster because of the box case. You would need a large number of operations to notice a difference. (And if you are doing large numbers of operations, the reprojection problem is bigger) It does introduce an additional dependency though. Once again, you just substitute for the getArea function with a shapely based one, and then use that function as your key on max()
Apr
14
comment Python - Find the largest extent in a list of extents (tuple format)
Very true. Especially a problem for very large extents like those in the example extents. Although... I am not certain that is an issue when comparing extents if you only need relative size, not exact value. It probably is an issue, just not certain it would be an issue.
Apr
14
answered Python - Find the largest extent in a list of extents (tuple format)
Apr
3
awarded  arcpy
Mar
24
comment How to output visually correlated clusters using Morans I Spatial Autocorrelation?
In addition to Getis-Ord Gi*, Anselin Local Moran's I, Ripley's K, Getis-Ord General G, and Spatial Scan statistics (like used in SatScan) are potential statistics that could be appropriate models for the dataset you are using.
Mar
24
comment How to output visually correlated clusters using Morans I Spatial Autocorrelation?
Moran's I is only a measure of spatial auto-correlation across an entire dataset (global spatial auto-correlation). It tells you the scales at which spatial auto-correlation is strongest. It tells you nothing about clustering. Instead, you can use Moran's I to determine the appropriate scale (and hence search distance) to use for a clustering spatial statistic, most likely Getis-Ord Gi*. I'm not writing this as an answer, because I would have to look at your data set in more detail to figure out exactly how you would use a spatial statistic to find clustering in your dataset.
Mar
21
comment How to avoid ImportError: No module named arcpy causing Failed to execute (Script) error?
Okay, that is the right path for arcpy from sys.modules. what path are you getting for idlelib though? That will tell us more about the python instance being used.
Mar
20
comment How to avoid ImportError: No module named arcpy causing Failed to execute (Script) error?
Ah, I think I see your problem now. You have ArcGIS 10.2.2 installed. You are trying to import a 10.1 toolbox for ArcHydro which references 10.1 python libraries, which are no longer installed on your system. Go get the latest version of ArcHydro (10.2.0.38 from 2/13/2014) and install that. Use that toolbox instead of the 10.1 toolbox. See if that improves things.
Mar
19
comment How to avoid ImportError: No module named arcpy causing Failed to execute (Script) error?
An ImportError has nothing to do with your workspaces. It means that the module you are importing (and the only one you import is arcpy) is not present. The result of sys.modules['idlelib'] would tell us where IDLE is executing, giving an idea why arcpy is not present.
Mar
18
comment How to avoid ImportError: No module named arcpy causing Failed to execute (Script) error?
Execute the code in IDLE first. After it fails, import sys in the interactive window, then type and provide back here the result: sys.modules['idlelib']
Mar
18
comment How to avoid ImportError: No module named arcpy causing Failed to execute (Script) error?
Yeah, so what is happening there is I am making a tuple, assigned to argv, out of the supplied arguments. The tuple is unzipped (the asterisk) into arguments that are supplied to the function main(). main() expects two arguments, which will then be assigned to the variables root and dem inside the function main().
Mar
17
comment ArcGIS 10.2.1 is not recognising my CSV file headings
Can you provide the header row from your CSV? Several things could be wrong, and this would make it easier to track down. And what are you using to edit? Excel or a text editor like notepad++ or sublime?
Mar
17
answered How to avoid ImportError: No module named arcpy causing Failed to execute (Script) error?
Mar
17
comment How to avoid ImportError: No module named arcpy causing Failed to execute (Script) error?
Your best practice is going to be to get the entire script to work in IDLE first, then as a standalone script, then make that into a script tool. You don't want to be debugging errors like this in a script tool.
Mar
4
comment Arcpy scripts fail on big datasets - anyone has experienced similar behavior?
What type of failure? e.g. is there an MemoryError? I have 32-bit arcpy fail all the time when doing numpy operations on float rasters due to the memory limitations.
Mar
2
comment Finding routes in which more than one car passed (gps data)
What is the time interval of your GPS returns? This makes a big difference on how you create routes. From my experience, anything more than 10 seconds and you are probably going to need to network dataset.
Feb
28
comment how can I add all feature classes of the same name to an mxd in python
You should wrap your layer creation and adding the layer to the mxd with a try...except block, just in case you encounter a corrupt dataset.
Feb
20
comment arcpy.SearchCursor strangely throwing IO Error
Which version of ArcGIS are you using? Have there been any modifications to Report.xls? Was any table from Report.xls loaded into the map document or previously loaded into that map document?
Feb
4
reviewed Edit suggested edit on How do I group multiple polygons into the same record?