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

580
2
07-21-2011 04:26 PM
SebastianRoberts
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)
0 Kudos
2 Replies
RichardFairhurst
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"
#gp.outputCoordinateSystem = "PROJCS['NAD_1983_StatePlane_California_VI_FIPS_0406_Feet',GEOGCS['GCS_North_American_1983',DATUM['D_North_American_1983',SPHEROID['GRS_1980',6378137.0,298.257222101]],PRIMEM['Greenwich',0.0],UNIT['Degree',0.0174532925199433]],PROJECTION['Lambert_Conformal_Conic'],PARAMETER['False_Easting',6561666.666666666],PARAMETER['False_Northing',1640416.666666667],PARAMETER['Central_Meridian',-116.25],PARAMETER['Standard_Parallel_1',32.78333333333333],PARAMETER['Standard_Parallel_2',33.88333333333333],PARAMETER['Latitude_Of_Origin',32.16666666666666],UNIT['Foot_US',0.3048006096012192]]"
#gp.extent = "6129957.88366199 2098700.9515318 7097398.14694032 2341052.42516121"
gp.MTolerance = "0.001"
gp.MResolution = "0.0001"
#gp.MDomain = "-100000 900719825474.099"

Of course the Extent is specific to my data, but I found all of these work together to get accuracy to 4 decimal places for my M values, which are in Feet.  Leaving the values as Same As Input did not work and caused similar effects to what you are describing.  In my case I also needed the Extent to stay constant othewise I could not append output files together (I build my routes in groups and then append them together to improve performance of the Create Routes tool).
0 Kudos
SebastianRoberts
Occasional Contributor III
Richard,
I did finally resolve this with the help of an Esri support request.  Just as you said, I needed to change the environment settings for the M values to "enabled", and set an M resolution of .0001 and M tolernace of .001. 
   Thanks for your response.  I appologize for not remembering to update my post after resolving it with the help of Esri.
Regards, Sebastian Roberts
0 Kudos