[PROJ] Sweref99 Cartesian

Jivall Lotti Lotti.Jivall at lm.se
Wed Apr 20 08:32:20 PDT 2022


Hi Roger, 
I am not sure what you mean by "Sweref99_tm Cartesian values", but I think you mean SWEREF99 geocentric cartesian coordinates (with respect to the centre of the earth and the Z-axis in line with the rotation axis and X-axis through Greenwich). If so you can use the following command: 

echo  21 69  0.000 2022.0 | cct +proj=cart +ellps=GRS80 
which gives :  2140155.9896    821528.9138  5931972.9199     2022.0000

Note that cct is used instead of proj, and then you need also to give an epoch. In this case when just transforming between lat long ellh to X Y Z , it does not matter which epoch you give. But in case you transform from or to a dynamic reference system like ITRF then this epoch is important. Usually you give the epoch of the measurement. 

You can also use the EPSG-codes if you prefer:
echo  69 21  0.000 | cs2cs EPSG:4326 EPSG:4976
with the result: 2140155.99      821528.91 5931972.92
Note that the input latitude and longitude are in different order than for proj and cct!

or use the code for WGS84 (which has the zero-transformation to SWEREF99 in EPSG):
echo  69 21  0.000 | cs2cs EPSG:4326 EPSG:4976
2140155.99      821528.91 5931972.92

In many case you can consider SWEREF99=ETRS89=WGS84, which also is done with the transformation in the EPSG-database. This approximation is OK if you can accept an error up to 1 m. In case you need an accurate transformation (sub-cm) from ITRF2014/WGS84 to SWEREF 99 ( in geocentric cartesian coordinates) you can use the NKG:ITRF2014_TO_SE (implemented in PROJ from version 7.2.1): 

echo  2140155.9896    821528.9138  5931972.9199     2022.0000| cct NKG:ITRF2014_TO_SE
2140156.5941    821528.5956  5931972.5885     2022.0000


Hope it helps!

Best Regards, 

Lotti Jivall
Geodesist

LANTMÄTERIET
EMAIL                  lotti.jivall at lm.se
TELEPHONE       026-63 37 40
MOBILE               072-222 56 14
ADDRESS            Lantmäteriet, Geodetisk infrastruktur, 801 82 Gävle
WEBB                  www.lantmateriet.se
www.linkedin.com/company/lantmateriet
www.facebook.com/lantmateriet
www.instagram.com/lantmateriet


-----Ursprungligt meddelande-----
Från: PROJ <proj-bounces at lists.osgeo.org> För Roger Oberholtzer
Skickat: den 20 april 2022 15:24
Till: PROJ <PROJ at lists.osgeo.org>
Ämne: [PROJ] Sweref99 Cartesian

We have been using proj to get Sweref99_tm (EPSG:3006) from WGS84
(EPSG:4326) values we collect from a GPS receiver. All is working great.

We have had a request to provide Sweref99_tm Cartesian values. I have looked at https://proj.org/operations/conversions/cart.html#cart but I'm unclear how to do this in the context of Sweref99_tm.

If I don't use the EPSG codes, I get the expected Sweref99_tm values with:

proj +proj=tmerc +ellps=GRS80 +k=0.9996 +x_0=500000 +y_0=0 +lon_0=15.0
+lat_0=0.0

Would it just be changing +proj=tmerc to +proj=cart ?

I get values. But I don't know if they are correct.

echo 21.0000000000 69.0000000000 0.000 | proj +proj=tmerc +ellps=GRS80
+k=0.9996 +x_0=500000 +y_0=0 +lon_0=15.0 +lat_0=0.0
739639.19       7666089.70 0.000


echo 21.0000000000 69.0000000000 0.000 | proj +proj=cart +ellps=GRS80
+k=0.9996 +x_0=500000 +y_0=0 +lon_0=15.0 +lat_0=0.0
2279859.27      239622.87 0.000

Also, can this be done when specifying the EPSG:3006 code directly?


--
Roger Oberholtzer
_______________________________________________
PROJ mailing list
PROJ at lists.osgeo.org
https://lists.osgeo.org/mailman/listinfo/proj


More information about the PROJ mailing list