Is there any method or a way to calculate the elevation from ground (height) from latitude & longitude.
I need to pass the correct altitude to Air Plane model.
right now using steps are :
1) i am getting height in feet so i converted the altitude from feet to meters i.e. (3000 * 0.3048);
2) i pass the calculated meter height to model than it shows higher than i accepted by its actual height.
3) so , i need to pass the Actual height by minus the ground difference of map or the Elevation of point.
so, the my problem is i am using the default bing api maps.
i seen the terrain provider way to get the height of terrain but the problem is that i am not using any terrain provider.
i have to do by using bing map or default way , don't need any terrain or not by the default (stk terrain by AGI).
so please anyone help me out from this, thank you.
//adding first time model to viewer
------------------------------------------------------------
var longitude,latitude,altitudeCode,timestamp,heading;
altitudeCode = (altitudeCode * 0.3048);
var start = Cesium.JulianDate.fromDate(new Date(timestamp * 1000));
var time = Cesium.JulianDate.addSeconds(start, 0, new Cesium.JulianDate());
var property = new Cesium.SampledPositionProperty();
property.forwardExtrapolationType = Cesium.ExtrapolationType.HOLD;
var position = Cesium.Cartesian3.fromDegrees(longitude, latitude, altitudeCode);
property.addSample(time, position);
var orientationProperty = new Cesium.SampledProperty(Cesium.Quaternion);
orientationProperty.forwardExtrapolationType = Cesium.ExtrapolationType.HOLD;
orientationProperty.addSample(start, new Cesium.Transforms.headingPitchRollQuaternion(position, Cesium.Math.toRadians(heading), 0, 0));
var entity = viewer.entities.add({
name: flightName,
id: flightName,
position: property,
orientation: orientationProperty,
show: true,
path: {
resolution: 1,
material: Cesium.Color.ORANGE,
width: 2
//leadTime: 5000,
//trailTime: 1000,
//show: true,
},
model: {
uri: aircraftsModalURL,
minimumPixelSize: 45,
scale: scale
}
});
entity.position.setInterpolationOptions({
interpolationDegree: 2,
interpolationAlgorithm: Cesium.LinearApproximation
});
//second time when the next new coords data
----------------------------------------------------------------
var entityName, getEntity,
entitiesArr = viewer.entities.values;
var property = getEntity.position;
property.numberOfDerivatives = 0;
curralt = (curralt * 0.3048);
var position = Cesium.Cartesian3.fromDegrees(currlong, currlat, curralt);
property.addSample(time, position);
getEntity.position = property
var orientationEntity = getEntity.orientation;
orientationEntity.addSample(Cesium.JulianDate.fromDate( new Date(lasttimespan * 1000), new Cesium.JulianDate),
new Cesium.Transforms.headingPitchRollQuaternion(position, (Cesium.Math.toRadians(currheading)), 0, 0)
);
getEntity.orientation = orientationEntity;
this is it
i just give you the code where i add the next new coords and creating the model.
you can add the object variable a value.
Help me out..
-------------------------------------------------------------------
I know my code is right but my data also is right, i checked myself from every resource. its coming from the raspberry pie.
The height which makes me to think wrong was that is my plane is on landing position but the height is shown higher from their landing. if i pass the height in meters after subtracting the elevation of point its shown properly.
the height which i was getting its in feet (sea level height).
regards,
$anjeev