An SRID (Spatial Reference Identifier) is an integer code that tells a spatial database or GIS which coordinate reference system (CRS) a geometry uses. It links raw coordinate numbers to a defined datum, ellipsoid, and projection so that distances, overlays, and transformations are computed correctly.

Why it matters

In a database like PostGIS, a geometry is just a list of numbers until you know what those numbers mean. The SRID supplies that meaning. If two layers carry different SRIDs, spatial functions will refuse to operate on them together (or, worse, silently give nonsense if the SRID is set to 0 / unknown). Setting the correct SRID is therefore a prerequisite for reliable spatial joins, buffering, and area or distance calculations.

A concrete example

In practice SRIDs almost always match the corresponding EPSG code: SRID 4326 is geographic WGS84 (latitude/longitude in degrees), and SRID 3857 is Web Mercator (meters, used by web basemaps). In PostGIS you might write:

SELECT ST_Area(ST_Transform(geom, 3857))
FROM parcels
WHERE ST_SRID(geom) = 4326;

Here ST_SRID reports the stored identifier, and ST_Transform reprojects to another SRID for an area calculation in meters.

Common pitfall

A frequent mistake is confusing ST_SetSRID with ST_Transform. ST_SetSRID only relabels a geometry's SRID without moving any coordinates — use it to fix metadata when the numbers are already in the right system. ST_Transform actually recomputes the coordinates into a new CRS. Using the first when you needed the second leaves features in the wrong place on the map.

Related reading