Select to view content in your preferred language

Elevation Profile - meters only?

4467
11
Jump to solution
01-22-2013 09:03 AM
DanJensen
Deactivated User
When configuring the Elevation Profile widget for ArcGIS Viewer for Flex 3.x to use feet (rather than meters), the graph's y-axis still shows numbers that are obviously meters even though they are labled as feet.  Does anyone have a solution for this problem?

I have also noticed the distance measurement (x-axis) looks correct but is off slightly, but I am chalking that one up to Web Mercatur.

Thanks,
-Dan
Tags (2)
1 Solution

Accepted Solutions
DanJensen
Deactivated User
I must have downloaded a bad version of the widget.  I had to alter the code in both the elvations function and the consolidateDataForCharts function inside the CharWindow.mxml.  After adding the multiplication necessary to those two functions, I am now getting the correct values for elevation in feet.

View solution in original post

0 Kudos
11 Replies
GISDev1
Deactivated User
When configuring the Elevation Profile widget for ArcGIS Viewer for Flex 3.x to use feet (rather than meters), the graph's y-axis still shows numbers that are obviously meters even though they are labled as feet.  Does anyone have a solution for this problem?

I have also noticed the distance measurement (x-axis) looks correct but is off slightly, but I am chalking that one up to Web Mercatur.

Thanks,
-Dan


Do you have access to the source code or are you working with the compiled version?
0 Kudos
BjornSvensson
Esri Regular Contributor
When configuring the Elevation Profile widget for ArcGIS Viewer for Flex 3.x to use feet (rather than meters), the graph's y-axis still shows numbers that are obviously meters even though they are labled as feet.


What configuration changes did you do?  Just the label or also the multiplyByToConvertFromMeters tag?
0 Kudos
DanJensen
Deactivated User
Do you have access to the source code or are you working with the compiled version?


I do have access to the source code and flash builder.

-Dan
0 Kudos
DanJensen
Deactivated User
What configuration changes did you do?  Just the label or also the multiplyByToConvertFromMeters tag?


I commented out the meters and km section and uncommented the feet and miles section.  The multiplyByToConvertFromMeters tag for the applicable section was already filled in.  See below.

<multiplyByToConvertFromMeters>3.2808399</multiplyByToConvertFromMeters>
0 Kudos
RhettZufelt
MVP Notable Contributor
What version are you using?
I commented out the meters and uncommented the feet so it looked like:

 <unitsAndLabeling>
  <elevation>
   <label>
    <chart>feet</chart>
    <dataTip>ft</dataTip>
   </label>
   <multiplyByToConvertFromMeters>3.2808399</multiplyByToConvertFromMeters>
  </elevation>
  <distanceAlongPath>
   <label>
    <chart>miles</chart>
    <dataTip>mi</dataTip>
   </label>
   <multiplyByToConvertFromMeters>0.000621371192</multiplyByToConvertFromMeters>
  </distanceAlongPath>
 </unitsAndLabeling>


and the values as well as the axis change to feet/miles.

R_
0 Kudos
DanJensen
Deactivated User
R_,

I am using ArcGIS viewer for Flex 3.0.  I just downloaded the widget today and have tried both the 3.0 and 3.1 version, but experienced the same anomaly.  The units are stated as feet and miles but the elevation values are about 1/3.28 what they should be (ie 1600 instead of 5248).  I have the same configuration as you have, but evidently am getting different results.

I changed the multiplyByToConvertFromMeters to 30 to see if I could get a big reaction, but the elevation value is the same no matter what the multiplier is.

Thanks,
-Dan
0 Kudos
RhettZufelt
MVP Notable Contributor
Not sure what to tell you.

I tried it using both the built in ESRI SOE and my own SOE, as well as using my state plane wkid, then also removed that and used the arcgisbasemaps to set my map wkid.

Can not get it to reproduce what you are seeing.

I am using FV3.1.  If I get a chance, I'll see if I can make it happen in 3.0.

R_
0 Kudos
RhettZufelt
MVP Notable Contributor
tried with fv3.0 also.  working as expected.
0 Kudos
DanJensen
Deactivated User
R_,

In looking at the code I get the feeling I am not seeing something.  Here is the elevation function from the ChartWindow.mxml file I downloaded yesterday.  Notice that it takes as input the multiplication factor (nFromMeters).  Also notice the place where nFromMeters is used is commented out.  When I remove the comments and run the widget I get this error:
A problem occurred while parsing and charting the returned elevation data:
Error #1010: A term is undefined and has no properties.

I am curious to know what the code for the Elevations function looks like in your working copy.  Could you post it?

/**
* Given the result set of geometries with z-values, produce a new single-dimensional array
* of elevation values. These will eventually be mixed into the location and distance
* array for display in the chart.
* @param oResult: The result object returned from the call to the elevation SOE.
* @param nFromMeters: Factor to multiply by meters to get desired elevation units
* @return A single-dimensional array of elevation values (order unchanged from the 
* original 2-d array) 
**/
function elevations( oResult:Object, nFromMeters:Number ):Array {
 var aryElevations:Array = new Array();
// for ( var iElevationSet:int = 0; iElevationSet < oResult.elevations.length; iElevationSet++ ) {
//  var aryElevationSet:Array = oResult.elevations[ iElevationSet ];
//  for ( var iElevation:int = 0; iElevation < aryElevationSet.length; iElevation++ ) 
//   aryElevations.push( aryElevationSet[ iElevation ] * nFromMeters );
// }
 // For each geometry returned...
 for ( var iGeom:int = 0; iGeom < oResult.geometries.length; iGeom++ ) {
  var oGeom:Object = oResult.geometries[ iGeom ];
  
  // For each path in each geometry...
  for ( var iPath:int = 0; iPath < oGeom.paths.length; iPath++ ) {
   var aryPath:Array = oGeom.paths[ iPath ];
       
   // For each point in each path...
   for ( var iPt:int = 0; iPt < aryPath.length; iPt++ ) {
    var ptCurrent:Array = aryPath[ iPt ];
    aryElevations.push( ptCurrent[ 2 ] );
   }
  }
 }
 return aryElevations;
}

-Dan
0 Kudos