[postgis-users] Coordinate transformation withcustomrecordsofspatial_sys_ref

DUPREZ Cédric Cedric.DUPREZ at ign.fr
Thu Jul 19 00:22:29 PDT 2012


Thank you for your help.
I have modified the SRIDs of each entry in the IGNF file, by incrementing them from 910001 to 910320.

But now, when I try the conversion with ST_Transform, I get the following error message:

"transform: couldn't project point (556866 1.90234e+06 0): failed to load datum shift file (-38)"
With the following notice: "PostGIS was unable to transform the point because either no grid shift files were found, or the point does not lie within the range for which the grid shift is defined. Refer to the ST_Transform() section of the PostGIS manual for details on how to configure PostGIS to alter this behaviour."

I tried the conversion directly in Proj4 with cs2cs and it works correctly.
This should mean that Proj.4 is build with the grid-shift files, as it is said in the ST_Transform documentation.
Here is the command I execute in Proj4 : cs2cs -I +init=IGNF:LAMBE +to +init=IGNF:LAMB93
Then, giving Lambert II coordinates transform them correctly.
But in Postgis, it does not work.

What am I doing wrong?

Regards,

Cedric



-----Message d'origine-----
De : postgis-users-bounces at postgis.refractions.net [mailto:postgis-users-bounces at postgis.refractions.net] De la part de Robert_Clift at doh.state.fl.us
Envoyé : mardi 17 juillet 2012 14:49
À : postgis-users at postgis.refractions.net
Objet : Re: [postgis-users] Coordinate transformation withcustomrecordsofspatial_sys_ref

One easy way to generate the syntax required to add a custom projection is to select something similar at spatialreference.org and click "PostGIS spatial_ref_sys INSERT statement," then copy and paste into a text or query editor to revise. Blinding flash of the obvious, perhaps, but hope it's helpful to someone.

-Rob

-----Original Message-----
From: postgis-users-bounces at postgis.refractions.net [mailto:postgis-users-bounces at postgis.refractions.net] On Behalf Of Sandro Santilli
Sent: Tuesday, July 17, 2012 5:49 AM
To: DUPREZ Cédric
Cc: PostGIS Users Discussion
Subject: Re: [postgis-users] Coordinate transformation with customrecordsofspatial_sys_ref

On Tue, Jul 17, 2012 at 11:34:46AM +0200, DUPREZ Cédric wrote:

> SELECT AddGeometryColumn('public', 'pts', 'geom', 320002120, 'POINT', 
> 2, false);
> 
> This gives me the following error message: "ERROR: AddGeometryColumn() 
> - SRID must be <= 998999
> 
> How can I use the correct 320002120 SRID specified by French IGN?

Is 320002120 in your spatial_ref_sys already ?
You'll need to assign it a different SRID, the spatial_ref_sys has provision for "auth_srid" so you can put 320002120 in there and use something valid for PostGIS' "srid" field.

Unfortunately we never got around writing a page about SRID ranges in PostGIS manual (contributions welcome!) but the idea is that you put your "custom" entries somewhere from 910000 and below 999000.

--strk;

  ,------o-. 
  |   __/  |    Delivering high quality PostGIS 2.1
  |  / 2.1 |    http://strk.keybit.net - http://vizzuality.com
  `-o------'

_______________________________________________
postgis-users mailing list
postgis-users at postgis.refractions.net
http://postgis.refractions.net/mailman/listinfo/postgis-users
_______________________________________________
postgis-users mailing list
postgis-users at postgis.refractions.net
http://postgis.refractions.net/mailman/listinfo/postgis-users



More information about the postgis-users mailing list