47

I'm new to GIS, in PostGIS, and I'm struggling with the SRID concept.

How do you choose a SRID for a database column? This is making me crazy. Why do I need to choose a SRID? What's its meaning?

Picking a SRID is it the same for geometry and geography? Setting a SRID for a geometry field seems senseless, because it should be just on a 2D plane.

When I find lat/lon on the internet or geocoding services, which is the SRID?

Doesn't a lat/lon coordinate make sense without a SRID?

closed as too broad by PolyGeo May 20 '16 at 4:29

Please edit the question to limit it to a specific problem with enough detail to identify an adequate answer. Avoid asking multiple distinct questions at once. See the How to Ask page for help clarifying this question. If this question can be reworded to fit the rules in the help center, please edit the question.

  • Lat/lon still depends on a model of the earth. Typically, when people say lat/lon, the WGS84 reference geoid is assumed, but you can have lat/lon with a different geoid, hence the SRID 4326 that combines these two. – John Powell Jan 22 '15 at 17:26
  • @JohnBarça This question is about SRID in general, its sense (and incredibly there's no other question here focusing on it...), while the other is about the specific choice of both data type and SRID for a DB field in a specific case of use. – bluish Jan 23 '15 at 10:48
42

An SRID is a coordinate system. We're taught in (traditional / Arc) "GIS" to always store your data in a projected coordinate system, because we're going to eventually use some calculation like 'area', so we'd better store our data in a coordinate system that gives us that measurement.

However, PostGIS throws that concept out the window.

Here's a good Q&A started by @tmcw: Why are Data Projections relevant?

Basically, PostGIS opens up the ability to store your data in a single coordinate system such as WGS84 (SRID 4326), and when you need something like Area, Distance, or Length, you use a function to create that column from your data in a projected coordinate system that will give you a local interpretation of your data in units that you want.

So for example, I could store students and schools in PostGIS both in WGS84/SRID:4326. When I want to calculate the distance between students and the schools they attend, I call a distance function on my geometry column, but also wrap a ST_Transform function around the geometry column first to 'project' the data into State Plane CO Central (SRID: 2877). This gives me a column for the distance of each student to their closest school in feet because SRID:2877 is a projected coordinate system that stores data in Feet.

So my recommendation for you would be to store your data in a Geometry (data type) column in SRID 4326 (as oppose to a geography data type which does not support projections / transformations).

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