|
POST
|
Hi Jason, Try this code. Set the path of your input data to in_fc. I haven't done anything (other than printing) with the duplicate features - you'll need to use either an insertcursor (with a new empty feature class) or updatecursor (to work with current feature class) to carry over the unique features.
import arcpy
in_fc = r"C:\mytools\findidentical\geom_equals.gdb\trailsfew"
dsc = arcpy.Describe(in_fc)
sr = dsc.spatialReference
oid_field_name = dsc.oidFieldName
# get a cursor on the input features
rows1 = arcpy.SearchCursor(in_fc)
# exclude features already compared once
exclude = []
# iterate through the first coursor
for row1 in rows1:
oid1 = row1.getValue(oid_field_name)
shp1 = row1.shape
# get a second cursor on the same input features
rows2 = arcpy.SearchCursor(in_fc)
# add the feature to be compared to exclude list
exclude.append(oid1)
# create a set to hold duplicate features
group = set()
# iterate through the second cursor
for row2 in rows2:
oid2 = row2.getValue(oid_field_name)
shp2 = row2.shape
# ignore features already compared
if oid2 in exclude:
continue
# test equality
if shp1.equals(shp2):
# add both feature ids to the set of identical features
group.add(oid1)
group.add(oid2)
# add the feature just compared to the exclude list
exclude.append(oid2)
if group: # if the group is not empty
print group
Note: I have used two separate cursors on the same feature class. This is due to some issues at 10.0 - at 10.1 one cursor is enough. Let me know if you find any issue or if you need help with creating an output. Thanks, Nobbir
... View more
12-24-2012
12:08 PM
|
0
|
0
|
473
|
|
POST
|
I would like to reproduce the issue on my machine. Could you please let me know whether you are using 10.1 Final or 10.1 with SP1?
... View more
12-17-2012
09:33 AM
|
0
|
0
|
1709
|
|
POST
|
Hi Brian, Could you please let us know what error message you are getting? Is the tool running fine on Desktop? Or faililng on both desktop and server? Can you send me your tool or at least the your code files (as *.zip) at nahmed@esri.com ? Thanks, Nobbir
... View more
12-17-2012
07:58 AM
|
0
|
0
|
1231
|
|
POST
|
Wouldn't a line that starts at vertex 0, goes out to vertex 1, then returns to vertex 0 and closes as vertex 2 (and vertex 2 lies on top of vertex 0 by setting the snapping environment appropriately) be identical by definition? Yes, the answer is "should be". However, in 10.0 (including SP5), digitizing direction mattered. So, the above two lines are considered non-identical 😞 We have enhanced the tool's behavior by ignoring the digitizing direction in 10.1. Let me know if you need a workaround. If you want to try - just look the documentation for ArcPy Geometry classes. There is a method called equals - try using that. Earlier, I was unable to reproduce the case as I was using a 10.1 setup. 😞
... View more
12-13-2012
11:21 AM
|
0
|
0
|
2366
|
|
POST
|
Thanks for the data 🙂 I guess your input to Find Identical is Data_Split_Lines_By_Vertices, right? Here is the screenshot for one of the self-intersecting lines (feat# 5 of your Test_Lines data): [ATTACH=CONFIG]19907[/ATTACH] After splitting this line by vertices, we get 17 short lines. [ATTACH=CONFIG]19909[/ATTACH] None of these 17 lines lie exactly one upon another - that is, there is no spatially duplicate feature among these 17 lines. Could you share your spatially identical lines?
... View more
12-13-2012
07:36 AM
|
0
|
0
|
2366
|
|
POST
|
Hi Jason, Could you please share part/all of your data? I have posted some questions to the other thread (on same issue) for you - please respond to the questions - that will help me refine my tests and find a good answer for you. Thanks, Nobbir Geoprocessing Team
... View more
12-11-2012
12:49 PM
|
0
|
0
|
2366
|
|
POST
|
Looks like in 10.0 the process was not as intuitive 😞 Here is my find - you can do it in two ways: 1. Go to ArcGIS\Desktop10.0\Coordinate Systems folder under <ArcGIS install directory> - find the projection file you want to make default. - open the projection file in a text editor (such as Notepad) - copy the content (a long string) - paste the content in the default row of the parameter (as shown below). [ATTACH=CONFIG]19184[/ATTACH] 2. The second option is to run Create Spatial Reference tool (under Data Management toolbox) with your spatial reference as input. The tool result dialog will show the full string of the spatial reference. Copy the string without including the double-quotes. - Paste the string into default row of the parameter. In short, get the spatial reference string in any way and use the string instead of a name. Let me know whether that works.
... View more
11-09-2012
08:02 AM
|
0
|
0
|
1244
|
|
POST
|
Could you please let others know your solution? It'll help other users visiting this thread. If your solution include one of the suggestions please mark that as answered. That'll also be helpful. Thanks.
... View more
11-08-2012
11:22 AM
|
0
|
0
|
1294
|
|
POST
|
See the screenshot below - when you select the parameter name you'll see a list of parameter properties below. Click next to Default and type the name of the coordinate system: [ATTACH=CONFIG]19158[/ATTACH]
... View more
11-08-2012
11:18 AM
|
0
|
0
|
3789
|
|
POST
|
I cannot reproduce it in 10.1. I can test if you can share your data (or part of data). Here is my script: import arcpy
import os
wks = os.getcwd()
arcpy.env.workspace = os.path.join(wks, "joins.gdb")
in_fc = "states_few"
in_id = "geocompID"
join_table = "table1"
join_id = "ID"
join_type = "KEEP_COMMON"
try:
# note the output layer name is states_layer
# use this output layer in subsequent tools
arcpy.MakeFeatureLayer_management(in_fc, "states_layer")
arcpy.AddJoin_management("states_layer", in_id, join_table, join_id, join_type)
arcpy.CopyFeatures_management("states_layer", "states_joined")
print arcpy.GetMessages()
except:
print arcpy.GetMessages(2)
... View more
10-31-2012
03:01 PM
|
0
|
0
|
1433
|
|
POST
|
Assuming the coordinates in feet are stroed in a point feature class, you can use Convert Coordinate Notation tool (Data Management > Projections and Transformations) to get coordinate values in decimal degrees.
... View more
10-31-2012
02:32 PM
|
0
|
0
|
8546
|
|
POST
|
Hi Gregory (and all others interested), good news is that finally we have implemented the desired behavior in 10.1 🙂 It works for Project and Batch Project tool. Please let us know if you find any anomaly in expected behavior.
... View more
10-29-2012
08:06 AM
|
0
|
0
|
397
|
|
POST
|
Update - check out this document: Fundamentals of saving your customizations Looks like you cannot do it without saving the document. At the middle of the topic it states that: The customizations listed below are only ever saved at the document level; you cannot elect to save these customizations in your template. �?�UI Controls added to any toolbar or menu �?�Macros added as buttons to any toolbar or menu
... View more
10-12-2012
09:35 AM
|
0
|
0
|
1659
|
|
POST
|
Have you tried Generate Near Table tool (under Analysis Tools > Proximity toolset)? You can use sub-setting by selection.
... View more
10-12-2012
09:19 AM
|
0
|
0
|
374
|
|
POST
|
I'm afraid the only way is to use the saved map document 😞 I'll check again and let you know.
... View more
10-11-2012
12:47 PM
|
0
|
0
|
1659
|
| 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
|