2

I'd like to convert the following for updating my spatial_ref_sys table.

PROJCS["USA_Contiguous_Albers_Equal_Area_Conic_USGS_version",GEOGCS["GCS_North_American_1983",DATUM["D_North_American_1983",SPHEROID["GRS_1980",6378137.0,298.257222101]],PRIMEM["Greenwich",0.0],UNIT["Degree",0.0174532925199433]],PROJECTION["Albers"],PARAMETER["False_Easting",0.0],PARAMETER["False_Northing",0.0],PARAMETER["Central_Meridian",-96.0],PARAMETER["Standard_Parallel_1",29.5],PARAMETER["Standard_Parallel_2",45.5],PARAMETER["Latitude_Of_Origin",23.0],UNIT["Meter",1.0]]

The matching spatialreference.org/ref/sr-org/6703 link for this item seems to come up blank. Also, tried gdalsrsinfo but it errored with ERROR 6: No translation for Albers to PROJ.4 format is known.

How do I translate the above for that field? Any other tools to get a full, proper INSERT statement for inserting the proper data into spatial_ref_sys?

UPDATE: The above data comes from the 2 PRJ files found in http://www.america2050.org/maps/, third link to the ZIP files. I would like to import these maps into my database to run queries against some data.

6
  • could you use spatialreference.org/ref/epsg/2163 instead?
    – Ian Turton
    Commented Jan 5, 2015 at 16:03
  • I don't have enough experience with GIS to make that call. On what basis do we determine equality between two specifications?
    – alphadogg
    Commented Jan 5, 2015 at 16:11
  • one is a standard and the other is user submitted? compare the numbers? may be you need to edit your question to give us some more clues and background
    – Ian Turton
    Commented Jan 5, 2015 at 16:13
  • I would love to supply more info, but not sure what would be informative. I added the link to where the data came from. Anything else I can supply?
    – alphadogg
    Commented Jan 5, 2015 at 16:21
  • 1
    The one you have was originally defined by Esri. EPSG::5070 is equivalent (except for the names) @iant Spatialreference.org's 2163 isn't equivalent. It uses Lambert azimuthal equal area instead.
    – mkennedy
    Commented Jan 5, 2015 at 16:49

3 Answers 3

2

When I open those files in QGis the srs is epsg:5070 - and the boundaries seem to be in the right place (when compared to a known good 4326 states file).

enter image description here

1
  • It seems like prj2epsg.org coughs up 5070 too.
    – alphadogg
    Commented Jan 5, 2015 at 17:13
1

The projection is officially known as EPSG:5070 and included in the EPSG registry and the latest GDAL builds since version 1.9. It is not included in spatialreference.org, because that site has been lacking care for some time.

SR-ORG:6703 is not an official code that GDAL or PROJ.4 will know.

You can run gdalsrsinfo epsg:5070 and it returns:

PROJ.4 : '+proj=aea +lat_1=29.5 +lat_2=45.5 +lat_0=23 +lon_0=-96 +x_0=0 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs '

OGC WKT :
PROJCS["NAD83 / Conus Albers",
    GEOGCS["NAD83",
        DATUM["North_American_Datum_1983",
            SPHEROID["GRS 1980",6378137,298.257222101,
                AUTHORITY["EPSG","7019"]],
            TOWGS84[0,0,0,0,0,0,0],
            AUTHORITY["EPSG","6269"]],
        PRIMEM["Greenwich",0,
            AUTHORITY["EPSG","8901"]],
        UNIT["degree",0.0174532925199433,
            AUTHORITY["EPSG","9122"]],
        AUTHORITY["EPSG","4269"]],
    PROJECTION["Albers_Conic_Equal_Area"],
    PARAMETER["standard_parallel_1",29.5],
    PARAMETER["standard_parallel_2",45.5],
    PARAMETER["latitude_of_center",23],
    PARAMETER["longitude_of_center",-96],
    PARAMETER["false_easting",0],
    PARAMETER["false_northing",0],
    UNIT["metre",1,
        AUTHORITY["EPSG","9001"]],
    AXIS["X",EAST],
    AXIS["Y",NORTH],
    AUTHORITY["EPSG","5070"]]

The reason why your first attempt fails is because ESRI names the projection Albers, and PROJ.4 does not know that it is the same as Albers_Conic_Equal_Area.

If you want to build shapefiles from your Postgis database, I suggest to use the OGC WKT naming, not the ESRI one. Otherwise someone else will run into the same trouble as you.

2
  • How or where does one learn how to write a valid SRText or PROJ4TEXT for a custom CRS with custom SRID?
    – jayarjo
    Commented Nov 9, 2020 at 9:28
  • 1
    Take a valid CRS defined by EPSG with the same projection, run gdalsrsinfo on it and study the parameters. Then just exchange the parameter values to get your custom CRS correctly.
    – AndreJ
    Commented Nov 13, 2020 at 10:27
0

The proj4txt unofficially seems to be "+proj=aea +lon_0=-96 +lat_0=23 +lat_1=29.5 +lat_2=45.5 +datum=NAD83" gathered from this link. For any future websurfer, here's the insert query I used:

INSERT into public.spatial_ref_sys (
srid, auth_name, auth_srid, proj4text, srtext
) 
VALUES ( 
95070, 
'<insert an identifier>', 
95070, 
'+proj=aea +lon_0=-96 +lat_0=23 +lat_1=29.5 +lat_2=45.5 +datum=NAD83', 
'PROJCS["USA_Contiguous_Albers_Equal_Area_Conic_USGS_version",GEOGCS["GCS_North_American_1983",DATUM["D_North_American_1983",SPHEROID["GRS_1980",6378137.0,298.257222101]],PRIMEM["Greenwich",0.0],UNIT["Degree",0.0174532925199433]],PROJECTION["Albers"],PARAMETER["False_Easting",0.0],PARAMETER["False_Northing",0.0],PARAMETER["Central_Meridian",-96.0],PARAMETER["Standard_Parallel_1",29.5],PARAMETER["Standard_Parallel_2",45.5],PARAMETER["Latitude_Of_Origin",23.0],UNIT["Meter",1.0]]'
);

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.