How is the LRS ArcGIS Measure Along a Line implemented? The 2019 Stack Overflow Developer Survey Results Are In Unicorn Meta Zoo #1: Why another podcast? Announcing the arrival of Valued Associate #679: Cesar ManaraWriting length of line along the lineDistance to nearest hub output not correctHow to measure an irregular road line in QGIS?Distance unit between line and point shapefileIncorrect results returning from st_distance_spheroid queryArcMap Random Points Minimum Distance Field not able to use unitsHow to interpolate a lat/long point between two others at a given distanceLRS plugin does not return measure field.Calculate distance to points along line in ArcMap?Why does my line's location on top of a basemap differ between ArcGIS Pro and ArcMap despite the same projected coordinate system being applied?

Huge performance difference of the command find with and without using %M option to show permissions

How to determine omitted units in a publication

What was the last x86 CPU that did not have the x87 floating-point unit built in?

Are spiders unable to hurt humans, especially very small spiders?

Could an empire control the whole planet with today's comunication methods?

ELI5: Why do they say that Israel would have been the fourth country to land a spacecraft on the Moon and why do they call it low cost?

Presidential Pardon

How to read αἱμύλιος or when to aspirate

Accepted by European university, rejected by all American ones I applied to? Possible reasons?

Working through the single responsibility principle (SRP) in Python when calls are expensive

Nested ellipses in tikzpicture: Chomsky hierarchy

Solving overdetermined system by QR decomposition

Is it ethical to upload a automatically generated paper to a non peer-reviewed site as part of a larger research?

Why can't devices on different VLANs, but on the same subnet, communicate?

Match Roman Numerals

"is" operation returns false even though two objects have same id

Why doesn't shell automatically fix "useless use of cat"?

How to politely respond to generic emails requesting a PhD/job in my lab? Without wasting too much time

Can a flute soloist sit?

Why doesn't a hydraulic lever violate conservation of energy?

Is every episode of "Where are my Pants?" identical?

Is there a way to generate uniformly distributed points on a sphere from a fixed amount of random real numbers per point?

Do warforged have souls?

Can the DM override racial traits?



How is the LRS ArcGIS Measure Along a Line implemented?



The 2019 Stack Overflow Developer Survey Results Are In
Unicorn Meta Zoo #1: Why another podcast?
Announcing the arrival of Valued Associate #679: Cesar ManaraWriting length of line along the lineDistance to nearest hub output not correctHow to measure an irregular road line in QGIS?Distance unit between line and point shapefileIncorrect results returning from st_distance_spheroid queryArcMap Random Points Minimum Distance Field not able to use unitsHow to interpolate a lat/long point between two others at a given distanceLRS plugin does not return measure field.Calculate distance to points along line in ArcMap?Why does my line's location on top of a basemap differ between ArcGIS Pro and ArcMap despite the same projected coordinate system being applied?



.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty margin-bottom:0;








0















I'm trying to replicate a nasty corner case in a LRS implementation that doesn't agree with ArcMAP measure tool. I've tried measuring distance in its native shp coordinate system NAD83 (27916) to no avail. (basically same results)



My question is how are the distances calculated along a line for the LRS system. My current distance function (for 4326) is the following.



EARTHRADIUS = 3963.190592 # miles

'''
used in distance
'''
def deg2rad(d):
return d * math.pi / 180.0

# in miles
def distance(pt1, pt2):
dLat = deg2rad(pt2[1] - pt1[1])
dLng = abs(deg2rad(pt2[0] - pt1[0]))
dLat2Sin = math.sin(dLat / 2)
dLng2Sin = math.sin(dLng / 2)
a = dLat2Sin*dLat2Sin + math.cos(deg2rad(pt1[1]))*math.cos(deg2rad(pt2[1]))*dLng2Sin*dLng2Sin
return 2.0 * EARTHRADIUS * math.atan2(math.sqrt(a), math.sqrt(1-a))



For most geometries the distance between the ESRI LRS and mine are nominal but this one is different. I've dealt with larger linestrings before (30+ miles) with no issues. Previously these other larger linestrings have worked fine throughout the alignment, however with this edge case I'm getting ~.5 miles difference (my implementation's distances are always larger) between the two implementations by the end.



Is distance calculated a different way via the LRS implementation, is my geometry duplicating previous points possibly, or is it possible coordinate system error is actually sneaking in?



EDIT:



For the ground truth measurement, I'm just hitting a backend ESRI LRS server I think? After playing with the code from this webmap. Basically all I'm doing is iterating through points in the subject linestring, adding my distance implementation to the distance along the line for each point then comparing the two. I did modify the API parameters for the lowest tolerance as I'm using the actually constituent point geometry and the shp's original coordinate system. I have no idea about how the LRS was implemented to be honest, other than the units are miles.



Other Notes



I tried to debug this for quite some time yesterday, I've come to conclusion I don't think its within the distance formula (although possible) more so some abstract set of calibration points that ESRI's LRS is defined by. The road's geometry represents a parallel set of vector for a good portion of it, and apparently some LRS systems use that original centerline to derive the LRS???



On top of that I noticed points are very dense multiple on top of one another (never shooting back though) I think underlying simplification may contribute as well. Also this geometry is about to be changed massively due to construction of a new roadway, so I think a small change to the real feature maybe potentially didn't bubble up to the geometry that the LRS is based on for this roadway. However I am sure I have the most up to date data set as it was dumped just to debug the same issues in ArcDesktop.



The real confirmation of my suspicion is when I dropped the raw shp into Earth Pro with the original CRS and opened up the elevation profile, and it had the same milepoint I did for my debugging landmark. So I feel there dealing with either a simplified or entirely different geometry, which is fun.



Like I said I could be entirely wrong but I tried every distance formula (geodesic, viscinity?, normal, euclidean) I know at the OG projection, and raw 4326 nothing worked. I hope that this will be of use to someone else and if I can I'll hunt up the ESRI documentation talking about abstract LRS systems from a centerline, and post a picture with the earth versus webmap output.



ESRI Doc here



Profile Milepoint from Subject Line (very bottom)



Milepoint Displayed When Using Measure Tool (top right)










share|improve this question









New contributor




Charles Murphy is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.




















  • Where is your line here? You are measuring length between 2 points.

    – FelixIP
    Apr 7 at 1:16






  • 1





    Most distances in are computed according to used-requested parameters. Without knowing how you performed the measurement, it's difficult to determine how far off your spherical measurement will be from the proper spheroidal calculation.

    – Vince
    Apr 7 at 2:26











  • Please Edit the question to add information. Comments are present in SE to ask for clarification.

    – Vince
    Apr 7 at 13:52

















0















I'm trying to replicate a nasty corner case in a LRS implementation that doesn't agree with ArcMAP measure tool. I've tried measuring distance in its native shp coordinate system NAD83 (27916) to no avail. (basically same results)



My question is how are the distances calculated along a line for the LRS system. My current distance function (for 4326) is the following.



EARTHRADIUS = 3963.190592 # miles

'''
used in distance
'''
def deg2rad(d):
return d * math.pi / 180.0

# in miles
def distance(pt1, pt2):
dLat = deg2rad(pt2[1] - pt1[1])
dLng = abs(deg2rad(pt2[0] - pt1[0]))
dLat2Sin = math.sin(dLat / 2)
dLng2Sin = math.sin(dLng / 2)
a = dLat2Sin*dLat2Sin + math.cos(deg2rad(pt1[1]))*math.cos(deg2rad(pt2[1]))*dLng2Sin*dLng2Sin
return 2.0 * EARTHRADIUS * math.atan2(math.sqrt(a), math.sqrt(1-a))



For most geometries the distance between the ESRI LRS and mine are nominal but this one is different. I've dealt with larger linestrings before (30+ miles) with no issues. Previously these other larger linestrings have worked fine throughout the alignment, however with this edge case I'm getting ~.5 miles difference (my implementation's distances are always larger) between the two implementations by the end.



Is distance calculated a different way via the LRS implementation, is my geometry duplicating previous points possibly, or is it possible coordinate system error is actually sneaking in?



EDIT:



For the ground truth measurement, I'm just hitting a backend ESRI LRS server I think? After playing with the code from this webmap. Basically all I'm doing is iterating through points in the subject linestring, adding my distance implementation to the distance along the line for each point then comparing the two. I did modify the API parameters for the lowest tolerance as I'm using the actually constituent point geometry and the shp's original coordinate system. I have no idea about how the LRS was implemented to be honest, other than the units are miles.



Other Notes



I tried to debug this for quite some time yesterday, I've come to conclusion I don't think its within the distance formula (although possible) more so some abstract set of calibration points that ESRI's LRS is defined by. The road's geometry represents a parallel set of vector for a good portion of it, and apparently some LRS systems use that original centerline to derive the LRS???



On top of that I noticed points are very dense multiple on top of one another (never shooting back though) I think underlying simplification may contribute as well. Also this geometry is about to be changed massively due to construction of a new roadway, so I think a small change to the real feature maybe potentially didn't bubble up to the geometry that the LRS is based on for this roadway. However I am sure I have the most up to date data set as it was dumped just to debug the same issues in ArcDesktop.



The real confirmation of my suspicion is when I dropped the raw shp into Earth Pro with the original CRS and opened up the elevation profile, and it had the same milepoint I did for my debugging landmark. So I feel there dealing with either a simplified or entirely different geometry, which is fun.



Like I said I could be entirely wrong but I tried every distance formula (geodesic, viscinity?, normal, euclidean) I know at the OG projection, and raw 4326 nothing worked. I hope that this will be of use to someone else and if I can I'll hunt up the ESRI documentation talking about abstract LRS systems from a centerline, and post a picture with the earth versus webmap output.



ESRI Doc here



Profile Milepoint from Subject Line (very bottom)



Milepoint Displayed When Using Measure Tool (top right)










share|improve this question









New contributor




Charles Murphy is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.




















  • Where is your line here? You are measuring length between 2 points.

    – FelixIP
    Apr 7 at 1:16






  • 1





    Most distances in are computed according to used-requested parameters. Without knowing how you performed the measurement, it's difficult to determine how far off your spherical measurement will be from the proper spheroidal calculation.

    – Vince
    Apr 7 at 2:26











  • Please Edit the question to add information. Comments are present in SE to ask for clarification.

    – Vince
    Apr 7 at 13:52













0












0








0








I'm trying to replicate a nasty corner case in a LRS implementation that doesn't agree with ArcMAP measure tool. I've tried measuring distance in its native shp coordinate system NAD83 (27916) to no avail. (basically same results)



My question is how are the distances calculated along a line for the LRS system. My current distance function (for 4326) is the following.



EARTHRADIUS = 3963.190592 # miles

'''
used in distance
'''
def deg2rad(d):
return d * math.pi / 180.0

# in miles
def distance(pt1, pt2):
dLat = deg2rad(pt2[1] - pt1[1])
dLng = abs(deg2rad(pt2[0] - pt1[0]))
dLat2Sin = math.sin(dLat / 2)
dLng2Sin = math.sin(dLng / 2)
a = dLat2Sin*dLat2Sin + math.cos(deg2rad(pt1[1]))*math.cos(deg2rad(pt2[1]))*dLng2Sin*dLng2Sin
return 2.0 * EARTHRADIUS * math.atan2(math.sqrt(a), math.sqrt(1-a))



For most geometries the distance between the ESRI LRS and mine are nominal but this one is different. I've dealt with larger linestrings before (30+ miles) with no issues. Previously these other larger linestrings have worked fine throughout the alignment, however with this edge case I'm getting ~.5 miles difference (my implementation's distances are always larger) between the two implementations by the end.



Is distance calculated a different way via the LRS implementation, is my geometry duplicating previous points possibly, or is it possible coordinate system error is actually sneaking in?



EDIT:



For the ground truth measurement, I'm just hitting a backend ESRI LRS server I think? After playing with the code from this webmap. Basically all I'm doing is iterating through points in the subject linestring, adding my distance implementation to the distance along the line for each point then comparing the two. I did modify the API parameters for the lowest tolerance as I'm using the actually constituent point geometry and the shp's original coordinate system. I have no idea about how the LRS was implemented to be honest, other than the units are miles.



Other Notes



I tried to debug this for quite some time yesterday, I've come to conclusion I don't think its within the distance formula (although possible) more so some abstract set of calibration points that ESRI's LRS is defined by. The road's geometry represents a parallel set of vector for a good portion of it, and apparently some LRS systems use that original centerline to derive the LRS???



On top of that I noticed points are very dense multiple on top of one another (never shooting back though) I think underlying simplification may contribute as well. Also this geometry is about to be changed massively due to construction of a new roadway, so I think a small change to the real feature maybe potentially didn't bubble up to the geometry that the LRS is based on for this roadway. However I am sure I have the most up to date data set as it was dumped just to debug the same issues in ArcDesktop.



The real confirmation of my suspicion is when I dropped the raw shp into Earth Pro with the original CRS and opened up the elevation profile, and it had the same milepoint I did for my debugging landmark. So I feel there dealing with either a simplified or entirely different geometry, which is fun.



Like I said I could be entirely wrong but I tried every distance formula (geodesic, viscinity?, normal, euclidean) I know at the OG projection, and raw 4326 nothing worked. I hope that this will be of use to someone else and if I can I'll hunt up the ESRI documentation talking about abstract LRS systems from a centerline, and post a picture with the earth versus webmap output.



ESRI Doc here



Profile Milepoint from Subject Line (very bottom)



Milepoint Displayed When Using Measure Tool (top right)










share|improve this question









New contributor




Charles Murphy is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.












I'm trying to replicate a nasty corner case in a LRS implementation that doesn't agree with ArcMAP measure tool. I've tried measuring distance in its native shp coordinate system NAD83 (27916) to no avail. (basically same results)



My question is how are the distances calculated along a line for the LRS system. My current distance function (for 4326) is the following.



EARTHRADIUS = 3963.190592 # miles

'''
used in distance
'''
def deg2rad(d):
return d * math.pi / 180.0

# in miles
def distance(pt1, pt2):
dLat = deg2rad(pt2[1] - pt1[1])
dLng = abs(deg2rad(pt2[0] - pt1[0]))
dLat2Sin = math.sin(dLat / 2)
dLng2Sin = math.sin(dLng / 2)
a = dLat2Sin*dLat2Sin + math.cos(deg2rad(pt1[1]))*math.cos(deg2rad(pt2[1]))*dLng2Sin*dLng2Sin
return 2.0 * EARTHRADIUS * math.atan2(math.sqrt(a), math.sqrt(1-a))



For most geometries the distance between the ESRI LRS and mine are nominal but this one is different. I've dealt with larger linestrings before (30+ miles) with no issues. Previously these other larger linestrings have worked fine throughout the alignment, however with this edge case I'm getting ~.5 miles difference (my implementation's distances are always larger) between the two implementations by the end.



Is distance calculated a different way via the LRS implementation, is my geometry duplicating previous points possibly, or is it possible coordinate system error is actually sneaking in?



EDIT:



For the ground truth measurement, I'm just hitting a backend ESRI LRS server I think? After playing with the code from this webmap. Basically all I'm doing is iterating through points in the subject linestring, adding my distance implementation to the distance along the line for each point then comparing the two. I did modify the API parameters for the lowest tolerance as I'm using the actually constituent point geometry and the shp's original coordinate system. I have no idea about how the LRS was implemented to be honest, other than the units are miles.



Other Notes



I tried to debug this for quite some time yesterday, I've come to conclusion I don't think its within the distance formula (although possible) more so some abstract set of calibration points that ESRI's LRS is defined by. The road's geometry represents a parallel set of vector for a good portion of it, and apparently some LRS systems use that original centerline to derive the LRS???



On top of that I noticed points are very dense multiple on top of one another (never shooting back though) I think underlying simplification may contribute as well. Also this geometry is about to be changed massively due to construction of a new roadway, so I think a small change to the real feature maybe potentially didn't bubble up to the geometry that the LRS is based on for this roadway. However I am sure I have the most up to date data set as it was dumped just to debug the same issues in ArcDesktop.



The real confirmation of my suspicion is when I dropped the raw shp into Earth Pro with the original CRS and opened up the elevation profile, and it had the same milepoint I did for my debugging landmark. So I feel there dealing with either a simplified or entirely different geometry, which is fun.



Like I said I could be entirely wrong but I tried every distance formula (geodesic, viscinity?, normal, euclidean) I know at the OG projection, and raw 4326 nothing worked. I hope that this will be of use to someone else and if I can I'll hunt up the ESRI documentation talking about abstract LRS systems from a centerline, and post a picture with the earth versus webmap output.



ESRI Doc here



Profile Milepoint from Subject Line (very bottom)



Milepoint Displayed When Using Measure Tool (top right)







arcmap line distance linear-referencing






share|improve this question









New contributor




Charles Murphy is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.











share|improve this question









New contributor




Charles Murphy is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.









share|improve this question




share|improve this question








edited Apr 7 at 22:22







Charles Murphy













New contributor




Charles Murphy is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.









asked Apr 7 at 0:39









Charles MurphyCharles Murphy

11




11




New contributor




Charles Murphy is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.





New contributor





Charles Murphy is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.






Charles Murphy is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.












  • Where is your line here? You are measuring length between 2 points.

    – FelixIP
    Apr 7 at 1:16






  • 1





    Most distances in are computed according to used-requested parameters. Without knowing how you performed the measurement, it's difficult to determine how far off your spherical measurement will be from the proper spheroidal calculation.

    – Vince
    Apr 7 at 2:26











  • Please Edit the question to add information. Comments are present in SE to ask for clarification.

    – Vince
    Apr 7 at 13:52

















  • Where is your line here? You are measuring length between 2 points.

    – FelixIP
    Apr 7 at 1:16






  • 1





    Most distances in are computed according to used-requested parameters. Without knowing how you performed the measurement, it's difficult to determine how far off your spherical measurement will be from the proper spheroidal calculation.

    – Vince
    Apr 7 at 2:26











  • Please Edit the question to add information. Comments are present in SE to ask for clarification.

    – Vince
    Apr 7 at 13:52
















Where is your line here? You are measuring length between 2 points.

– FelixIP
Apr 7 at 1:16





Where is your line here? You are measuring length between 2 points.

– FelixIP
Apr 7 at 1:16




1




1





Most distances in are computed according to used-requested parameters. Without knowing how you performed the measurement, it's difficult to determine how far off your spherical measurement will be from the proper spheroidal calculation.

– Vince
Apr 7 at 2:26





Most distances in are computed according to used-requested parameters. Without knowing how you performed the measurement, it's difficult to determine how far off your spherical measurement will be from the proper spheroidal calculation.

– Vince
Apr 7 at 2:26













Please Edit the question to add information. Comments are present in SE to ask for clarification.

– Vince
Apr 7 at 13:52





Please Edit the question to add information. Comments are present in SE to ask for clarification.

– Vince
Apr 7 at 13:52










0






active

oldest

votes












Your Answer








StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "79"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);

else
createEditor();

);

function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: false,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: null,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);



);






Charles Murphy is a new contributor. Be nice, and check out our Code of Conduct.









draft saved

draft discarded


















StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fgis.stackexchange.com%2fquestions%2f318000%2fhow-is-the-lrs-arcgis-measure-along-a-line-implemented%23new-answer', 'question_page');

);

Post as a guest















Required, but never shown

























0






active

oldest

votes








0






active

oldest

votes









active

oldest

votes






active

oldest

votes








Charles Murphy is a new contributor. Be nice, and check out our Code of Conduct.









draft saved

draft discarded


















Charles Murphy is a new contributor. Be nice, and check out our Code of Conduct.












Charles Murphy is a new contributor. Be nice, and check out our Code of Conduct.











Charles Murphy is a new contributor. Be nice, and check out our Code of Conduct.














Thanks for contributing an answer to Geographic Information Systems Stack Exchange!


  • Please be sure to answer the question. Provide details and share your research!

But avoid


  • Asking for help, clarification, or responding to other answers.

  • Making statements based on opinion; back them up with references or personal experience.

To learn more, see our tips on writing great answers.




draft saved


draft discarded














StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fgis.stackexchange.com%2fquestions%2f318000%2fhow-is-the-lrs-arcgis-measure-along-a-line-implemented%23new-answer', 'question_page');

);

Post as a guest















Required, but never shown





















































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown

































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown







Popular posts from this blog

Crop image to path created in TikZ? Announcing the arrival of Valued Associate #679: Cesar Manara Planned maintenance scheduled April 17/18, 2019 at 00:00UTC (8:00pm US/Eastern)Crop an inserted image?TikZ pictures does not appear in posterImage behind and beyond crop marks?Tikz picture as large as possible on A4 PageTransparency vs image compression dilemmaHow to crop background from image automatically?Image does not cropTikzexternal capturing crop marks when externalizing pgfplots?How to include image path that contains a dollar signCrop image with left size given

រឿង រ៉ូមេអូ និង ហ្ស៊ុយលីយេ សង្ខេបរឿង តួអង្គ បញ្ជីណែនាំ

Ромео және Джульетта Мазмұны Қысқаша сипаттамасы Кейіпкерлері Кино Дереккөздер Бағыттау мәзірі