[postgis-users] Additional EPSG codes in spatial_ref_sys.sql
Frank Warmerdam
warmerdam at pobox.com
Thu Jul 29 10:48:42 PDT 2004
Kralidis,Tom [Burlington] wrote:
> Hi,
>
> I have a PostGIS running as per documentation. I want to support the
> additional EPSG codes as defined by the 42xxx block as well as ESRI
> extensions, however they are not defined in the spatial_ref_sys table:
>
> devgeo=# select * from spatial_ref_sys where srid=4326;
> srid | auth_name | auth_srid |
> srtext
> | proj4text
> ------+-----------+-----------+-----------------------------------------
> ------------------------------------------------------------------------
> ------------
> --------------------+-----------------------------------------
> 4326 | EPSG | 4326 |
> GEOGCS["GCS_WGS_1984",DATUM["D_WGS_1984",SPHEROID["WGS_1984",6378137,298
> .257223563]],PRIMEM["Greenwich",0],UNIT["Degree",0.0
> 17453292519943295]] | +proj=longlat +ellps=WGS84 +datum=WGS84
> (1 row)
>
> devgeo=# select * from spatial_ref_sys where srid=42304;
> srid | auth_name | auth_srid | srtext | proj4text
> ------+-----------+-----------+--------+-----------
> (0 rows)
>
> devgeo=#
>
> The proj file which has these is at:
>
> http://dl1.maptools.org/dl/proj4-epsg-with-42xxx-and-esri.zip
>
> Is there a patch to this on the postgis side?
Tom,
There is a script in the GDAL distribution that can be used to generate
PostGIS spatial reference system entries.
For example:
~/gdal/pymod/epsg_tr.py -postgis -list ~/gdal/data/esri_extra.wkt
BEGIN;
---
--- EPSG 37001 : GCS_WGS_1966
---
INSERT INTO "spatial_ref_sys" ("srid","auth_name","auth_srid","srtext","proj4tex
t") VALUES (37001,'EPSG',37001,'GEOGCS["GCS_WGS_1966",DATUM["WGS_1966",SPHEROID[
"WGS_1966",6378145,298.25]],PRIMEM["Greenwich",0],UNIT["Degree",0.01745329251994
3295],AUTHORITY["EPSG","37001"]]','+proj=longlat +ellps=WGS66 +no_defs ');
...
This should make it pretty easy to generate your own additions. This is
same script (with slightly different options .. ie. -proj4) that is used
to generate the various dictionary files for PROJ.4.
Best regards,
--
---------------------------------------+--------------------------------------
I set the clouds in motion - turn up | Frank Warmerdam, warmerdam at pobox.com
light and sound - activate the windows | http://pobox.com/~warmerdam
and watch the world go round - Rush | Geospatial Programmer for Rent
More information about the postgis-users
mailing list