Note: these pages are no longer maintained

Never the less, much of the information is still relevant.
Beware, however, that some of the command syntax is from older versions, and thus may no longer work as expected.
Also: external links, from external sources, inside these pages may no longer function.



SpatiaLite logo

what's this SRID stuff ? ...
I've never heard this term before now ...

2011 January 28

Previous Slide Table of Contents Next Slide

What's this SRID stuff ? ... I've never heard this term before now ...

Planet Earth is a sphere ... not exactly, planet Earth has an ellipsoidal shape (slightly flattened at poles) ...
oh no, that's absolutely wrong: planet Earth hasn't a geometric regular shape, it actually is a geoid

All the above assertions can be assumed to be true, but at different approximation levels.
Near the Equator differences between a sphere and an ellipsoid are rather slight and quite unnoticeable; but neat both Poles such differences becomes greater and most easily appreciable.
For many practical purposes differences between an ellipsoid and a geoid are very slim: but for long range aircraft navigation (or even worse, for satellite positioning), this is too much simplistic and unacceptably approximate.

lat-long illustration

Anyway, whatsoever could be the real shape of the Earth, position of each point on the planet surface can precisely determined simply measuring two angles: longitude and latitude.
In order to set a complete Spatial Reference System [aka SRS] we can use the Poles and the Equator (which after all are outstanding places by intrinsic astronomic properties): choosing a Prime Meridian on the other side is absolutely conventional: but since many centuries (Britannia rule the waves ...) adopting the Greenwich Meridian is an obvious choice.

Any SRS based on long-lat coordinates is known as a Geographic System. Using a Geographic SRS surely grants you maximum precision and accuracy: but unhappily this fatally implies several undesirable side-effects:
  • paper sheets (and monitor screens) are absolutely flat; they don't look at all like a sphere
  • using angles makes measuring distances and areas really difficult and counter-intuitive.
So since many centuries cartographers invented several (conventional) systems enabling to represent spherical surfaces into a flatten plane: none of them all is the best one.
All them introduce some degree of approximation and deformation: choosing the one or the other implies an absolutely arbitrary and conventional process: a map projection good to represent small Earth's portions can easily be awful when used to represent very wide territories, and vice versa.
We'll quickly examine the UTM [Universal Transverse Mercator] map projection, simply because it's really often used.

UTM projection

UTM projected

Apparently this map projection introduces severe and not acceptable deformations: but when you carefully focus your attention on the narrow central fuse, you'll immediately recognize that UTM allows to get a nearly perfect planar projection of excellent quality.
Anyway all this has a price: the central fuse has to be really narrow (let say, it will span only few degrees on both sides). As the fuse becomes wider, as much more deformations will become stronger and more evident.

UTM Zones

Accordingly to all the above considerations, UTM defines 60 standard zones, each one covering exactly 6 longitude degrees.
Merging together two adjacent fuses (12 degrees) obviously reduces accuracy, but is still acceptable for many practical purposes: exceeding this limit produces really low-quality results, and has to be absolutely avoided.

Attempting to standardize the chaos


During the past two centuries every National State has introduced at least one (and very often, more than one) map projection system and related SRS: the overall result is absolutely chaotic (and really painful to be handled).

Happily, an international standard is widely adopted so to make easier correctly handling map SRS: the European Petroleum Survey Group [EPSG] maintains a huge worldwide dataset of more than 3,700 different entries.
Many of them are nowadays obsolete, and simply play a historical role; many others are only useful in very limited national boundaries.
Anyway, this one is an absolutely impressive collection.
And each single entry within the EPSG dataset is uniquely identified by its numeric ID and descriptive name, so to avoid any possible confusion and ambiguity.

Any Spatial DBMS requires some SRID-value to be specified for each Geometry: but such SRID simply is a Spatial Reference ID, and (hopefully) coincides with the corresponding EPSG ID

Just in order to help you understand better this SRID chaos, this is a quite complete list of SRIDs often used in a (small) Nation such as Italy:

EPSG SRID Name Notes
4326 WGS 84 Geographic [long-lat]; worldwide; used by GPS devices
3003
3004
Monte Mario / Italy zone 1
Monte Mario / Italy zone 2
obsolete (1940) but still commonly used
23032
23033
ED50 / UTM zone 32N
ED50 / UTM zone 33N
superseded and rarely used: European Datum 1950
32632
32633
WGS 84 / UTM zone 32N
WGS 84 / UTM zone 33N
WGS84, adopting the planar UTM projection
25832
25833
ETRS89 / UTM zone 32N
ETRS89 / UTM zone 33N
enhanced evolution of WGS84: official EU standard

And the following examples may help to understand even better:

Town SRID Coordinates
X (longitude) Y (latitude)
Roma 4326 12.483900 41.894740
3003 1789036.071860 4644043.280244
23032 789036.071860 4644043.280244
32632 789022.867800 4643960.982152
25832 789022.867802 4643960.982036
Milano 4326 9.189510 45.464270
3003 1514815.861095 5034638.873050
23032 514815.861095 5034638.873050
32632 514815.171223 5034544.482565
25832 514815.171223 5034544.482445


As you can easily notice:
  • WGS84 [4326] coordinates are expressed in decimal degrees, because this one is a Geographic System directly based on long-lat angles.
  • on the other side any other system adopts coordinates expressed in meters: all them are projected aka planar systems.
  • Y-values look very similar for every planar SRS: that's not surprising, because this value simply represents the distance from the Equator.
  • X-values are more dispersed, because different SRSes adopt different false easting origins: i.e. they place their Prime Meridian in different (conventional) places.
  • Anyway, any UTM-based SRS gives very closely related values, simply because all them share the same UTM zone 32 definition.
  • The (small) differences you can notice about different UTM-based SRSes can be easily explained: UTM zone 32 is always the same, but the underlying ellipsoid changes each time.
    Getting a precise measure for ellipsoid's axes isn't an easy task: and obviously during the time several increasingly better and most accurate estimates has been progressively adopted.
Distance intercurring between
Roma and Milano
SRID Calculated Distance
4326 4.857422
3003 477243.796305
23032 477243.796305
32632 477226.708868
25832 477226.708866
Great Circle 477109.583358
Geodesic 477245.299993


And now we can examine how using different SRSes affects distances:
  • Using WGS84 [4326] geographic, long-lat coordinates we'll actually get a measure corresponding to an angle expressed in decimal degrees. [not so useful, really ...]
  • any other SRS will return a distance measure expressed in meters: anyway, as you can easily notice, figures aren't exactly the same.
  • Great Circle distances are calculated assuming that the Earth is exactly a sphere: and this one obviously is the worst estimate we can get.
  • on the other side Geodesic distances are directly calculated on the reference Ellipsoid.
Conclusion:: Thou shall not have exact measures

But this isn't at all surprising in physical and natural sciences: any measured value is intrinsically affected by errors and approximations.
And any calculated value will be inexorably affected by rounding and truncation artifacts.

So absolutely exact figures simply doesn't exist in the real world: you have to be conscious that you can simply get some more or less approximated value.
But at least, you can take care to properly reduce such approximations in the best possible way.

Previous Slide Table of Contents Next Slide

CC-BY-SA logo Author: Alessandro Furieri a.furieri@lqt.it
This work is licensed under the Attribution-ShareAlike 3.0 Unported (CC BY-SA 3.0) license.

GNU logo Permission is granted to copy, distribute and/or modify this document under the terms of the
GNU Free Documentation License, Version 1.3 or any later version published by the Free Software Foundation;
with no Invariant Sections, no Front-Cover Texts, and no Back-Cover Texts.