|
POST
|
Use the Summary Statistics tool. Assuming that "Field2" is your field, add Field2 as your statistics field and get the COUNT statistic. For the Case Field, input Field2 as well. You'll get an output table that has each unique value of Field2 as well as the number of times that value appears. I should add that you should write the output of Summary Statistics to in_memory. See Using in_memory workspace. You can write to in_memory in Python.
... View more
08-30-2010
03:02 PM
|
0
|
0
|
1015
|
|
POST
|
I showed a technique for doing this at this year's user conference. It's on the model and script tool gallery - Fundamentals of GIS - Overlay . Download and unzip. In the folder "PointLinePolygon" is the plp toolbox and w/in that, there's a model called something like "Split Polygons". Open plp.mxd and run the model. It uses Feature To Polygon (ArcInfo only) followed by Identity (also ArcInfo only) to bring the attributes across. I'll have to think about how to do this w/o an ArcInfo license. There's a 9.3 version of the submission as well. The model is in the "Splits" directory.
... View more
08-25-2010
02:11 PM
|
0
|
0
|
658
|
|
POST
|
You can use variable substitution in ModelBuilder. To see an example using Calculate Value, go to "Example 4" in the following doc: http://help.arcgis.com/en/arcgisdesktop/10.0/help/index.html#/Examples_of_inline_model_variable_substitution/002w0000005w000000/
... View more
08-20-2010
03:15 PM
|
0
|
0
|
907
|
|
POST
|
This functionality was removed in 10.0 (due to the new Item Description framework)
... View more
07-26-2010
11:16 AM
|
0
|
0
|
2025
|
|
POST
|
Yep... just to clarify, gp.AddError() will "throw an exception" -- the script exits and the calling program receives the exception. In this case, the calling program is ArcMap (or whatever) and it traps the exception, giving you "Failed to execute" method. For more info on error handling, see this blog post about error handling.
... View more
07-21-2010
06:33 PM
|
0
|
0
|
553
|
|
POST
|
From my experience, GetParameterAsText() and GetParameter() are preferable to sys.argv[]. sys.argv[] has a character limit (I think it's 1024) while GetParameterAsText() doesn't have a limit. I know that 1024 is a lot, but I have exceeded it on occasion for data buried in a deep folder hierarchy. If you need the raw number (integer, double), use GetParameter(). (Prior to 9.0, I think, GetParameterAsText() wouldn't work when called from the OS prompt, so you had to use sys.argv[] unless you always ran as a script tool. This limitation was fixed at 9.0)
... View more
07-04-2010
01:16 PM
|
0
|
0
|
921
|
|
POST
|
You can also use the Feature to Point tool. This will create a point feature class of the line centroids. If you need access to the centroid coordinates, you can use the Add XY Coordinates tool and then use Join Field to join the centroid coordinates back to the original line features. When using the Feature To Point tool, be sure to check the "Inside" option!
... View more
07-04-2010
06:15 AM
|
0
|
0
|
1276
|
|
POST
|
Use the Select Data tool as described in the help topic Using the Select Data tool There's an example model at the bottom of the page that shows using it with Make Route Layer -- your model will be very similar.
... View more
06-08-2010
10:12 AM
|
1
|
0
|
567
|
|
POST
|
I'm being dumb. The real question is can I call a model from a python script, passing the model my desired output names and folders? That way I can tweak the model in modelbuilder, but won't have to tweak the python code every time I change the model. Absolutely! Geoprocessing is designed so that you can call models from models, models from scripts, and scripts from models. You just need an understanding of model parameters and how to add your custom toolbox in Python. See: A quick tour of creating tools with ModelBuilder Adding toolboxes in Python
... View more
06-01-2010
08:11 PM
|
0
|
0
|
495
|
|
POST
|
See the Desktop help topic A quick tour of using Feature set and Record set. It's the first topic in a small book about using these two data types.
... View more
06-01-2010
08:04 PM
|
0
|
0
|
709
|
|
POST
|
Seems that you're mixing Python syntax with VB syntax in the CalculateField expression. VB uses the square bracket notation for field names, as in [my_field] and in Python the notation is exclamation point, as in !my_field! I noticed that you're using Python in your modelbuilder version but VB in your script. Try using Python and the exclamation point throughout and see what happens.
... View more
05-31-2010
11:51 AM
|
0
|
0
|
890
|
|
POST
|
The ToolValidator code is saved in the toolbox with the tool. There shouldn't be any issues -- your ToolValidator code is carried with the tool.
... View more
05-25-2010
09:44 AM
|
0
|
0
|
264
|
|
POST
|
Have you tried the Summary Statistics tool? The field ORIG_FID_R would be your Case field.
... View more
05-23-2010
10:34 AM
|
0
|
0
|
275
|
|
POST
|
Use the Make Feature Layer tool to create a temporary layer. In the Make Feature Layer tool, the Field Info parameter has a column, Use Ratio Policy. For each attribute you want to be apportioned throughout the overlay, check the Use Ratio Policy box. Use the output of Make Feature Layer as the input to the clip tool. This technique is explained in the presentation "Fundamentals of GIS Analysis - Overlay and Proximity" found here: http://resources.esri.com/geoprocessing/index.cfm?fa=codeGalleryDetails&scriptID=16478
... View more
05-23-2010
10:32 AM
|
0
|
0
|
419
|
|
POST
|
It looks like you have the solution you're looking for. I'd just like to add that whenever I need to get address input for a model/script, I typically use a record set. See the documentation topic http://help.arcgis.com/en/arcgisdesktop/10.0/help/index.html#/A_quick_tour_of_using_Feature_Set_and_Record_Set/002w00000023000000/ -- about halfway down, it has an example of using record set to input addresses. (Even though this is documentation for 10.0, it works the same way in 9.3)
... View more
05-23-2010
10:22 AM
|
0
|
0
|
257
|
| Title | Kudos | Posted |
|---|---|---|
| 1 | 09-30-2013 04:37 PM | |
| 1 | 03-27-2013 10:03 AM | |
| 2 | 11-15-2013 12:33 PM | |
| 1 | 04-30-2013 11:26 AM | |
| 1 | 07-26-2011 08:03 AM |
| Online Status |
Offline
|
| Date Last Visited |
11-11-2020
02:22 AM
|