Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Get the SRID of a geometry field

Tags:

postgis

I have a table with some geometry types in and need to be able to return the SRID of a given field. How can I do this. I have had a search but all I can find is the function to alter a SRID. In Oracle I am doing this:

A.CLUSTER_EXTENT.SDO_SRID  

Is there an equivalent function in PostGIS?

like image 634
CSharpened Avatar asked Apr 03 '12 14:04

CSharpened


People also ask

How to Get SRID in PostGIS?

The syntax is find_srid(<db/schema>, <table>, <column>) and the function returns the integer SRID of the specified column by searching through the GEOMETRY_COLUMNS table. If the geometry column has not been properly added with the AddGeometryColumns() function, this function will not work either.

What is Srid in geometry?

A spatial reference identifier (SRID) is a unique identifier associated with a specific coordinate system, tolerance, and resolution.

What is Srid in SQL?

Each spatial instance has a spatial reference identifier (SRID). The SRID corresponds to a spatial reference system based on the specific ellipsoid used for either flat-earth mapping or round-earth mapping. A spatial column can contain objects with different SRIDs.

What does Srid 0 mean?

SRID of 0 doesn't technically exist, it just means no SRID — ie, the default if you forget to set it. Zero is a valid SRID, your PostGIS configurations will set for some default value, that in a fresh installation will be WGS84, srid 4326 .


1 Answers

ST_SRID will give you the SRID of a single geometry. Use Find_SRID for getting the SRID of a column.

like image 123
javcek Avatar answered Nov 22 '22 05:11

javcek



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!