|
POST
|
Thanks again for answering my questions. This polygon shapefile is indeed a multirow one. I mentioned only the first circle because I thought that the movement would rely on the centroid of the smallest circle. I understood that I need ArcObjects. I am really not experinced in ArcObject but I can handle programming in different laguages. I will give it a try. Thank you for time. Nestoras Papadopoulos Look up how to use cursors and the ITransform2D interface move method. You should add an attribute value that marks out the centeral polygon in the assembly, since you will need to get your dx and dy values from the centroid of that polygon to the new point centroid location first. Then you can cycle through all of the polygons to apply the same dx, dy transformation to all of the polygons. You also will need to cast from the Polygon coclass (probably through the IPolygon4 interface) to the IArea interface to get the Centroid X and Y of the polygon. You would normally have to access the IFeature and IFeatureClass interfaces to access the polygon shape and get to the IArea interface Again, use the ArcObject SDK forum to ask questions related to how to manipulate the underlying geometry of your records and how to construct an Add-In interface that makes sense for your workflow.
... View more
09-29-2013
07:25 AM
|
0
|
0
|
2795
|
|
POST
|
Hi Richard Many thanks for your advice and links - really helpful. While I admit I am not a python expert I have created scripts to automate many of our workflows and have included validation scriptswith these so have more than a basic knowledge. What I am hoping to achieve is a combination of using a featureset and recordset or attribute lists to add multiple species to a ecology habitat type...the user will click a point to add a habitat type which can be from a feature template or a list parameter...the habitat type selected will determine the species list dropdown - i can do this already using the vaildation script to change the species tick list...BUT...if possible I would really like to also include an abundance attribute (D, A, F, O, R) for each species and this is not possible at the moment as the value list defaults to a ticklist - do you know if it is possible to create a value table for string parameters? or would I be better off going the .net route? if so where is the best place to get started? Any pointers are much appreciated. Cheers Tim I know that the validation for the second combobox drop down uses a cursor to get the value list. The drop down list can be modified at runtime with string values. I have a sample tool with two coordinated drop downs at work, but cannot access it at the moment. In any case, it should be possible using either the tool or .Net as long as you don't need to continue expanding the interface with a lot more runtime updates. As I said, .Net works much better for many controls that interact with your databases at runtime. A value table of multiple columns does not work as far as I know in the tool. At the very least I never found any documentation that explained how to get the tool to emulate such things as the Sort tool table parameters. .Net can handle it with listbox or datagrid tools.
... View more
09-28-2013
03:57 PM
|
0
|
0
|
3253
|
|
POST
|
[ATTACH=CONFIG]27846[/ATTACH] as you can see in the picture there is one point shp, one polygon shp and a raster. The polygon is made from concentric rings and then devided to sectors (except from the first, the smallest circle). With each sector I get some properties of the raster. As soon as I get the properties (mean height) I must move the polygon shp (circles with sectors) in that way so the centre of the circles (or just the centre of the smallest one) snaps to the next point of the point shapefile. The difficult for me is to move the circles to next point in model builder. If you can help me, I would be grateful. Thanks in advance There may be a single polygon shapefile, but that is multiple polygon shapes, not a single polygon, unless you have done some kind of trick. A picture of the polygon table view would tell me what you really are showing me on screen. If this is one polygon there will be just one feature row, but if there are many polygons that form an assembly there will be many rows. I am certain I will see many rows. In which case, what you imagine needs to be done (just move the smallest polygon to the point) has nothing to do with what actually needs to be done to move that entire polygon assembly to a new location. It cannot be done in ModelBuilder directly, because no geoprocessing tools do what you want. I also do not think any Python programmers can deal with this problem. You almost certainly would have to build a custom .Net tool add-in. Perhaps the .Net tool could be accessed in ModelBuilder. But I would not bother with that and convert the whole thing to .Net and forget ModelBuilder. .Net can use all of the ModelBuilder tools and do much more, but it is not user friendly for non-programmers. But I do not believe a user friendly option exists for what you want to do. But I am hesitant to write the code for you, since it sounds like you have no experience with ArcObjects and I don't have time to work with a novice to troubleshoot this across the forum. Additionally, at the moment my remote access to ArcMap is down, so I don't have the ability to work on this in my free time at the moment and test or troubleshoot the code I would propose. So you should probably repost on the ArcObjects SDK forum to get attention from more ArcObjects programmers. Be prepared to transfer your data if someone is willing to take this on.
... View more
09-28-2013
10:37 AM
|
0
|
0
|
2795
|
|
POST
|
Thank you for answering. I could do so, but it would decrease my accuracy of the output. These circles I mention are divided into certain sectors, so I would like to make a tool in model builder for the calculations, but I can't make this tool to move or to create the shapefile with the circle snapped to every point of the point shapefile. If there is any other idea, it is welcomed. Thanks again If all you mean by affecting accuracy is different attributes at each ring, but the polygons are still just normal concentric rings the problem could be done with buffers. So are you saying these are not complete rings? They are partial rings that are cut up and only form complete rings when more than one piece is combined? Additionally, is this a multipart single polygon, or is it multiple polygons that together form a concentric ring pattern? If it is multiple polygons forming a pattern, then in reality if these are not true rings most pieces are not really centered or snapped to the point, but instead are snapped to positions relative to each other that you want to transform together as a group. A picture is your best way of showing what you are really doing, since it does not sound like you know what you are actually describing from a programmatic or geometric transformation point of view. It sounds like you would have to do this with AcrObjects and move to a .Net add-in tool to do 2D transformations of a single polygon or a polygon assembly. ArcObjects can do this as an editor transformation (very slow) or by making copies of a template polygon or polygon assembly and generating new copies at each centroid location (much faster, but potentially complicating your further geoprocessing). Python does not support editor transformations, since the properties you would need to alter are all read only. At best using arcpy you could generate new polygons at each point if you knew how to build the geometry of the polygons from a listing of coordinate points and parts. Once you knew this and the true centroid location of the template polygon, building copies at new centroid locations should not be hard, since the delta X and Y transformation of the coordinates from one point to another is easy to calculate. Polygons could be built and deleted successively, but not moved. But this may not work if you have shapes with true curves, since you cannot build curved ring shapes with arcpy. I am pretty sure you are limited to building straight line polygons. But since I do not have a picture of what you are working with, I don't know how any of this would work with your other geoprocessing objectives. Without a picture I won't hazard an attempt to give you anything specific for a problem as potentially complex as this one.
... View more
09-28-2013
06:17 AM
|
0
|
0
|
2795
|
|
POST
|
For a curve, I want to get the point at a distance from the curve's start point. A piece of code is below: ICurve pCurve = (ICurve)feature.ShapeCopy; // feature is a IFeature IPoint startPoint = pCurve.FromPoint; IPoint toPoint = pCurve.ToPoint; double distanceOnCurve = 0.4 * pCurve.Length; double offset = double.NaN; bool isRightSide = false; bool asRatio = false; pCurve.QueryPointAndDistance(esriSegmentExtension.esriNoExtension, startPoint, asRatio, toPoint, ref distanceOnCurve, ref offset, ref isRightSide); But I don't know how the result be returned as a Point. Appreciate in advance if you can provide a hint. I don't think this is the method you want to use. ToPoint is the output point that is positioned along the line at the closest location to the input point (startPoint). Since the input point is your from point of the line, that is where the output point will be. The distanceOnCurve value you are specifying is ignored, since that is an output parameter and will return position 0 for the first point in the line every time. This method is used to find the distance along the line of the input point, so if you had a point that was at 40% down the line, you could use this method to determine that is in fact where the point was located. If what you really want is to create a point that is at a position 40% down the curve's length from the line's beginning then you need to use the GetPoint method. This will create a point anywhere along the line or on the projection of the line's end points. So you can actually ask for positions extending beyond the end points of the line in addition to points that actually fall on the line. This method will create an output point at the 40% position along your line, based on a ratio of the line length or an actual distance measured along the line. So a distance along of 0.4 with the ratio flag set to true is the same as a distance along of 0.4 * pCurve.Length when the ratio flag is set to false.
... View more
09-27-2013
01:51 PM
|
0
|
0
|
1103
|
|
POST
|
Here are two blogs on the subject. Generating a choice list from a field. and Generating a multivalue choice list.. I know there was another blog that laid the process out better that I used, but I have not been able to find it so far. Generally interactive list dependencies are handled in the tool Validation script. I have done this in the past and created tools where user interaction with one component of a tool updated a choice list in another part of the tool. It worked OK when I did this for a two field dependency. You have to be pretty skilled at Python to make it work really well since once you understand the principles there are many subtle adjustments that can customize the list behaviors beyond what the blogs cover. Testing and modifying the tool is not well supported so I am not willing to instruct a Python novice on how to set it up and customize it through the forum. Get comfortable with Python before attempting this. But the principles for modifying the tool validation do not scale well as you make your tool increasingly complex. When I got to about 7 field interactions on a single tool I needed over 700 lines of validation code to make the interactions work the way I wanted. The performance of the tool tanked to the point where it took 5 to 10 minutes just to load the tool for editing and it took minutes to run. At that point I abandoned the tool and ended up going to .Net Add-ins. .Net has no problem with very complex forms, gave me a lot more interface options and performs great. So for really involved user interfaces that go beyond simple two field interactions you should create add-ins with .Net that use Windows forms and UI components.
... View more
09-27-2013
08:54 AM
|
0
|
0
|
3253
|
|
POST
|
All, I have a script that works when the desired Feature Class is listed above Feature-Linked Annotations within ArcMap TOC. But, the script does not work when the Feature Class is displayed below Feature-Linked Annotations. What is the logic behind why this occurs? [ATTACH=CONFIG]27752[/ATTACH] [ATTACH=CONFIG]27753[/ATTACH] Probably the script is just getting the first layer in the map period. It is the lazy, easy way to write a script. Logic can be added to search the layer tree for a given layer name and get it at other levels, but it requires knowing the layer name in the code. Or the selected layer could be used if the code is written to do that. If layers are placed inside group layers, recursive layer searches need to be used (an additional aspect to the logic and set up). Basically it is up to the programmers skill and experience to access the needed layer and to give or restrict the user's flexibility on where it is in the layer tree.
... View more
09-25-2013
12:03 PM
|
0
|
0
|
2575
|
|
POST
|
Hi What is the geoprocessing tool (python arcpy) that will allow you to copy a feature table while keeping the object id? I believe the Copy tool will do that for simple features, but you should verify the result. Complex relationships and feature types (topologies, network datasets, feature linked annotation) won't be ported and may not even work with that tool.
... View more
09-25-2013
11:59 AM
|
0
|
0
|
2617
|
|
POST
|
Hi, Your methodology seems to work rfairhur24 but I have few questions about it and I would really appreciate your help !! 1. You said: "Make the Buffer tool do a dissolve on the attribute you will ultimately use in the Dissolve at the end." What does it mean? In your example, which was the attribute ?? Was it the Shape Area ?? All polygons had different areas ... so how did it perform the dissolve function ?? The problem I have is that I don't want to create a dissolve field since I have a shapefile with more than 120000 polygons and it will take me a looooong time to do that. I would like to find a way the program dissolve all neighbour polygons. 2. What did you mean by "Select all features that match on your dissolve attribute from the case field(s)" ?? I tried several times different things but it doesn't work with my data. Thank you for you time and help !! My Dissolve field was SUBDIV_NAME, but to keep my example simple it did not play a real role, since there was only one subdivision. However, in reality if I ran the tool I would process the 50,000 subdivision values through the process in my 3/4 million parcels. Most of the subdivisions would be right next to each other and I would not want them to bleed together even by the smallest buffer distance, so I added a step to keep the bleeding from occuring. In any case, I think you found that the time spent on dissolving 120000 polygons was less than you thought, and even if it took time, it got the job done.
... View more
09-24-2013
03:47 PM
|
0
|
0
|
3926
|
|
POST
|
I decided to "trace" over the trail layer and although my new layer does not capture all of the twists and turns of the trail, at least I can get a general sense for the relative difference in distance between the sites along the trail. The Linear Referencing tools and measures calculated just fine after creating the new (clean) line to generate the route with. Someone else gave the original trail data to me and it clearly has bad topology! Many thanks for all of your help! All of the suggestions you made were helpful. Glad I could help. I knew once you had a clean line topology your problems would go away, so I'm glad you worked out a way to get there.
... View more
09-24-2013
11:48 AM
|
0
|
0
|
3616
|
|
POST
|
Is anyone aware of a way to copy field values from one feature class to a field in another feature class either python or modelbuilder? With a common attribute (single field) and a one-to-one or many-to-one relationship between target and source tables you can use a join and the Field Calculator. Just make sure you use the Make Feature Layer tool in ModelBuilder before attempting to join a feature class or table to another. If the relationship is only spatial then a Spatial Join may be needed in addition to the join and field calculator. More complex relationships based on multi-field relates would require Python and cursors. So more info about what the relationship is between the source and target feature classes/tables is needed to know what you need to do.
... View more
09-24-2013
11:43 AM
|
0
|
0
|
1492
|
|
POST
|
I'm have an edit session open and selected sketch properties. However, I am not seeing anything listed (image attached). I have not done much editing since Version 3.x and the new editing interface is a bit confusing to me. There are 368 features that comprise the trail (trail attribute table also attached). Also not familiar with how to do this. The trail is not a complete loop. To build the trail you need a single attribute on all segments when building the Create Route. Having 300+ segments makes no sense for positioning events, since each event will have the same measures, since each segment will restart the measures. Breaking it apart was only a temporary step to help you clean up the topology, but once that is clean you want to rebuild a single route feature. Therefore Make id 1 again on all segments and then Create Route with the Length option and the orientation priority using that id. To see the Sketch properties you have to select a single feature and then edit its vertices. Right click the single selected feature with the Editor cursor and choose "Edit Vertices" and the sketch table will show up. Only look at the sketch properties of the route built the way I explained above. The fact that the original lines were not Routes is why they came up as 10. Everything was Not a Number so it was all one value. My logic should probably be altered to make that just an 8, but in any case the fact that there were not polyline M values explains the answer. To apply hatches, choose a route feature layer (polyline M features) and open the Property window for the layer (right click and choose Properties or double click the layer). There will be a Hatches tab. See the help here on setting up hatching. But only do that after building the route on the combined segments that form a single trail.
... View more
09-24-2013
09:19 AM
|
0
|
0
|
3616
|
|
POST
|
The smoothed line still has MMONOTONIC = 10 for all records. I built topology and rules for the smoothed line and there were no errors. Is there something else I can do to ensure monotonicity in the dataset? 10 is an odd result for the MMonotonic calculation. It should mean that nearly every measure is the identical on every vertice. Have you looked at the sketch properties of the route to see how many parts it is made up of and how the measures look? Also you should set the M tolerance and resolution in the environment for the Create Route tool to ensure it has the decimal precision you need (if you use miles and it rounds to whole numbers, most measures will be identical). So in an edit session open the sketch properties and let me know what you see. You could also set hatching on the route layer to display the measure layout. I also want to be sure again that this trail is not complete loop. Can you screenshot the whole trail just so I understand what you are working with?
... View more
09-24-2013
07:29 AM
|
0
|
0
|
3616
|
|
POST
|
Service pack 2? Did I miss a memo? Nope, just wishful thinking on my part. I meant Service Pack 1. Sorry.
... View more
09-24-2013
07:07 AM
|
0
|
0
|
1741
|
|
POST
|
just to be clear, my code was built with Service Pack 2 for ArcMap 10.1, so make sure you have installed Service Pack 2. I don't know that there is any effect of the Service Pack that might relate to your problem, but it is best to eliminate that possibility. The code I provided before only ran as a Field Calculation. It was not meant to be run as a Python script. To add the new subroutine you want that will fill in the Greatest Value field the code needs to be converted to a standalone script. A Field Calculation cannot efficiently summarize data and update records with the summary data, but a script can. So here is a script that should replace the Field Calculation that will assign with both the Sequence field values and the Greatest Value field values. You should no longer need the field calculation if you use this script. Make sure you customize the variable values for your data file name and path and for the field list so that it exactly matches your data set up: # Import the arcpy module
import arcpy
pStart = 1 # adjust start value, if required
pInterval = 1 # adjust interval value, if required
# Initialize the sequence number dictionary and the Route ID variables
seqDict = {}
CID = ""
# Assign data and field list variables.
# Customize these variable inputs for your specific data
myData = r"C:\MyPath\MyData.shp"
fields = ["CID", "SEQUENCE", "GREATEST"]
# Step 1 - Use an update cursor to assign Sequence numbers
rows = arcpy.da.UpdateCursor(myData, fields)
for row in rows:
if row[0] is None:
CID = "Null"
else:
CID = row[0]
if CID in seqDict:
seqDict[CID] = seqDict[CID] + pInterval
else:
seqDict[CID] = pStart
row[1] = seqDict[CID]
rows.updateRow(row)
del row
del rows
# Step 2 - Use an update cursor to assign the Greatest Value to all records
rows = arcpy.da.UpdateCursor(myData, fields)
for row in rows:
if row[0] is None:
CID = "Null"
else:
CID = row[0]
row[2] = seqDict[CID]
rows.updateRow(row)
del row
del rows I also want to make sure you understand that this code will only work if it runs on every record in your data and that it will overwrite any previously assigned sequence numbers if any records have changed. To make the script continue any preexisting sequence numbering from any previous run of the tool the code would have to be changed to split Step 1 into two steps. First a search cursor would have to populate the sequence dictionary with the maximum sequence number for all existing sequences and then an update cursor would have to run to actually update the new records that did not have sequences assigned to continue those sequences or begin new sequences for new routes.
... View more
09-24-2013
06:44 AM
|
0
|
0
|
1741
|
| Title | Kudos | Posted |
|---|---|---|
| 1 | 03-24-2026 11:37 PM | |
| 1 | 03-24-2026 08:01 PM | |
| 7 | 02-23-2026 08:34 AM | |
| 1 | 03-31-2025 03:25 PM | |
| 1 | 03-28-2025 06:54 PM |
| Online Status |
Offline
|
| Date Last Visited |
07-09-2026
12:59 AM
|