Hot answers tagged arcgis-10.0
4
Both Michael Markieta and gm70560 are correct. If you are running running large geoprocessing tasks, I would definitely do it via a stand-alone python script, preferably launched from the command line and not an IDE. For this sort of task, the overhead of importing ArcPy is well worth it.
However, a small task, especially one which requires user input, is ...
4
When running something like this in a Toolbox Tool, you indeed want to use Tool Validation. For example:
class ToolValidator:
"""Class for validating a tool's parameter values and controlling
the behavior of the tool's dialog."""
def __init__(self):
"""Setup arcpy and the list of tool parameters."""
import arcpy
self.params = ...
3
What to do when raster cell size is larger than zonal vector feature in order to collect statistics?
This is explained in the Zonal Statistics help:
If the zone input is a feature dataset with relatively small features, keep in mind that the resolution of the information needs to be appropriate relative to the resolution of the value raster. If the areas of single features are similar to or smaller than the area of single cells in the value raster, in ...
3
One of the strange Limitations of ArcMap, is that it only looks at the name of the projection, and doesn't actually check the parameters, if the name is different.
I've often faced this problem when data comes from other software. That software might use the correct parameters for say UTM 43N, but the name is not what ArcGIS expects. And all ArcMap can do, ...
3
"DLL load failed: The specified module could not be found."
it simply means that GDAL is improperly installed (line 17: missing dll file or rather, that the dll file is not installed at the requested location)
Look also at Importing GDAL from ArcGIS python window - is it possible? and Running GDAL and arcpy together (ArcGIS 10.1, GDAL 1.9.2, python 2.7.4)
3
I suspect much of what you are seeing as inconsistent software behaviour will become clearer after reviewing the online help for Raster dataset attribute tables. The help for Build Raster Attribute Table is probably also worth reviewing.
If the solution does not become evident, then I would recommend listing the precise steps you performed on a raster ...
3
You can encode multiple values in raster data using bit flags. This is how MODIS data stores quality and cloud masks. Bitwise operators can be used to extract these values.
2
If you have not done so yet read up on route hatching. Then you should be able to author a layer file with appropriate route hatching that you can use to add/update a layer using ArcPy.
2
My first thoughts were also about lyr.getExtent() but what if you do it this way? Get the source of the layer and describe it.
lyrdesc = arcpy.Describe(lyr)
source = lyrdesc.catalogPath
shpdesc = arcpy.Describe(source)
df.extent = shpdesc.extent
If neither of these work there may be an issue with the extent of the new shp you are adding.
Edit: Actually ...
2
The online help for Raster To Polygon says:
The Field parameter allows you to choose which attribute field of the
input raster dataset will become an attribute in the output feature
class. If a field is not specified, the cell values of the input
raster (the VALUE field) will become a column with the heading
Gridcode in the attribute table of the ...
1
If you edit the attribute field and put the cursor in the field, with it between access and Campground.
Hit ctrl + enter.
That is hold the control button and hit the enter button at the same time.
That will place a line break in your data.
If you have the mapplex extension it will work with 10.0
Another option with 10.1 is use mapplex to stack labels. ...
1
I have to mention this custom tool. It's called ChangeDetector, and works pretty well in my experience for finding changes between file versions.
It'll output three (or less) shapefiles with new, deleted and unchanged features. It is also possible to define which fields to compare (eg. Shape and/or attribute fields of your choice).
1
I'm going to suggest two things you may be looking for:
Feature Compare will "report differences with geometry, tabular values, spatial reference, and field definition"
Union "Computes a geometric union of the input features. All features and their attributes will be written to the output feature class." - this will enable you to compare the value of any ...
1
You can create pie, bar or stacked charts in ArcMap
for the html pop - you might have to write some code:
The end result is:
Right-click the layer you want to draw showing quantitative values
using pie charts and click Properties. Click the Symbology tab on the
Layer Properties dialog box. Click Charts and click Pie.
End Result is:
...
1
These are the steps that I would use:
Create Fishnet to create a 2 x 2 grid
Define Projection on your fishnet as a Geographic Coordinate System (in lat/long)
Project your GCS fishnet into Transverse Mercator
You should now see the expected broadening of cells at the equator.
1
If you had a shapefile contained in a folder (note a *.gdb), then Split Layer By Attributes would do the job. In any event, the code contained the scripts associated with the toolbox should provide sufficient background as to how accomplish this task.
1
I will assume you have many records per state that need to be geocoded, in which case you do not want to do this one record at a time, but in batches.
you can tweak your code a little to do this.
import arcpy
states = []
fc ="C:\GISProjects\ALLMembers\LEE_AllMembers.gdb\LeeMembers_Sort"
field = "State"
myList=set([row.getValue(field) for row in ...
1
The first thing you should do is put Try..Catch blocks in your code. This will make it much easier to figure out why the code is crashing. Here is an example
Private Sub FindSmallestPolygon()
'This requires the feature class to be in a geodatabase
'or has the field "Shape_Area" already calculated with the area
Dim pLayer As ...
Only top voted, non community-wiki answers of a minimum length are eligible



