|
POST
|
Thanks for the good idea. However, two items still unsure. 1. Please kindly explain what DD field mean. (Are they abbreviation of ?) 2. Please kindly explain why using the Join Field tool. (For instance, InputDataset=> the original projected shapefile; InputJoinField => ? ; JoinTable=>? OutputJoinField=>?) Sorry "DD" is my shorthand for decimal degrees Join Field can be used to do a "permanent join" that is copy fields from one feature class to another. In this case the Join table would be the projected version of your feature class (in decimal degrees) that you created to get those x y values. The Input and Output join fields are the fields used to match the input table records.
... View more
04-30-2012
12:19 PM
|
0
|
0
|
859
|
|
POST
|
I know about the flow direction tool, but I don't see it working in this case. The flow direction tool finds the least friction path downwards from a point, but not from one point to another. I would like to implement the terrain in the analysis a way, so that it is prefered to travel downhill over uphill, resulting in an overall lower cost. As the help for Cost Path describes, it's the elevation surface you use for cost: Cost Path can also be used to derive the path of least resistance down a digital elevation model (DEM). In this case, use the DEM for the Input cost distance raster and the output from the Flow Direction tool for the Input cost backlink raster. The Cost Path tool is the one you use for the "one point to another" analysis. (Flow Direction is used as a pre-processing step to provide the needed information to Cost Path.)
... View more
04-30-2012
08:20 AM
|
0
|
0
|
2971
|
|
POST
|
If I change it to string, it gives the same error, just with 'str' instead of unicode. Unless you're using international characters, string and unicode are really the same thing. What's the contents of the sql variable? The best way to get an exact story is to use repr: print repr(sql)
... View more
04-30-2012
07:36 AM
|
0
|
0
|
2549
|
|
POST
|
Dan is right but I think I'll add more detail for the record, since I have never seen all of this information in one place: ArcGIS 9.0, 9.1 - PythonWin/GpDispatch PythonWin's win32com module was used to access the geoprocessor through a "GpDispatch" COM object. PythonWin was a required install for ArcGIS.
import win32com
gp = win32com.client.Dispatch("esriGeoprocessing.GpDispatch.1")
gp.workspace = "C:/work"
gp.Clip_management(...)
ArcGIS 9.2, 9.3 - arcgisscripting A "native" Python geoprocessing module (arcgisscripting) was introduced. This was faster and more robust, and had the benefit of also being OS-independent, so ArcGIS Server applications on Unix could use Python. PythonWin became an optional install because it was not needed anymore. However, many folks still install PythonWin because of its nice IDE, which is much better than the the default (platform-independent) IDLE. PythonWin also offers many nice Windows-specific interfaces that Windows-centric developers can use. import arcgisscripting
gp = arcgisscripting.create(9.3) # specify version for forward compatibility
gp.workspace = "C:/work"
gp.Clip_management(...) The 9.2, 9.3 and 10.0 versions of arcgisscripting are slightly different. The differences I have run into are a) how cursors work, and b) the format of results from geoprocessor "list" methods (like gp.ListFeatureClasses). ArcGIS 10.0 - ArcPy The ArcPy site package was introduced at 10.0. Most of it is built on top of the arcgisscripting module; it offers lots of advantages for the script developer over the 9.x "gp" way of doing things, largely because it is more Pythonesque, especially in the way toolboxes and tools are accessed. The way ArcPy is set up allows IDE's to use intellisense (options pop up while typing code in an IDE). ArcPy also supports improved access to Spatial Analyst tools through "Python Map Algebra." import arcpy
arcpy.env.workspace = "C:/work"
arcpy.management.Clip(...)
# Python map algebra
from arcpy.sa import *
maskRaster = Con(Raster("grid1") > 0, 1)
You asked for some reference material. I believe these two articles cover it: ArcGIS 9.3 help: Creating the geoprocessor object http://webhelp.esri.com/arcgisdesktop/9.3/index.cfm?TopicName=Creating_the_geoprocessor_object ArcGIS 10 Help: What is ArcPy? http://help.arcgis.com/en/arcgisdesktop/10.0/help/index.html#//000v000000v7000000 If you're using ArcGIS 10 and don't have a need to write scripts that support earlier versions, arcpy is definitely the way to do it.
... View more
04-29-2012
03:59 PM
|
0
|
0
|
1695
|
|
POST
|
Please kindly advise if any method available in python to adjust the unit to decimal degree of longitude and latitude. The easiest approach I think is to project the dataset into geographic coordinates (say GCS WGS84 or NAD83) before running the script. If you want to add those DD fields to the original projected (meters) shapefile, copy the fields over using the Join Field tool.
... View more
04-29-2012
03:50 PM
|
0
|
0
|
859
|
|
POST
|
Letting the z_limit default is probably what you want to do, unless you are working in unusual terrain or are trying to do something specialized like identifying non-contributing areas (say, playas) based on topography. The z-limit is used to allow removal of shallow sinks and preservation ones that are deeper than the z-limit. What an appropriate value is would depend on what exactly you are trying to accomplish with the fill operation.
... View more
04-29-2012
03:44 PM
|
0
|
2
|
3188
|
|
POST
|
A more straightforward fix to python path issues (although somewhat drastic) is to entirely uninstall arcgis and python, make sure they are both all gone (including using Esri's uninstall uitlity AND the Control Panel add/remove programs wizard), then reinstall ArcGIS "clean" (this will set up Python too). Often multiple versions of python and leftovers from incomplete uinstalls can totally mess up anything that uses Python. This can easily happen if you have other versions installed before you installed this version of ArcGIS.
... View more
04-27-2012
12:49 PM
|
0
|
0
|
4344
|
|
POST
|
The best way to do this is to right click the layer and save to a .lyr file, and ship the .lyr file with the shapefile. This will include all layer properties (including labels, definition queries, etc) as well as your symbology. You can load the layer file up in another map document and all those layer properties will be "remembered". Of course the new way is to create a layer or map package, which includes the layer properties and the data in an esri-specific format that can be posted on ArcGIS online. I hope I am describing this correctly. I want to set permanent colors for my attributes that will transfer with the map. Presently when I set colors in the Symbology tab of the Properties, those colors do not transfer when the file is copied. It resets to a default for the original file (one color) when I want each value to have a permanent color. I have downloaded maps with this feature, but don't know how to set it up. Thanks, Kate
... View more
04-27-2012
12:33 PM
|
0
|
0
|
1758
|
|
POST
|
Ok, so basically Im trying to loop through all of my folders, mdbs, feature datasets, and feature classes in order use the SearchCursor to read values in the feature classes attribute table. There's a nice example in the online help here (bottom of the article) that shows the indentation and setting the workspaces correctly. If you started with this example it may be worth another look. Arc 10.0 help: Listing data One thing I see you're doing is listing things more than once, the list functions return a list which you can then iterate over, your code seems to try to generate another list instead of using the one you just created.... here's a suggested approach:
for w in ws:
arcpy.env.workspace = w
gs = arcpy.ListWorkspaces("*", "Access")
for g in gs:
arcpy.env.workspace = g
fds = arcpy.ListDatasets("*", "Feature")
for fd in fds ...
... View more
04-27-2012
07:53 AM
|
0
|
0
|
1382
|
|
POST
|
I am working on making a cost path analysis, and was wondering if there are any simple ways, or advanced ones, to change the value used for the terrain when going uphill or downhill. The Cost Path tool recognizes flow direction rasters. This is from the tool help: Cost Path can also be used to derive the path of least resistance down a digital elevation model (DEM). In this case, use the DEM for the Input cost distance raster and the output from the Flow Direction tool for the Input cost backlink raster. Valid flow direction raster values are 1, 2, 4, 8, 16, 32, 64, and 128; valid values in the back link raster are 1, 2, 3, 4, 5, 6, 7, and 8. Both of these rasters are acceptable.
... View more
04-27-2012
07:34 AM
|
0
|
0
|
2971
|
|
POST
|
You're not missing anything, that's what you get in Linux. The Python entry point to the system is a tweaked Python interpreter using libwine, not the system's /usr/bin/python. Jason - I realize we need arcpy in win32 so arcpy and ArcMap can communicate. However, can some memory-intensive geoprocessing tools (say, Region Group or Raster To Polygon) take advantage of the 64 bit memory space once launched by arcpy?
... View more
04-24-2012
11:44 AM
|
0
|
0
|
1969
|
|
POST
|
I have a large feature class with million records. It has a 'CODE' field, this 'CODE' field has many duplicated value. I need to keep only one value from it, and delete all other duplicated values. There are two nifty tools in 10.x that with the Sort tool can solve the problem: Find" rel="nofollow" target="_blank">http://help.arcgis.com/en/arcgisdesktop/10.0/help/0017/001700000054000000.htm]Find Identical Delete" rel="nofollow" target="_blank">http://help.arcgis.com/en/arcgisdesktop/10.0/help/0017/001700000053000000.htm]Delete Identical
... View more
04-24-2012
11:40 AM
|
0
|
0
|
1142
|
|
POST
|
Hello all! The company I am currently working for has decided to migrate from ArcGIS 9.3 to 10.0 recently and we are having difficulty using a few of our Arc 9.3 models that utilize the Calculate Field tool. They were written in VBA and I need to get them to work using VBScript. The following bit of code is intended to calculate the x coordinate of the centre of a harvesting block and put it in a field. Field Name: xcoord Expression: dblX Expression Type: VB Code Block:
Dim dblX as Double
Dim pArea as IArea
Set pArea = [Shape]
dblX = pArea.Centroid.X
From the online help: Use Python if you want access to geoprocessing functionality, including feature geometry....If you have VBA code from past releases that use ArcObjects, you will need to modify your calculations to work in 10.0. It sounds painful, but rewriting it in Python won't be as hard as you may think. The arcpy methods handling feature geometry are less complex to work with than ArcObjects. Arc 10 Help: Calculate Field examples Working" rel="nofollow" target="_blank">http://help.arcgis.com/en/arcgisdesktop/10.0/help/index.html#//002z0000001s000000]Working with geometry in Python Also, there are tools available that could be combined to set up an easier-to-maintain workflow than your VBA scripts; a ModelBuilder model may even accomplish what you need using tools like: Feature To Point Add XY Convert Coordinate Notation
... View more
04-24-2012
11:03 AM
|
0
|
0
|
1118
|
|
POST
|
Reposting in this forum... any ideas? Over in the [thread=27311]original thread,[/thread] I have suggested integerizing the data first. But a 999999 error doesn't sound like a good result no matter what you throw at a tool. Is Raster To Polygon a little less robust in 10.0 than the previous release? Hello, The Raster to Polygon conversion tool is supposed to work according to: http://webhelp.esri.com/arcgisdesktop/9.2/tutorials/Spatial_23.htm In my installation of Arc GIS 10, it only works if the raster is thematic but it works for all raster types, multilayer, continuous values, noninteger values etc on my colleagues ArcGIS 9.3.1. installation. We have wasted 2 days trying to solve this problem. All it spits out are error codes which are deadenders. Has anyone else come across this problem? Any ideas for a solution? Is it a systemic problem in ArcGIS 10 or only in my particular installation? Would appreciate hearing from anyone else who has experienced this problem and/or found a solution. Thank you for any advice.
... View more
04-24-2012
10:35 AM
|
0
|
3
|
2254
|
| Title | Kudos | Posted |
|---|---|---|
| 1 | 08-11-2021 01:26 PM | |
| 5 | 12-10-2021 04:58 PM | |
| 1 | 02-27-2017 09:30 AM | |
| 2 | 12-04-2023 01:05 PM | |
| 1 | 04-12-2016 10:17 AM |
| Online Status |
Offline
|
| Date Last Visited |
06-19-2024
12:10 AM
|