# Linear referencing - measure in miles - measure rounded to nearest integer

838
2
07-21-2011 04:26 PM
Occasional Contributor III
I have a fairly simple application where I want to create a measure system of miles for a subset of our roads.  The route is created correctly with measure units in meters, but when I attempt to use miles, the issue I have is as follows.  I did a test with only one street.  The street and route feature class are in a feature dataset with a state plane projection, units in meters.  I used the default M resolution for the output feature dataset of 0.0001 (also tried 0.00001).  The street is 0.6 miles long.  Using the Create Routes  tool I applied a measure factor of 0.000621371192 (conversion from meters to miles).  The route created has vertices with zero measures where the steet is less than 0.5 miles in length, then vertices with measure values of 1 for vertices where the street is above .5 miles in length. (see attached image). I also tried to add a miles field to the street and reference this when creating the route with the same effect.  How can I keep the measure from being rounded to the nearest integer?
Tags (2)
2 Replies
MVP Honored Contributor
I have a fairly simple application where I want to create a measure system of miles for a subset of our roads.  The route is created correctly with measure units in meters, but when I attempt to use miles, the issue I have is as follows.  I did a test with only one street.  The street and route feature class are in a feature dataset with a state plane projection, units in meters.  I used the default M resolution for the output feature dataset of 0.0001 (also tried 0.00001).  The street is 0.6 miles long.  Using the Create Routes  tool I applied a measure factor of 0.000621371192 (conversion from meters to miles).  The route created has vertices with zero measures where the steet is less than 0.5 miles in length, then vertices with measure values of 1 for vertices where the street is above .5 miles in length. (see attached image). I also tried to add a miles field to the street and reference this when creating the route with the same effect.  How can I keep the measure from being rounded to the nearest integer?

Did you set the Environment Settings of the Create Route tool to match the settings you wanted for the output and double check that the output actually maintained the input M Tolerance, Resolution and Domain?  I find that it is important to set that up in the Environment Settings even if your input has everything correct.  A related item is to set up the XY Domain, Resolution and especially Extent in the Environment Settings since a subselection sometimes overrides the input domain and extent and reduces the accuracy of the length units output or shifts points, which affects the Create Route tool accuracy.  I recommend not relying on the Same As Input environmental setting for cases like this.  Also, you may want to try setting the min resolution Environmental Setting with something like -10000.0001 to force decimal places into the domain.  It took me some experimentation to get the Environmental Settings the way I wanted and I had to play around with both the XY and the M settings to get it to work.

Here are the settings I use in my model to get the output I want:

# Set the Geoprocessing environment...
#gp.XYTolerance = "0.003280833333333 Feet"
#gp.XYResolution = "0.000328083333333 Feet"
#gp.XYDomain = "-118608900 -91259500 2954993346592.94 2955020695992.94"