Which SRID should I use for my application and how?

I am using PostgreSQL with PostGIS. All my data is already bound to the lat / long decimal system (i.e. -87.34554 33.12321), but for using PostGIS I need to convert it to a specific type of SRID. Most of my queries look for data in a certain radius.

Which SRID should I use? I already created a geometrical column with SRID 4269. In this example: the link text the author converts SRID 4269 to SRID 32661. I am very confused about how and when to use these SRIDs. Any backlash on this issue will be appreciated.

+7
source share
2 answers

As long as you never intend to reprogram / convert the data into another coordinate system, it is technically not important what you use. However, assuming that you do not want to throw away important metadata and want to convert it, you want your assigned srid to match the data, so postgis knows what to do when the time comes.

So why do you want to reprogram from epsg: 4269? The answer lies in the fact that certain types of queries (for example, distance) do not make sense in this "undeveloped" world. Your units are in decimal degrees, and a direct measurement of x decimal degrees is another real distance, depending on where you are on the planet.

In the example above, someone uses epsg: 32661 , because they believe that this will give them better accuracy for whether they work in. If your data is in a specific area of ​​the globe, you can choose a projection that is accurate for that area. If it covers the whole globe, you need to choose a projection that is β€œgood” for your needs.

Now, fortunately, PostGIS has several ways to make it all easier. For approximate distances, you can simply use the st_distance_sphere function, which, as you can guess, assumes that the earth is a sphere. Or more accurate st_distance_spheroid. Using them, you do not need to reprogram, and you will probably be fine on your remote requests, except in cases with an edge. Later versions of PostGIS also allow the use of geography columns.

tl; dr - use st_distance_spheroid for your distance requests, save your data in geography columns or convert them to a local projection (when stored or on the fly, depending on your needs).

+6
source

Take a look at this question: How do you know which SRID should be used for the shp file?

SRID is just a way to store WKT inside the database (you might notice that if you store lat / long points, the preferred storage is a long string with numbers and uppercase letters).

SRID or EPSG may vary for country / state / ... although there are some very common ones, especially 2 mentioned by you. If you need specific information about which area uses that SRID, there is a database for processing .

Inside your database, there is a spatial_ref_sys table that has information that the PostGIS SRID knows.

+1
source

All Articles