2

I have several layers in PostGIS that use a custom projection. I added the projection SRID and it's definition to the spatial_ref_sys table but, when I load the layer in QGIS, I get the "Coordinate reference System Selector" dialog. Shouldn't QGIS automagically read the proj definitions from the spatial_ref_sys table?

The spatial_ref_sys table is in the public schema and the layers are on a different schema. The custom SRID that I added with code 90001 is:

'PROJCS["Brazil / Albers Equal Area Conic (WGS84)",GEOGCS["WGS 84",DATUM["WGS_1984",SPHEROID["WGS 84",6378137,298.257223563,AUTHORITY["EPSG","7030"]],AUTHORITY["EPSG","6326"]],PRIMEM["Greenwich",0,AUTHORITY["EPSG","8901"]],UNIT["degree",0.01745329251994328,AUTHORITY["EPSG","9122"]],AUTHORITY["EPSG","4326"]],PROJECTION["Albers_Conic_Equal_Area"],PARAMETER["longitude_of_center",-48.5],PARAMETER["standard_parallel_1",-20.5],PARAMETER["standard_parallel_2",-24.5],PARAMETER["latitude_of_center",-25.0],UNIT["Meter",1.0]]'

1 Answer 1

2

QGIS doesn't access spatial_ref_sys. It fetches the EPSG code and tries to look it up in its own CRS database.

Therefore, you will have to add the custom CRS to QGIS too if you want to be able to use it. See How to define new custom projections in QGIS?.

2
  • Thanks, I'll create the custom CRS. Any chance of QGIS linking the SRID from postgis (listed in geoetry_columns table) to my custom CRS. Or do I need to choose the custom CRS each time I load the postgis layer
    – Daniel
    Commented Aug 22, 2012 at 20:51
  • You could try with matching IDs but I haven't tested that yet.
    – underdark
    Commented Aug 22, 2012 at 20:57

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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