I got the code to work just fine. It calculated 15 in the MMONOTONIC field. Seems like I do not have monotonicity. How can I correct this? Simplify the line?I switched RID to 1 and re-generated the Event Table (attached).I zoomed into points 13 and 14 and there doesn't appear to be any complex curving here.
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.
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.
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?
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?
Yes, the Route ID of the trail is zero. So it seems that the RID field of the Events is populated appropriately.I ran the code you provided using field calculator in a new "MMONOTONIC" field (long integer) and recieved error 999999 (attached). Maybe because I only have one route represented by one record?The attached image also shows the section of the trail where the calculation jumps and the attribute table of the route layer. For reference, this distance between the 13th and 14th point is about 500 meters.
Is your actual Route ID for your trail 0?
Right click the MMONOTONIC field I told you to add to the Routes and choose the Calculate Field. Then input the calculation. Each step is listed from top to bottom of the field calculator tool and there are 4 things you need to set. No modification of the code is needed. It just ensures that there are no hdden problems in your routes and become more important when you start dealing with large datasets, such as the 30,000+ routes I deal with.
Sort by RID and then by measure and be sure all of the events have the same RID values. The RID field includes zeros for each record. Maybe this is a clue to the problem?
Thank you for the code. I do have some Python experience. However, I am not sure how I would implement/modify this code for my situation. Can this be used in the Python window in ArcMap or would it require IDLE (or other)? Would I reference my data by defining a variable named "feat" which points to my point feature class?
Hi,I am attempting to measure the distance between sites (points; n=50) that were sampled along a trail using the Linear Referencing tools. I created a "route" from my trail feature class (line; dissolved into one single feature) and was able to run the Locate Features Along Route tool without any errors. I then ran Make Route Event Layer so that I could view my points after they had been "snapped" to the trail, which all looked great.The problem I am having is with the values in the Measure Field, which is supposed to list the distance at which each point exists along the trail. I sorted the Measure Field in descending order and expected that my sites would then be listed in the order in which they appear along the trail, and this is the case for the first 12 sites. However, the 13th site listed is the one at the opposite end of the trail and then the remaining sites are listed in sequential order and meet back up with the 12th site. I checked to see if this could be explained due to the values being measured from the other end of the trail, but this didn't add up.So basically, it seems that the Measure Field was not calculated properly. I would greatly appreciated any insight into this. Many thanks in advance!
def MMonotonicity(feat): partnum = 0 # Count the number of points in the current multipart feature partcount = feat.partCount pntcount = 0 mmonotonicity = 0 lastM = -100000000 # Enter while loop for each part in the feature (if a singlepart feature # this will occur only once) # while partnum < partcount: part = feat.getPart(partnum) pnt = part.next() # Enter while loop for each vertex # while pnt: pntcount += 1 if lastM < pnt.M and lastM != -100000000: mmonotonicity = mmonotonicity | 1 if lastM == pnt.M and lastM != -100000000: mmonotonicity = mmonotonicity | 2 if lastM > pnt.M and lastM != -100000000: mmonotonicity = mmonotonicity | 4 if not pnt.M: mmonotonicity = mmonotonicity | 8 lastM = pnt.M pnt = part.next() # If pnt is null, either the part is finished or there is an # interior ring # if not pnt: pnt = part.next() partnum += 1 return mmonotonicity
Membros conectados podem postar, seguir atualizações e mais. Novo aqui? Registre uma conta gratuita.
Find useful guides, FAQs, and documents to help you navigate and make the most of Esri Community.