Select to view content in your preferred language

GeometryToStation giving CannotFindLocation error

745
5
02-27-2025 01:29 AM
MirekGroen
Occasional Contributor

Hi Community,

We started using an event point layer with stationing fields enabled, so we would be able to use the stationToGeometry and geometryToStation services. These are, however, not working as expected.

This is what we tried so far:

  • We added a point event layer with stationing fields enabled. The Station field contains the value as found on km-posts, the BackStation field contains the value of the previous Station, the StationDirection field is empty. The station values are increasing with increasing measure on the routes.
  • We appended the events to the station event layer, all resulting in NO ERROR:
    MirekGroen_0-1740647503403.png

     


    MirekGroen_1-1740647512515.png
  • This example shows 2 routes (0=60=1 and 0=60=2) that got stationing points, here showing 128+0100 till 128+0301 station values
  • After appending the Station events, I can confirm that the events got m-values.

We can use geometryToMeasure, which is giving the expected results:

MirekGroen_2-1740647842172.png

If I use the same input geometry for geometryToStation it is giving me a CannotFindLocation error, while I am expecting stationing values on both routes 0=60=1 and 0=60=2, somewhere between 128+0200 and 128+ 0300.

MirekGroen_3-1740648059953.png

I also tried with a reference to a routeId ([{"routeId":"0=60=1","geometry":{"x":545498,"y":6188255}}]) without using a tolerance. But this is giving the same error.

Playing around a bit with different routes, geometry and tolerance values, suddenly I got result:

MirekGroen_4-1740648399751.png

But I cannot reproduce the same result. I am suspecting that are setup might be wrong, but I cannot find in Esri's documentation what we are doing wrong, or how exactly we should use the stationing fields.

I hope there is anyone out there that could help solving this issue. If something is unclear in the explanation of our workflow, please let me know.

Thanks in advance,
Mirek

 

 

 

 

0 Kudos
5 Replies
NathanEasley
Esri Regular Contributor

Hi Mirek,

I'd recommend opening up a support case with Esri technical support.

Nathan
ArcGIS Roads and Highways team

0 Kudos
AyanPalit
Esri Regular Contributor

@MirekGroen Reviewing the REST API documentation, I noticed the 'z' is included in the query.

 

https://sampleserver/arcgis/rest/services/MyLRS/MapServer/exts/LRServer/eventLayers/1/geometryToStation?f=json&locations=[{"routeId":"I90","geometry":{"x":-8479115,"y":5326520,"z":5}}]&tolerance=50&inSR=102100

 

Give it a try by adding "z":0

REF: https://developers.arcgis.com/rest/services-reference/enterprise/lr-geometry-to-station/ 

Ayan Palit | Principal Consultant Esri
0 Kudos
MirekGroen
Occasional Contributor

@AyanPalit I forgot to mention that I also tried with z included. Unfortunatlely, it makes no difference.

0 Kudos
AyanPalit
Esri Regular Contributor

Ok, if the REST syntax is correct, the issue is more fundamental. Likely how the point event layer with stationing fields was enabled. Using the snapshot provided, please explain the highlighted attributes, how are they related? I am unsure if the measure attribute is correct.

AyanPalit_0-1740697848172.png

 

Ayan Palit | Principal Consultant Esri
0 Kudos
MirekGroen
Occasional Contributor

Hi @AyanPalit,

Our LRS is based on already existing data. What we are trying to do here is to append already existing phisical km posts out in the field with a certain km+m value, that is not equal to the LRS measure value. Let me explain the steps we took to prepare and append the events.

  1. We have a point feature class with an attribute RouteId and Km+m values. First we calculate the Measure on the corresponding route by using the .queryPointAndDistance() function in a Python script. The result of that query gives a GeometryPoint on the route containing our desired m-value, which is 40107.14 m. When I compare our input km-post point feature and the measure point on the route, I can confirm that we got the correct measure.
  2. The Station value is corresponding to our value on the km post. Note that we use 4 zeros for the meter element, because it is possible that there is more than 1000 m between a km post and the following one.
  3. The BackStation field is the one that I am not quite sure about how to use. As far as I understood, this field should contain the Station value of the previous stationing point on the route. So here I gave it the value of the Station before the current.
    ! I also tried the stationToGeometry service with <Null> values for BackStation, but this does not help.

I hope this clarifies!

Mirek

 

0 Kudos