New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Database: register NZGD2000 -> ITRF96 transformation for NZGD2000 database #2248
Conversation
CC @ccrook |
Works well also using the CRS names instead of their codes
|
@rouault Thanks - that is very cool. The final step in most NZ transformations will be to convert to/from current ITRF realisations, which will need to use the ITRF96-ITRFxxxx transformations used in NZ (which for historical reasons are the same as the NGA transformations but different from IERS). These are defined explicitly in EPSG, eg coordinate transformation EPSG:9082. Is there a way of encouraging PROJ to use them. |
Normally, PROJ has logic to infer the concatenations of existing steps, but this didn't work here for a reason I wasn't courageous enough to explore. And if it had worked automatically, there would have been a risk for it to use the worldwide ITRF96 <--> ITRFxx transformations rather than the NZ ones. So I've created manually records in the concatenated_operation table to be explicit. When submitting to EPSG, you'll probably want to submit them too. So now the following works:
|
…abase Related to OSGeo/PROJ-data#22 An entry is added in the ``other_transformation`` table, using a raw PROJ string. Later, once the deformation model has been registered in EPSG, we'll have to add code to map the EPSG transformation method and parameters to +proj=defmodel In the meantime, this works pretty well: ``` $ src/projinfo -s EPSG:4959 -t EPSG:7907 Candidate operations found: 1 ------------------------------------- Operation No. 1: PROJ:NZGD2000-20180701, NZGD2000 to ITRF96 deformation model, unknown accuracy, New Zealand PROJ string: +proj=pipeline +step +proj=unitconvert +xy_in=deg +xy_out=rad +step +proj=axisswap +order=2,1 +step +proj=defmodel +model=nz_linz_nzgd2000-20180701.json +step +proj=axisswap +order=2,1 +step +proj=unitconvert +xy_in=rad +xy_out=deg WKT2:2019 string: COORDINATEOPERATION["NZGD2000 to ITRF96 deformation model", VERSION["20180701"], SOURCECRS[ GEOGCRS["NZGD2000", DATUM["New Zealand Geodetic Datum 2000", ELLIPSOID["GRS 1980",6378137,298.257222101, LENGTHUNIT["metre",1]]], PRIMEM["Greenwich",0, ANGLEUNIT["degree",0.0174532925199433]], CS[ellipsoidal,3], AXIS["geodetic latitude (Lat)",north, ORDER[1], ANGLEUNIT["degree",0.0174532925199433]], AXIS["geodetic longitude (Lon)",east, ORDER[2], ANGLEUNIT["degree",0.0174532925199433]], AXIS["ellipsoidal height (h)",up, ORDER[3], LENGTHUNIT["metre",1]], ID["EPSG",4959]]], TARGETCRS[ GEOGCRS["ITRF96", DATUM["International Terrestrial Reference Frame 1996", ELLIPSOID["GRS 1980",6378137,298.257222101, LENGTHUNIT["metre",1]]], PRIMEM["Greenwich",0, ANGLEUNIT["degree",0.0174532925199433]], CS[ellipsoidal,3], AXIS["geodetic latitude (Lat)",north, ORDER[1], ANGLEUNIT["degree",0.0174532925199433]], AXIS["geodetic longitude (Lon)",east, ORDER[2], ANGLEUNIT["degree",0.0174532925199433]], AXIS["ellipsoidal height (h)",up, ORDER[3], LENGTHUNIT["metre",1]], ID["EPSG",7907]]], METHOD["PROJ-based operation method: +proj=pipeline +step +proj=unitconvert +xy_in=deg +xy_out=rad +step +proj=axisswap +order=2,1 +step +proj=defmodel +model=nz_linz_nzgd2000-20180701.json +step +proj=axisswap +order=2,1 +step +proj=unitconvert +xy_in=rad +xy_out=deg"], USAGE[ SCOPE["unknown"], AREA["New Zealand"], BBOX[-55.95,160.6,-25.88,-171.2]], ID["PROJ","NZGD2000-20180701"], REMARK["New Zealand Deformation Model. Defines the secular model (National Deformation Model) and patches for significant deformation events since 2000"]] ``` ``` $ echo "-41 173 0 2016.5" | PROJ_NETWORK=ON src/cct -d 8 +proj=pipeline +step +proj=unitconvert +xy_in=deg +xy_out=rad +step +proj=axisswap +order=2,1 +step +proj=defmodel +model=nz_linz_nzgd2000-20180701.json +step +proj=axisswap +order=2,1 +step +proj=unitconvert +xy_in=rad +xy_out=deg -40.99999402 172.99999938 0.00130333 2016.5000 ``` ``` $ echo "-41 173 0 2016.5" | PROJ_NETWORK=ON src/cs2cs -f "%.8f" EPSG:4959 EPSG:7907 -40.99999402 172.99999938 0.00130333 2016.5 ```
26a6b4c
to
ad9efb1
Compare
@ccrook Do the definitions & results of the concatenated operations look good to you ? |
@ccrook Gentle ping w.r.t above question |
Hi Even. This looks great - really cool. I have checked all the test results and they exactly match the LINZ coordinate conversion software. I am trying to add this to a .gie for the NZGD2000 ITRF conversions, I tried
which was read, but it failed to convert coordinates, ie
But I haven't been able to make this work yet. Can you see what is wrong with this? I hadn't seen the pipline step init inv step init before until I started grepping the gie files in the PROJ test files - very straightforward. Can I use the codes NZGD2000 etc in gie using a format like this. It didn't seem to work when I just replaced eg epsg:4959 with NZGD2000. |
This won't work for your purposes. This uses the legacy init=epsg:XXXX syntax that expands CRS to proj.4 strings. This can only work for simple things, like projected CRS that have one single towgs84 transformation. Not for NZGD2000 transformation. We would perhaps need something emulating cs2cs syntax, but that doesn't exist yet in gie. Your best option currently would probably be to add a new test in test/cli/testvarious , which uses cs2cs, and update test/cli/tv_out.dist. But just thinking this would require the grids to be available, so would be more complicated than that, since we don't want them to depend on the network, so you'd have to add those which would be needed in data/tests/ |
Related to OSGeo/PROJ-data#22
An entry is added in the
other_transformation
table, using a raw PROJstring. Later, once the deformation model has been registered in EPSG, we'll
have to add code to map the EPSG transformation method and parameters to
+proj=defmodel
In the meantime, this works pretty well: