[postgis-users] Coordinate transformation with custom records of spatial_sys_ref

DUPREZ Cédric Cedric.DUPREZ at ign.fr
Fri Jun 29 06:45:47 PDT 2012


Hi all list members,

I am facing a problem with coordinate transformation, using ST_Transform() function.

First of all, my PostGIS version is 2.0.1 : POSTGIS="2.0.1 r9979" GEOS="3.3.5-CAPI-1.7.5" PROJ="Rel. 4.8.0, 6 March 2012" GDAL="GDAL 1.9.1, released 2012/05/15" LIBXML="2.7.6" LIBJSON="UNKNOWN" TOPOLOGY RASTER

Here are the steps to reproduce the problem:
1/ Create a table containing points
CREATE TABLE pts (
	code INT,
	xl2 INT,
	yl2 INT,
	geom GEOMETRY,
	CONSTRAINT pts_pkey PRIMARY KEY (code)
)
WITHOUT oids;

INSERT INTO pts (code, xl2, yl2)
VALUES (1, 556866, 1902345)
, (2, 689174, 2448195)
, (3, 729095, 2528577)
, (4, 335755, 2059702)
, (5, 623207, 2210468)
, (6, 850337, 1871486)
, (7, 915275, 1889534)
, (8, 639551, 1778327)
, (9, 584365, 2273523)
, (10, 649599, 2228833);

2/ Import the custom records of spatial_sys_ref specified by the French IGN. The file is provided here: http://lambert93.ign.fr/fileadmin/files/IGNF-spatial_ref_sys.sql

3/ Populate the geom column:
UPDATE pts
SET geom = ST_SetSRID(ST_MakePoint(xl2, yl2), 320002120);
I get the following notices: NOTICE:  SRID value 320002120 > SRID_MAXIMUM converted to 999442

SELECT DISTINCT ST_SRID(geom)
FROM pts;
Gives: 999442

But SELECT * FROM geometry_columns;
Gives: 0

4/ Update geometry SRID:
SELECT UpdateGeometrySRID('pts', 'geom', 320002120);

SELECT * FROM geometry_columns;
Gives: 999442

5/ Try the transformation from 320002120 SRID (Lambert II) to 310024140 SRID (Lambert 93):
SELECT code, ST_Transform(geom, 310024140)
FROM pts;
I get the following error message: Invalid reserved SRID (999442).

With PostGIS 1.5.3, this worked perfectly, without any error message and gave the good coordinate transformation.

What should I change with PostGIS 2.0.1 in order to get the same result again?

Thanks in advance for your help.

Regards,

Cedric Duprez



More information about the postgis-users mailing list