[PROJ] PROJ 6.0.0 cs2cs: cannot instantiate source coordinate system - program abnormally terminated

Sebastiaan Couwenberg sebastic at xs4all.nl
Fri Mar 8 09:39:30 PST 2019


On 3/8/19 6:17 PM, Even Rouault wrote:
> On vendredi 8 mars 2019 16:28:07 CET Sebastiaan Couwenberg wrote:
>> The cs2cs tests in the proj-rdnap package [0] fail with PROJ 6.0.0:
>>
>>  Rel. 6.0.0, March 1st, 2019
>>  <cs2cs>:
>>  cannot initialize transformation
>>  cause: (null)
>>  program abnormally terminated
>>
>> The problem seems to be the minimal epsg file in PROJ_LIB, removing is
>> works around the issue.
>>
>> Should cs2cs really terminate abnormally when an problematic init file
>> is present in PROJ_LIB?
> 
> Actually, this is rather subtle. The issue is that the definition of epsg:4258 
> in the minimum epsg file is interpretated as a Geographic 2D CRS, whereas 
> rdnap:rdnap is interpretated as as CompoundCRS (horizontal + vertical). 
> Normally the code that computes the possible transformation paths would find a 
> Geographic 3D CRS that corresponds to the Geographic 2D CRS, but in the case 
> of a '+proj=longlat +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +no_defs' definition, 
> there's no single such 3D CRS. So no transformation path is returned at all.
> 
> When using the EPSG:4258 definition from proj.db, then the EPSG:4937 (ETRS89 
> 3D) is used internally.

So if I understand correctly, the abnormal termination is expected and
not a bug.

Having updated the RDNAP test script for PROJ 6.0.0, all test test still
fail because the output for the transformation exceeds the threshold.

Are these large differences expected too when using PROJ 6.0.0?

The attached log file has the verbose output of the test script with
cs2cs input, output & expected values.

Kind Regards,

Bas

-- 
 GPG Key ID: 4096R/6750F10AE88D4AF1
Fingerprint: 8182 DE41 7056 408D 6146  50D1 6750 F10A E88D 4AF1
-------------- next part --------------
Using PROJ_LIB: .:/usr/share/proj
PROJ version: 6.0.0
Renaming: epsg to: epsg.bak

Direction: From ETRS89 to RD/NAP

Test:   01 Texel
Exec:   cs2cs -r +init=epsg:4258 +to +init=rdnap:rdnap -f %.4f
Input:  53.160753042 4.824761912 42.8614
Output: 117355.9718	574917.6038 42.8614
Expect: 117380.1200	575040.3400 1.0000
x coordinate exceeds 0.001 meters: 24.148199999996
y coordinate exceeds 0.001 meters: 122.736199999927
NAP exceeds 0.001 meters: 41.8614
Test FAILED: From ETRS89 to RD/NAP - 01 Texel

Test:   02 Noord-Groningen
Exec:   cs2cs -r +init=epsg:4258 +to +init=rdnap:rdnap -f %.4f
Input:  53.419482050 6.776726674 42.3586
Output: 247340.4033	604453.3972 42.3586
Expect: 247380.5600	604580.7800 2.0000
x coordinate exceeds 0.001 meters: 40.1566999999923
y coordinate exceeds 0.001 meters: 127.382800000021
NAP exceeds 0.001 meters: 40.3586
Test FAILED: From ETRS89 to RD/NAP - 02 Noord-Groningen

Test:   03 Amersfoort
Exec:   cs2cs -r +init=epsg:4258 +to +init=rdnap:rdnap -f %.4f
Input:  52.155172897 5.387203657 43.2551
Output: 154970.2190	462890.1257 43.2551
Expect: 155000.0000	463000.0000 0.0000
x coordinate exceeds 0.001 meters: 29.7809999999881
y coordinate exceeds 0.001 meters: 109.874300000025
NAP exceeds 0.001 meters: 43.2551
Test FAILED: From ETRS89 to RD/NAP - 03 Amersfoort

Test:   04 Zeeuws-Vlaanderen
Exec:   cs2cs -r +init=epsg:4258 +to +init=rdnap:rdnap -f %.4f
Input:  51.368607152 3.397588595 47.4024
Output: 16447.8832	377281.4575 47.4024
Expect: 16460.9100	377380.2300 3.0000
x coordinate exceeds 0.001 meters: 13.0267999999996
y coordinate exceeds 0.001 meters: 98.7724999999627
NAP exceeds 0.001 meters: 44.4024
Test FAILED: From ETRS89 to RD/NAP - 04 Zeeuws-Vlaanderen

Test:   05 Zuid-Limburg
Exec:   cs2cs -r +init=epsg:4258 +to +init=rdnap:rdnap -f %.4f
Input:  50.792584908 5.773795547 174.9478
Output: 182225.9086	311388.1617 174.9478
Expect: 182260.4500	311480.6700 129.000
x coordinate exceeds 0.001 meters: 34.5414000000164
y coordinate exceeds 0.001 meters: 92.5082999999868
NAP exceeds 0.001 meters: 45.9478
Test FAILED: From ETRS89 to RD/NAP - 05 Zuid-Limburg

Test:   06 Maasvlakte
Exec:   cs2cs -r +init=epsg:4258 +to +init=rdnap:rdnap -f %.4f
Input:  51.947393898 4.072887101 47.5968
Output: 64622.1560	440593.3895 47.5968
Expect: 64640.8900	440700.0101 4.0000
x coordinate exceeds 0.001 meters: 18.7339999999967
y coordinate exceeds 0.001 meters: 106.620600000024
NAP exceeds 0.001 meters: 43.5968
Test FAILED: From ETRS89 to RD/NAP - 06 Maasvlakte

Test:   07 No_rd&geoid
Exec:   cs2cs -r +init=epsg:4258 +to +init=rdnap:rdnap -f %.4f
Input:  50.687420405 4.608971812
Output: 99976.4029	299910.4844 0.0000
Expect: 100000.6700	300000.8900
x coordinate exceeds 0.001 meters: 24.2670999999973
y coordinate exceeds 0.001 meters: 90.4055999999982
Test FAILED: From ETRS89 to RD/NAP - 07 No_rd&geoid (Expected output overriden: *	* ^-?(\d+\.\d+|inf)$)

Test:   08 No_geoid
Exec:   cs2cs -r +init=epsg:4258 +to +init=rdnap:rdnap -f %.4f
Input:  51.136825197 4.601375361
Output: 99976.7908	349904.6309 0.0000
Expect: 100000.6700	350000.8900
x coordinate exceeds 0.001 meters: 23.8791999999958
y coordinate exceeds 0.001 meters: 96.2591000000248
Test FAILED: From ETRS89 to RD/NAP - 08 No_geoid (Expected output overriden: *	* ^-?(\d+\.\d+|inf)$)

Test:   09 No_rd
Exec:   cs2cs -r +init=epsg:4258 +to +init=rdnap:rdnap -f %.4f
Input:  52.482440839 4.268403889
Output: 78980.0233	499886.5665 0.0000
Expect: 79000.0100	500000.2300
x coordinate exceeds 0.001 meters: 19.986699999994
y coordinate exceeds 0.001 meters: 113.663499999966
Test FAILED: From ETRS89 to RD/NAP - 09 No_rd (Expected output overriden: *	* ^-?(\d+\.\d+|inf)$)

Test:   10 edge_rd
Exec:   cs2cs -r +init=epsg:4258 +to +init=rdnap:rdnap -f %.4f
Input:  51.003976532 3.891247830
Output: 49982.7244	335905.4579 0.0000
Expect: 50000.4500	335999.6700
x coordinate exceeds 0.001 meters: 17.7255999999979
y coordinate exceeds 0.001 meters: 94.2121000000043
Test OK: From ETRS89 to RD/NAP - 10 edge_rd (Not identical, but margin ignored)

Direction: From RD/NAP to ETRS89

Test:   01 Texel
Exec:   cs2cs -s +init=rdnap:rdnap +to +init=epsg:4258 -f %.9f
Input:  117380.1200 575040.3400 1.0000
Output: 53.161857694	4.825108648 1.000000000
Expect: 53.160753042	4.824761912 42.8614
Latitude exceeds 1e-08 degrees: 0.0011046519999951
Longitude exceeds 1e-08 degrees: 0.000346736000000014
Height exceeds 0.001 meters: 41.8614
Test FAILED: From RD/NAP to ETRS89 - 01 Texel

Test:   02 Noord-Groningen
Exec:   cs2cs -s +init=rdnap:rdnap +to +init=epsg:4258 -f %.9f
Input:  247380.5600 604580.7800 2.0000
Output: 53.420619464	6.777367597 2.000000000
Expect: 53.419482050	6.776726674 42.3586
Latitude exceeds 1e-08 degrees: 0.00113741399999867
Longitude exceeds 1e-08 degrees: 0.000640922999999738
Height exceeds 0.001 meters: 40.3586
Test FAILED: From RD/NAP to ETRS89 - 02 Noord-Groningen

Test:   03 Amersfoort
Exec:   cs2cs -s +init=rdnap:rdnap +to +init=epsg:4258 -f %.9f
Input:  155000.0000 463000.0000 0.0000
Output: 52.156160556	5.387638889 0.000000000
Expect: 52.155172897	5.387203657 43.2551
Latitude exceeds 1e-08 degrees: 0.000987659000003305
Longitude exceeds 1e-08 degrees: 0.000435232000000063
Height exceeds 0.001 meters: 43.2551
Test FAILED: From RD/NAP to ETRS89 - 03 Amersfoort

Test:   04 Zeeuws-Vlaanderen
Exec:   cs2cs -s +init=rdnap:rdnap +to +init=epsg:4258 -f %.9f
Input:  16460.9100 377380.2300 3.0000
Output: 51.369497855	3.397736904 3.000000000
Expect: 51.368607152	3.397588595 47.4024
Latitude exceeds 1e-08 degrees: 0.000890702999996051
Longitude exceeds 1e-08 degrees: 0.000148308999999625
Height exceeds 0.001 meters: 44.4024
Test FAILED: From RD/NAP to ETRS89 - 04 Zeeuws-Vlaanderen

Test:   05 Zuid-Limburg
Exec:   cs2cs -s +init=rdnap:rdnap +to +init=epsg:4258 -f %.9f
Input:  182260.4500 311480.6700 129.000
Output: 50.793414886	5.774292379 129.000000000
Expect: 50.792584908	5.773795547 174.9478
Latitude exceeds 1e-08 degrees: 0.000829977999998732
Longitude exceeds 1e-08 degrees: 0.000496832000000502
Height exceeds 0.001 meters: 45.9478
Test FAILED: From RD/NAP to ETRS89 - 05 Zuid-Limburg

Test:   06 Maasvlakte
Exec:   cs2cs -s +init=rdnap:rdnap +to +init=epsg:4258 -f %.9f
Input:  64640.8900 440700.0101 4.0000
Output: 51.948355181	4.073131504 4.000000000
Expect: 51.947393898	4.072887101 47.5968
Latitude exceeds 1e-08 degrees: 0.000961282999995206
Longitude exceeds 1e-08 degrees: 0.000244402999999949
Height exceeds 0.001 meters: 43.5968
Test FAILED: From RD/NAP to ETRS89 - 06 Maasvlakte

Test:   07 No_rd&geoid
Exec:   cs2cs -s +init=rdnap:rdnap +to +init=epsg:4258 -f %.9f
Input:  100000.6700 300000.8900
Output: 50.688235387	4.609301611 0.000000000
Expect: 50.687420405	4.608971812
Latitude exceeds 1e-08 degrees: 0.000814982000001407
Longitude exceeds 1e-08 degrees: 0.000329799000000186
Test FAILED: From RD/NAP to ETRS89 - 07 No_rd&geoid (Expected output overriden: *	* ^-?(\d+\.\d+|inf)$)

Test:   08 No_geoid
Exec:   cs2cs -s +init=rdnap:rdnap +to +init=epsg:4258 -f %.9f
Input:  100000.6700 350000.8900
Output: 51.137692794	4.601701761 0.000000000
Expect: 51.136825197	4.601375361
Latitude exceeds 1e-08 degrees: 0.000867597000002718
Longitude exceeds 1e-08 degrees: 0.000326400000000504
Test FAILED: From RD/NAP to ETRS89 - 08 No_geoid (Expected output overriden: *	* ^-?(\d+\.\d+|inf)$)

Test:   09 No_rd
Exec:   cs2cs -s +init=rdnap:rdnap +to +init=epsg:4258 -f %.9f
Input:  79000.0100 500000.2300
Output: 52.483465112	4.268672234 0.000000000
Expect: 52.482440839	4.268403889
Latitude exceeds 1e-08 degrees: 0.00102427299999874
Longitude exceeds 1e-08 degrees: 0.000268345000000281
Test FAILED: From RD/NAP to ETRS89 - 09 No_rd (Expected output overriden: *	* ^-?(\d+\.\d+|inf)$)

Test:   10 edge_rd
Exec:   cs2cs -s +init=rdnap:rdnap +to +init=epsg:4258 -f %.9f
Input:  50000.4500 335999.6700
Output: 51.004826511	3.891472859 0.000000000
Expect: 51.003976532	3.891247830
Latitude exceeds 1e-08 degrees: 0.000849978999994505
Longitude exceeds 1e-08 degrees: 0.000225028999999655
Test OK: From RD/NAP to ETRS89 - 10 edge_rd (Not identical, but margin ignored)


Renaming: epsg.bak to: epsg
make: *** [debian/rules:10: override_dh_auto_test] Error 18


More information about the PROJ mailing list