2

For point I use OpenLayers and transform():

 numZona = Math.ceil(parseFloat(lon)/6));
 Proj4js.defs["EPSG:28406"] = '+proj=tmerc +lat_0=0 +lon_0='(parseInt(numZona)*6-3)+' +k=1.000000 +x_0='+numZona+'500000 +y_0=0 +ellps=krass +units=m +no_defs;
 centerPoint = new OpenLayers.Geometry.Point(lon, lat).transform(new OpenLayers.Projection("EPSG:4284"), new OpenLayers.Projection("EPSG:900913"));

But what do with distance? I have longitude and latitude in EPSG:4284, distanse in meters and a map with EPSG:900913 projection.

  • 1
    What you want to do? Why you want to get a distance in 900913? – Jorge Sanz Jan 14 '15 at 10:46
  • 2
    Side note: if the false easting is 500000, that's EPSG:2496 instead (EPSG:28406 has a false easting of 6500000). – mkennedy Jan 14 '15 at 17:51
  • @JorgeSanz Calculating a new position in a map using OpenLayers:900913? – mkennedy Jan 14 '15 at 17:52
  • So you want from a position, azimuth and real world distance to locate a new point, all in represented in 900913? – Jorge Sanz Jan 16 '15 at 8:38
  • @JorgeSanz Yes! – mswatermelon Jan 18 '15 at 18:22
1

So you what you want to do is the direct problem, I'd do all your calculations in your projected system or even better, transform it to geodetic coordinates and resolve what is called the direct, or forward, problem and then simply get your new point in 900913.

It all depends then on source projected coordinates and the accuracy you are looking for. For example in UTM you have to take in account the anamorphosis coefficient for medium to large distances. That's why maybe solving the direct problem on the spheroid (4326) is more accurate. You can look for some JavaScript code for the inverse and direct problems here.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.