How to apply an affine transformation?

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

How to apply an affine transformation?

Assumpcio Termens
Hello to all,

I'm a new user of PROJ library. I have to apply a transformation from EPSG:23031 to EPSG:25831. The parametrization of the datum transformation is an affine 2D transformation which has to be applied directly to UTM coordinates. This parametrization is very useful in CAD environments, but I don't know how to use in cs2cs or in GDAL/OGR library.

Can I use this type of transformation in "cs2cs"?
Which options have to put in the comand line?
Or which files have to be modified?

Thank you very much,

Assumpció Termens
Geoprocess Department
ICC


_______________________________________________
Proj mailing list
[hidden email]
http://lists.maptools.org/mailman/listinfo/proj
Reply | Threaded
Open this post in threaded view
|

Re: How to apply an affine transformation?

José Alberto Gonçalves
Hello

I think there is no way of doing direct transformations between two
cartographic coordinate systems (affine or other polynomial) with
program CS2CS.
Using command awk (unix/linux but also available for windows) you can
do something like:

awk '{print $1*A+$2*B+E,$1*C+$2*D+F}' < input_file.txt > output_file.txt

where A,B,C,D,E and F are the parameters of your affine
transformation. The input file must be a text file with Easting and
Northing separated by space or tab, in the same way you would give to
program CS2CS.

If you really want to use CS2CS (or GDAL/OGR programs) you can create
a datum shift grid file (GSB extension), with longitude and latitude
differences, agreeing with the 2D direct affine transformation.
There is the spanish grid file SPED2ETV2.gsb, which is available with
the GVSIG software (and ArcGIS 9.3), which should do the conversion
for all Spain with an accuracy of some 10 or 20 cm. Isn't it very
close to your direct affine transformation?

Regards

José Gonçalves


2010/1/11 Assumpcio Termens <[hidden email]>:

> Hello to all,
>
> I'm a new user of PROJ library. I have to apply a transformation from
> EPSG:23031 to EPSG:25831. The parametrization of the datum transformation is
> an affine 2D transformation which has to be applied directly to UTM
> coordinates. This parametrization is very useful in CAD environments, but I
> don't know how to use in cs2cs or in GDAL/OGR library.
>
> Can I use this type of transformation in "cs2cs"?
> Which options have to put in the comand line?
> Or which files have to be modified?
>
> Thank you very much,
>
> Assumpció Termens
> Geoprocess Department
> ICC
>
>
> _______________________________________________
> Proj mailing list
> [hidden email]
> http://lists.maptools.org/mailman/listinfo/proj
>
_______________________________________________
Proj mailing list
[hidden email]
http://lists.maptools.org/mailman/listinfo/proj
Reply | Threaded
Open this post in threaded view
|

Re: How to apply an affine transformation?

Assumpcio Termens
Thank you very much for your answer,

Generate a NTv2 grid was the first idea to apply, but I try to find if a direct application would be possible and avoid datum shift files.

Thanks also for the information about the Spanish datum shift, I know it. But in Catalonia -I'm working at the cartograhic agency for the local government- we have our local datum transformation that it is more accurate than Spanish one...

Best regards,

Assumpció.

2010/1/11 Jose Gonçalves <[hidden email]>
Hello

I think there is no way of doing direct transformations between two
cartographic coordinate systems (affine or other polynomial) with
program CS2CS.
Using command awk (unix/linux but also available for windows) you can
do something like:

awk '{print $1*A+$2*B+E,$1*C+$2*D+F}' < input_file.txt > output_file.txt

where A,B,C,D,E and F are the parameters of your affine
transformation. The input file must be a text file with Easting and
Northing separated by space or tab, in the same way you would give to
program CS2CS.

If you really want to use CS2CS (or GDAL/OGR programs) you can create
a datum shift grid file (GSB extension), with longitude and latitude
differences, agreeing with the 2D direct affine transformation.
There is the spanish grid file SPED2ETV2.gsb, which is available with
the GVSIG software (and ArcGIS 9.3), which should do the conversion
for all Spain with an accuracy of some 10 or 20 cm. Isn't it very
close to your direct affine transformation?

Regards

José Gonçalves


2010/1/11 Assumpcio Termens <[hidden email]>:
> Hello to all,
>
> I'm a new user of PROJ library. I have to apply a transformation from
> EPSG:23031 to EPSG:25831. The parametrization of the datum transformation is
> an affine 2D transformation which has to be applied directly to UTM
> coordinates. This parametrization is very useful in CAD environments, but I
> don't know how to use in cs2cs or in GDAL/OGR library.
>
> Can I use this type of transformation in "cs2cs"?
> Which options have to put in the comand line?
> Or which files have to be modified?
>
> Thank you very much,
>
> Assumpció Termens
> Geoprocess Department
> ICC
>
>
> _______________________________________________
> Proj mailing list
> [hidden email]
> http://lists.maptools.org/mailman/listinfo/proj
>


_______________________________________________
Proj mailing list
[hidden email]
http://lists.maptools.org/mailman/listinfo/proj
Reply | Threaded
Open this post in threaded view
|

Re: How to apply an affine transformation?

hamish-2
Assumpcio Termens wrote:
> Generate a NTv2 grid was the first idea to apply, but I try
> to find if a direct application would be possible and avoid
> datum shift files.

perhaps this could help:

"v.transform - Performs an affine transformation (shift, scale
and rotate, or GPCs) on vector map."

http://grass.osgeo.org/grass64/manuals/html64_user/v.transform.html


the help page indicates that similar transforms are available
in PostGIS and R-statistics.


Hamish



     
_______________________________________________
Proj mailing list
[hidden email]
http://lists.maptools.org/mailman/listinfo/proj