|
POST
|
Jason's code is working for me. The intial SR was UTM 11 N and I was able to change it to California state plane. import arcpy
mxd = arcpy.mapping.MapDocument(r"D:\dataframesr\df_sr.mxd")
df = arcpy.mapping.ListDataFrames(mxd)[0]
prjfile = r"D:\dataframesr\ca_fips.prj"
sr = arcpy.SpatialReference(prjfile)
df.spatialReference = sr
mxd.save()
del mxd
I'm on Win XP, ArcGIS 10.0 SP3.
... View more
05-23-2012
03:55 PM
|
0
|
0
|
1659
|
|
POST
|
WARNING: I saved and closed the map document that worked with Mathew's sample. Now, whenever I attempt to re-open that particular map document, it crashes 😞 @Mathew: Thanks for following up. @Olivier: officially, ArcPy does not support Tkinter inside ArcMap. Olivier, I am interested about your need for using Tkinter in ArcMap. Could you please let me know what you are trying to do with a custom GUI? I would like to investigate why your workflow cannot be implemented with our current scripting framework. Thanks.
... View more
05-23-2012
12:30 PM
|
0
|
0
|
4656
|
|
POST
|
Selection by Location (from ArcMap's Selection menu) and Spatial Join has relationships to select touching features. Select by Location: Target layer features share a line segment with source layer Both Spatial Join and Select Layer by Location geoprocessing tools have: SHARE_A_LINE_SEGMENT_WITH To get a clear idea of the relationships use this graphic examples: Select By Location: graphic examples
... View more
05-23-2012
10:26 AM
|
0
|
0
|
6294
|
|
POST
|
You can do it ModelBuilder but in a cumbersome way. You will need to embed two extra models and a script tool in a main model. Instead, use this script - simple and straightforward. import arcpy import os # replace data path with your OWN data. in_data = r"C:\data\f.gdb\parcels" field_list = [] numeric_fields = ["Double", "Integer", "SmallInteger"] fields = arcpy.ListFields(in_data) for field in fields: if (field.type in numeric_fields): field_list.append(field.name) # convert the list of fields to a semicolor delimited string fields = ";".join(field_list) rows = arcpy.UpdateCursor(in_data, '', '', fields) count = len(field_list) for row in rows: for k in range(count): if row.isNull(field_list ): row.setValue(field_list , 0) rows.updateRow(row) Let me know if you have any trouble. If you want you can modify the script a little bit to use it in a script tool.
... View more
05-23-2012
09:30 AM
|
1
|
0
|
4322
|
|
POST
|
Wow! Great - it works. Until now all my attempts to get TkInter work in ArcMap ended in crash. Thanks a lot. Do you have any other example that you can share?
... View more
05-23-2012
08:39 AM
|
0
|
0
|
4656
|
|
POST
|
@Mathew, The TkInter example in your link works outside of ArcMap - as a standalone GUI interface. @Olivier TkInter does not work from within ArcMap - it crashes Arcmap. The reason is TkInter's event loop does not work with ArcMap. By the way, what are trying to achieve through the GUI?
... View more
05-22-2012
03:30 PM
|
0
|
0
|
4656
|
|
POST
|
In ModelBuilder, try using Iterate Field Values iterator - you'll get it from the Insert menu > Iterators. Make your data input to the Iterate Field Values as follows: [ATTACH=CONFIG]14519[/ATTACH] The iterator iterates through each value of a chosen field of the selected features. If there is no selection then it iterates all features. To get 0 for null values, be sure to set Null Value to 0 (last parameter in this dialog). [ATTACH=CONFIG]14520[/ATTACH] In the above dialog, for the BEAT field of crime data, all <null>s will be replaced by 0 (in this case). You can replace null with any other value (such as -9999). Hope that helps. Thanks.
... View more
05-22-2012
08:54 AM
|
0
|
0
|
4322
|
|
POST
|
(Number of species in the survey area/Total area surveyed)*Total area" I guess you have data for 'number of species in survey area', 'area surveyed' and 'total area' in three fields of a table, right? If so, then add a new field (say, Estimates) to the table. Open the attribute table in ArcMap. Right-click on the newly addeded 'Estimates' field name and select Field Calculator ... Select Python as Parser. Set Estimates = ( !NumOfSpecies! / float(!SurveyArea!)) * !TotalArea! My guess may be wrong - in that case - could you please elaborate your steps?
... View more
05-21-2012
08:33 AM
|
0
|
0
|
367
|
|
POST
|
Selection and definition query on layers are not supported by the Project tool: all features in the dataset referenced by the layer will be projected. If you want to project selected features only, consider using the Copy Features tool. Copy Features only copies selected features and honors the output coordinate system geoprocessing environment. So, after Make Feature Layer, set the output coordinate system environment with your desired coordinate system and then run Copy Features.
... View more
05-18-2012
08:18 AM
|
0
|
0
|
861
|
|
POST
|
The licensing restriction is loosened a bit - if you use one attribute field at a time (except for Shape field) then Find Identical tool works on all license levels.
... View more
05-16-2012
01:11 PM
|
0
|
0
|
875
|
|
POST
|
Check out these blogs (2 parts): http://blogs.esri.com/esri/arcgis/2011/06/06/modelbuilderifthenelse1/ http://blogs.esri.com/esri/arcgis/2011/06/06/modelbuilderifthenelse2/
... View more
05-16-2012
10:15 AM
|
0
|
0
|
281
|
|
POST
|
Iterators may look daunting initially but it won't take time to use them with ease. For your particular issue you start here: Help topic on Iterate Feature Selection Tutorial on Iterators in ModelBuilder To get started, see the Model below: [ATTACH=CONFIG]14338[/ATTACH] The first oval (blue) is your input. The Iterate Feature tool uses the unique values of your field to select features iteratively. Copy Features then copies the output to your desired location. In your case, if you run the this model, you'll see 12 output feature classes. I have also attached the toolbox with the model. Edit the model to set paths to your need.
... View more
05-15-2012
12:45 PM
|
0
|
0
|
872
|
|
POST
|
Could you please elaborate your issue? Is the data type of the attribute is of type Text (string) or what? Where do you want to put your separated 'entity'? In the same attribute table or in a different table?
... View more
05-14-2012
02:16 PM
|
0
|
0
|
872
|
|
POST
|
Use the buffered circles as input to Feature Envelope to Polygon tool. The output will be squares.
... View more
05-14-2012
02:12 PM
|
0
|
0
|
3899
|
| Title | Kudos | Posted |
|---|---|---|
| 1 | 12-18-2019 03:56 PM | |
| 1 | 05-06-2020 01:18 PM | |
| 1 | 07-23-2021 10:33 AM | |
| 1 | 07-28-2020 09:10 AM | |
| 2 | 07-27-2020 04:47 PM |
| Online Status |
Offline
|
| Date Last Visited |
10-25-2021
03:13 PM
|