"Stadin, Benjamin" <[email protected]> writes:
> I indeed need to express distances in meters. This is a sinusoidal > grid with Varying cell resolutions, matching the length of web > mercator tiles at the equator. I could use any value greater or equal > to the defined sphere radius, but not smaller. To be consistent, it > should be equal. Things to keep in mind: WGS84 is an ellipsoid, not a sphere. There is a radius and flattening, or alternatively different equatorial and polar radii. "Web Mercator" or "Spherical Mercator" is not actually Mercator, and is not conformal. It projects by assuming a sphere, which isn't true. So trying to use one radius to get distances on the surface from projected coordinates is not going to work well. So if you want the right answers, use proj.4, use real WGS84 coordinates, and use the geodesic functions. If you need fast math within a local region, I would suggest computing a few correct values (a point, offset in easting, offest in northing) by going from projected back to geodetic and then calculate geodesics, finding out the ratio of distance to projected coords, and then building a local approximation function. But if you aren't having CPU pain from doing it right, I would just use proj.4.
signature.asc
Description: PGP signature
_______________________________________________ dev mailing list [email protected] https://lists.openstreetmap.org/listinfo/dev

