[postgis-users] Rejilla IGN ETRS89 y Postgis

Jose Carlos Martinez jomarlla at cgf.upv.es
Fri May 18 07:31:01 PDT 2012


Hi, to use the grid file in order to transform from ETRS89 to ED50 and 
viceversa you should download the .gsb (PENR2009.gsb in the example) 
file from the IGN web site and copy that file to your proj4 directory.

Then modify the spatial_Ref_sys with (change the utm zone if you need it):

update spatial_ref_sys set proj4text = '+proj=utm +zone=30 +ellps=GRS80 
+units=m +no_defs +nadgrids=null' where srid =25830;
update spatial_ref_sys set proj4text = '+proj=utm +zone=30 +ellps=intl 
+units=m +no_defs +nadgrids=PENR2009.gsb' where srid = 23030;
update spatial_ref_sys set proj4text = '+proj=longlat +ellps=intl 
+units=m nadgrids=PENR2009.gsb +no_defs' where srid = 4230;
update spatial_ref_sys set proj4text = '+proj=longlat +ellps=GRS80 
+towgs84=0,0,0,0,0,0,0 +no_defs' where srid = 4258;

after that you can check it out using:

with tabla (geom) as (
   select st_geomfromtext ('POINT (465348.7823 4473240.8768)',23030)
)
select 'to25830' as crs, st_astext(st_transform (geom, 25830)) from tabla
union all
select 'to4230', st_astext(st_transform (geom, 4230)) from tabla
union all
select 'to4258', st_astext(st_transform (geom, 4258)) from tabla;

and you must get this result:

    crs   |                 st_astext
---------+-------------------------------------------
  to25830 | POINT(465239.372687467 4473032.96844837)
  to4230  | POINT(-3.40836762519858 40.4083676249853)
  to4258  | POINT(-3.40966841871938 40.40718544315)

which means PostGIS is using the ntv2 grid file with CRS: 4258, 4230, 
23030 and 25830.
Regards,
Jose


On 17/05/2012 19:20, José María Amuedo wrote:
> Buenas,
>
> Me gustaría saber si Postgis puede gestionar la información topológica 
> a través de la rejilla elaborada por el IGN y no tener problemas de 
> cálculos de mediciones.
>
> Saludos,
>
> Jose Maria
>
> Hello,
>
> I would like to know if it is possible working with geographic 
> information with spanish ETRS89 projection in Postgis.
>
> Wishes,
>
> Jose Mariai
>
>
> _______________________________________________
> postgis-users mailing list
> postgis-users at postgis.refractions.net
> http://postgis.refractions.net/mailman/listinfo/postgis-users


-- 

------------------------------
José Carlos Martínez Llario

Producción Cartográfica y SIG.
Dpto. Ingeniería Cartográfica.
Univ. Politécnica de Valencia.

E-mail: jomarlla at cgf.upv.es
Telf: 963877000 ext. 75599
------------------------------

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/postgis-users/attachments/20120518/ebc1bd18/attachment.html>


More information about the postgis-users mailing list