Take the 2-minute tour ×
Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. It's 100% free, no registration required.

using

SELECT Find_SRID('public', 'myTable', 'myColumn');

I get zero as the result, what does it mean?

Regards,

share|improve this question
1  
Could you show how you created the geometry? Just cut-n-paste the exact text. –  BradHards Dec 4 '12 at 8:34
    
i'm not creating it, it's already in the DB, i just need to figure out the correct SRID of these geometries. thanks –  Kourosh Dec 4 '12 at 8:36
3  
My guess is you're choosing the wrong column, or the column wasn't built correctly. However you need to tell us more. Can you run "\d myTable" in the psql console? –  BradHards Dec 4 '12 at 8:40
    
the column is "geom - geometry(MultiPolygon)" –  Kourosh Dec 4 '12 at 8:45
add comment

1 Answer 1

up vote 3 down vote accepted

From Postgis doc:

The syntax is find_srid(, , ) 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.

So you shoud have a row in GEOMETRY_COLUMNS table for F_TABLE_SCHEMA 'public', F_TABLE_NAME 'mytable' and F_GEOMETRY_COLUMN 'mycolumn' where the SRID is 0. You can update this row with the correct SRID.

share|improve this answer
    
Juan, this means I need to remove the current geometry column and create a new one? is it possible to fix the current column? thanks –  Kourosh Dec 4 '12 at 10:19
1  
You don't need to remove the current geometry column. Just update the GEOMETRY_COLUMN entry with the actual SRID or if no entry in that table exists, insert a new row with your geometry column data (schema, table name, column name, srid, geometry type). It will help if you post the ouput of "\d myTable" in the psql console as @BradHards suggested. –  juanluisrp Dec 4 '12 at 10:50
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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