|
POST
|
Thanks Curtis, I was really afraid someone would respond with, "The tool works, you're doing it wrong. Really? Hm. I think you're overestimating what this interpolator can do with contours, which as I said is the worst possible input to generate an unbiased estimate of a surface that also looks "how you want it." Converting your contours to points and using another interpolator like IDW may honor the contours better, but the surface may other properties you will not like. Topo To Raster just may not the right interpolator for the task at hand. It's specifically tuned to make elevation surfaces from topographic contours. I recommend Hutchinson's paper on ANUDEM (referenced in the help) you'll get an idea how much more difficult this is to automate. It's a pretty amazing method Hutchinson came up with, but it is quite directed toward solving a specific interpolation problem -- generating topographic surfaces from contours suitable for hydrologic analysis (flow directions, etc). If you have an idea on how a tool can be improved (or ideas for new tools) I suggest you post to http://ideas.esri.com, where other users can vote it up. Sharing your annoyance here in the forum (though I agree can be good sport, especially in the service of solving your problem!) is unlikely to have as much effect on the future capabilities of the software as the (new, and useful) ideas site.
... View more
03-15-2012
12:44 PM
|
0
|
0
|
2089
|
|
POST
|
Is there an option to prevent Arc from apparently assuming the contour dataset is incomplete and it can feel free to add new ones? If a pixel falls between 100 and 200 contour lines it should be really easy to not allow it to have a value of -77! Chris, Contours are one of the most difficult data sources from which to build an accurate raster for a simple reason - they are very biased, all samples are on the contour lines. Flat areas have no information on a contour map, so an interpolator's shortcomings become quite obvious there. TopoToRaster (details in the docs of course) is a modified spline interpolator, which means it captures curvature of the surface and can generate you values (like your -77) that are not part of in your input data values as it fits your surface to curves. I think the best solution for you is to add point or contour values manually to areas where the spline isn't capturing the surface because of the lack of good data your contours are providing. Topo to Raster is pretty good at guessing based on contours, but humans are much better at it. If you give it a little more information I think you'll get better surface from the interpolator.
... View more
03-14-2012
09:01 PM
|
0
|
0
|
2089
|
|
POST
|
Is there a way to get Extract by Mask to extract the area OUTSIDE? I want to use Extract by Polygon with extraction area = OUTSIDE, but my polygon is in a feature class (too many vertices to input manually) so I have to use Extract by Mask. Is there a way to quickly import the XY coordinates from the feature class, rather than 1 by 1? Or can someone suggest another way to remove the area inside the polygon from my DEM? Thanks! Creating a raster mask may be what you want to do. I think this approach may be more likely to give you a good "snap" (cell alignment) than the image toolbar approach. Set the extent, snap, cellsize environment to your DEM raster Convert your polygon to a raster, "pgrid". This gives you NoData for areas you want and a value inside the area you want to remove. It's a good idea to stop at this point and make sure you have what you want (or I should say, the opposite -- the NoData areas in this grid are those you will keep). Use the Reclassify tool (or in 9.3, Reclassify in the SA toolbar) to convert the NoData to a 1 and your data cells to NoData. Use this as your mask for Extract By Mask. Another approach is to do steps 3 and 4 using Map Algebra instead: Con(IsNull("pgrid"),"demgrid")
... View more
03-14-2012
08:44 PM
|
0
|
0
|
5355
|
|
POST
|
I'm coming across the issue were the round function performs round to even which means 56.5 becomes 56 and 55.5 becomes 56. Helpful to know that the VBScript Round function does "banker's rounding" with .5 values -- up or down with the root number odds and evens so totals won't be biased up up or down. Back in the day, I remember hearing this referred to by our streamgaging techs as "USGS Rounding". You can see how measurements could be biased over the long run if you always rounded up when you hit the middle value. I googled around and it turns out Python 2.x round() does not do banker's rounding, but Python 3.x round() does. (Note, Python 3.x probably won't be used by ArcGIS for a good long time, as it is a big change.) If you really want to avoid it, an approach that should work with positive numbers (pretty consistently, independent of scripting language) would be to add half and integerize: Int([field] + 0.5)
... View more
03-14-2012
08:15 PM
|
1
|
0
|
3728
|
|
POST
|
"[Tma_ºC_] + %Temperature Change%" for the expression field, so I assume that means the Calculate Field box will take the value that is input in to the Temperature Change box and add it to the original Temperature field, denoted as "[Tma_ºC_]". It looks okay in that it looks like a legal VBScript calculate expression (hard to see without the actual tool dialog), but I would avoid putting special characters in your field names. That alone can cause a syntax error parsing a calculate expression. Its best if you can to stick with field names that will work in shapefiles if you can (10 characters, case not significant, start with a letter, "_" being the only special character allowed). I would try it with a less adventurous field name like "Tma_C" and see if that solves your problem.
... View more
03-14-2012
08:06 PM
|
0
|
0
|
3710
|
|
POST
|
Perhaps I didn't understand the requirement correctly and you only need Spatial or 3D Analyst if you have an ArcView or ArcEditor license. It's safe for me to assume they have an ArcInfo license. Calculate Value worked. An added requirement for anyone trying this in the future, remember to set the output table of Summary Statistics as a precondition for the Calculate Value tool. Great! It sure would be great if Calculate Value didn't require advanced licensing - it's awfully hard to make a desktop tool using ModelBuilder without it. Models will show a different icon and won't run if the any of the license/installs needed for its components are not available. I have found when building tools of any significant complexity that the effort of creating a python script is worth it - as then you can do things like more sophisticated tool parameter validation code and messages. (A nice improvement of 10.0 is that you can import scripts into the toolbox so you don't need to package a folder of scripts with the toolbox.)
... View more
03-14-2012
07:58 PM
|
0
|
1
|
2017
|
|
POST
|
I modified your question: How do I know what the output statistic field name is for the output of summary statistics? as the join field name should not change with different statistics, it would be the same as the case field. The Calculate Value tool is the way to calculate the output statistic name, you enter a python expression to calculate the field name, and set the output data type to Field. An example expression would be: "%Statistic%_%Input field%" where Statistic and Input field are elements in the model.
... View more
03-09-2012
12:28 PM
|
0
|
0
|
2017
|
|
POST
|
As I said in the original Post, I need to add the full path to the python script and log files in the bat file on a Windows 2008 Server which I did not need to do in Windows 2003 Server. So Win 2008 Server isn't allowing you to set a "Start in:" folder? Another approach to run python scripts no matter where they are is add a folder containing your python scripts to the Windows PATH variable. You can do this just inside your .bat script. Your .bat script can also use pushd to change the current folder after the script starts. Or is there another method of calling the python files that can be used? I was suggesting using Python (os.system(), subprocess, etc)... I'm still a bit confused as to what the problem is.
... View more
03-07-2012
06:23 AM
|
0
|
0
|
2293
|
|
POST
|
It now gives the error 'failed to open raster dataset'. I'm not sure why it won't open it. To see if it's a path issue, make sure it exists. (If you don't specify a full path, it will look in env.workspace for it.) if not arcpy.exists(catchmentRasterProj):
raise Exception, "%s does not exist" % catchmentRasterProj In the same manner, the output is also written to the current workspace, so instead of outFill.save(folderAdd + catchment100Fill) you can just specify outFill.save(catchment100Fill) as well as an error it creates a new folder within the workspace called 'aggrega_catc1' but I thought that setting the scratch workspace to the env workspace would stop this? This is a temporary raster; all tools write a temporary raster to the scratch workspace when raster tools run. As I said the point of setting the workspaces the same is so when the tool successfully runs this temp raster is renamed (instead of copied) to your output raster when you execute outraster.save.
... View more
03-07-2012
06:06 AM
|
0
|
0
|
1307
|
|
POST
|
I have many points in my feature class, and multiple feature classes for different individuals, so I think if doing multiple cost paths is the only way to generate a path through all the points, I would definitely need a model or python script to make this method feasible. Unfortunately, I have no experience with python script writing.... Any further tips? I suggest working out this analysis for the first two features by running tools interactively. Once you've done that, you'll have the problem a little better defined and know which tools will work, how the environments need to be set for the tool to run correctly, etc.. Then, you can also build a simple model to accomplish your task, ie "given an input point layer, a source, and destination feature ID, calculate the by-cell cost path raster." This model could then be run from another (looping) model or python script. Breaking up the analysis into pieces like this makes the task a lot easier.
... View more
03-06-2012
11:37 AM
|
0
|
0
|
878
|
|
POST
|
My goal is to start using open source python spatial analysis packages There's some really good stuff in R. And of course you can run" rel="nofollow" target="_blank">http://rpy.sourceforge.net/]run R from Python. CRAN Task View: Analysis of Spatial Data
... View more
03-06-2012
11:11 AM
|
0
|
0
|
2155
|
|
POST
|
If you definitely want a sequential path, doing multiple least cost path analyses and combining them at the end using Mosaic (or Cell Statistics with MAX, ignoring NODATA) would do the trick. It may require a python script to iteratively select each set of points and run the analysis.
... View more
03-06-2012
11:00 AM
|
0
|
0
|
878
|
|
POST
|
I'm trying to do this as a stand alone script and not in the python window. Should not matter. My guess is your raster is getting saved somewhere (scratch workspace) besides where you think it is. Your script seems to imply that your processing results are expected in "H:/PhD/PythonLessons/Scripts/testIt" but you haven't set the scratch workspace to that location. For best results when using Spatial Analyst tools its best when they are sent to the same folder: from arcpy.env import ENV
ENV.workspace = r"E:\work"
ENV.scratchWorkspace = ENV.workspace
Setting the current and scratch to the same folder allows temporary grids to be renamed instead of copied - this can save a lot of time with big rasters.
... View more
03-06-2012
07:49 AM
|
0
|
0
|
2456
|
|
POST
|
have you tried appending _sa to all of the spatial analyst tools as you have done with the _management etc tools? Dan, this changed at 10.x. The Spatial Analyst licensed functions need to be access the new python-esque way: arcpy.sa.Con(...)
from arcpy.sa import *
out = Con(..) If you have a 3D license, you can access the raster tools included in 3D using the _3d suffix.
... View more
03-06-2012
07:38 AM
|
0
|
0
|
2456
|
|
POST
|
max(2, 3, 4, 1, 2, 3, 4, 5, 1, 2, 3, 0, 10, 20) and get the maximu value. I tried, somehow it did not work. Yes, it should work. there are two valid syntaxes: >>> max(3,2,1,5)
5
>>> max([3,2,1,5])
5 I found a max function in ArcGIS help as max([!field1!, !field2!, !field3!]) what does ! mean? This is the python max function (second syntax), used inside the Calculate Field tool (which uses a "!" delimeter to substitute field names in to Python expressions).
... View more
03-06-2012
07:30 AM
|
0
|
0
|
802
|
| 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
|