A fast pseudo-projection can save you time when processing small features

In geodetic (lat/lon) coordinate systems such as EPSG:4326, we can assume that proportions between vertical (N-S) distances are preserved, while horizontal (W-E) distances are strongly distorted, as shown here:



Thus, an area or object which is a perfect square in the real world (let's assume it's a small object) will appear as a rectangle in EPSG:4326. In the geodetic coordinate system, all parallels are as long as the Equator, but we know their true length is approximately:

L = E * cos(lat)

where E is the length of the Equator, so our rectangle (a square in the real world) will have an estimate ratio (height divided by width) of cos(lat).

If we have a large vector layer that consists of many small features (lines or polygons) and we need to perform a geoprocess to each one (such as buffering or some trigonometric computation) we can use a faked projection, which consists in scaling the feature in one of the two axes:

  • Multiply the X (longitude) of each vertex by cos(lat) or
  • Divide the Y (latitude) of each vertex by cos(lat)

Then perform our geoprocess (taking into account that the measure unit will obviously not be the meter) and finally undo the faked projection in the resulting features. Since we are dealing with very small variations in latitude among the different vertices, we can simply choose the latitude of a random vertex to figure out the scale factor.

Results

After comparing the results of this simplified procedure with a proper projection (UTM with ED50 datum), the relevant results are:

  • The features obtained with the simplified procedure differ from the ones obtained with the conventional procedure by 0.1 to 0.5%. This divergence depends on the latitude rather than on the size of the features (up to a certain point, of course).
  • The simplified procedure is about 20 times faster than the proper projection.
  • It must therefore be decided if the resulting error is acceptable or not, considering the advantage in terms of time.

Comments

Popular posts from this blog

Transformación de CANOA (Venezuela) a WGS84 en gvSIG mediante una rejilla que simula el método Molodensky-Badekas

Computing and applying an affine transformation to a vector layer using gvSIG and Quantum GIS