Hi guys!
In my ActionScript project I use the org.openscales.geometry classes:
var dp:ProjProjection = new ProjProjection("EPSG:4326");
var point0:org.openscales.geometry.Point = new org.openscales.geometry.Point(71.2087, 45.2714, dp);
var point1:org.openscales.geometry.Point = new org.openscales.geometry.Point(66.39, 42.3739, dp);
Using postgis functions I obtained the distance between both points:
select st_distance_spheroid(
'SRID=4326;POINT(71.2087 45.2714)'::geometry,
'SRID=4326;POINT(66.39 42.3739)'::geometry,
'SPHEROID["WGS 84",6378137,298.257223563]') AS d;
503730.75294813 (meters) = 503kms
*************************
Then I've tried this calculation in ACTION SCRIPT:
var dist:Number = point0.distanceTo(point1)
This gives me this value: 5.622755
How can I convert this value ¿degress? to meters???
I've tried this code, because I understood that 1 DEGREE is equals to 111.11 Kms.
dist = point0.distanceTo(point1) * 111.11;
This gives me this value: 624.744 This is wrong!!!!!
Finally I've tried this code:
dist = point0.distanceTo(point1) / 111.11;
This gives me this value: 1524123 This is wrong!!!!!
How can I get a right distance between two geometries (two points, one point and a linestring,....) in OPENSCALES?
thanks!!!!!