rolandhill / geoscience

QGIS plugin for geology and exploration. Drill hole desurvey/display and other utilities.
GNU General Public License v3.0
40 stars 11 forks source link

Local Grid transformation not working (feet issue?) #10

Closed landky closed 2 months ago

landky commented 2 years ago

I'm having trouble getting the local grid projection to work. I'm wondering if the tool requires to the input coordinates to be metric, because the points are ending up about x2 as far off to the opposite side. Sorry in advance for being American and still using feet (and "us-feet" at that) :)

x-epsg6597 y-epsg6597 x-local y-local
1263187.502 215893.9240 25665.0016 15680.6409
1263307.439 215889.4943 25785.0016 15678.5953
1263251.740 213087.0128 25785.0016 12875.5953
1263131.732 213087.8976 25665.0016 12874.0953
rolandhill commented 2 years ago

Hi Landky,

I've only tried it on a non-metric grid once and it didn't work. I've used it many times on metric grids and it has always worked OK, so I think that non-metric grids are going to be a problem. I did have a quick look to see if I could make non-metric grids work, but it would take more time than I had available. Sorry to give you bad news!

Regards, Roland

On Fri, 18 Feb 2022 at 13:07, landky @.***> wrote:

I'm having trouble getting the local grid projection to work. I'm wondering if the tool requires to the input coordinates to be metric, because the points are ending up about x2 as far off to the opposite side. Sorry in advance for being American and still using feet (and "us-feet" at that) :) x-epsg6597 y-epsg6597 x-local y-local 1263187.502 215893.9240 25665.0016 15680.6409 1263307.439 215889.4943 25785.0016 15678.5953 1263251.740 213087.0128 25785.0016 12875.5953 1263131.732 213087.8976 25665.0016 12874.0953

— Reply to this email directly, view it on GitHub https://github.com/rolandhill/geoscience/issues/10, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAPOEQZCYYQW65KRORLWYCTU32KHRANCNFSM5OY2AXNQ . You are receiving this because you are subscribed to this thread.Message ID: @.***>

caprieldeluca commented 2 years ago

Hi Landky and Roland,

The transformation parameters are well calculated by the plugin. When calculating from one system to another, the algorithm does not know if they are meters, feet, or any other unit of measure. It only finds the transformation parameters between one system and another. QGIS, recognizing that the original system is in feet, downscales the transformation causing the points to be placed in the wrong place. So in the resulting coordinate system, we must overscale the rotate/scale parameters: A1, A2, B1, B2, by dividing them by 0.304800609601219.

For this particular case, the correct definition would be:

DERIVEDPROJCRS[
  "local_derived_from_6579",
  BASEPROJCRS[
    "NAD83(2011) / Washington North (ftUS)",
    BASEGEOGCRS[
      "NAD83(2011)",
      DATUM[
        "NAD83 (National Spatial Reference System 2011)",
        ELLIPSOID["GRS 1980",6378137,298.257222101,LENGTHUNIT["metre",1]]],
      PRIMEM["Greenwich",0,ANGLEUNIT["degree",0.0174532925199433]],
      ID["EPSG",6318]],
    CONVERSION[
      "SPCS83 Washington North zone (US Survey feet)",
      METHOD[
        "Lambert Conic Conformal (2SP)",ID["EPSG",9802]],
      PARAMETER["Latitude of false origin",47,ANGLEUNIT["degree",0.0174532925199433],ID["EPSG",8821]],
      PARAMETER["Longitude of false origin",-120.833333333333,ANGLEUNIT["degree",0.0174532925199433],ID["EPSG",8822]],
      PARAMETER["Latitude of 1st standard parallel",48.7333333333333,ANGLEUNIT["degree",0.0174532925199433],ID["EPSG",8823]],
      PARAMETER["Latitude of 2nd standard parallel",47.5,ANGLEUNIT["degree",0.0174532925199433],ID["EPSG",8824]],
      PARAMETER["Easting at false origin",1640416.667,LENGTHUNIT["US survey foot",0.304800609601219],ID["EPSG",8826]],
      PARAMETER["Northing at false origin",0,LENGTHUNIT["US survey foot",0.304800609601219],ID["EPSG",8827]]]],
  DERIVINGCONVERSION[
    "Affine",
    METHOD[
      "Affine parametric transformation",ID["EPSG",9624]],
    PARAMETER["A0",-1232967.3553904383,LENGTHUNIT["metre",1],ID["EPSG",8623]],
    PARAMETER["A1",3.280144648,SCALEUNIT["coefficient",1],ID["EPSG",8624]],
    PARAMETER["A2",-0.06519281688,SCALEUNIT["coefficient",1],ID["EPSG",8625]],
    PARAMETER["B0",-225268.52375864593,LENGTHUNIT["metre",1],ID["EPSG",8639]],
    PARAMETER["B1",0.06519281688,SCALEUNIT["coefficient",1],ID["EPSG",8640]],
    PARAMETER["B2",3.280144648,SCALEUNIT["coefficient",1],ID["EPSG",8641]]],
  CS[Cartesian,2],
  AXIS["easting (X)",east,ORDER[1],LENGTHUNIT["US survey foot",0.304800609601219]],
  AXIS["northing (Y)",north,ORDER[2],LENGTHUNIT["US survey foot",0.304800609601219]]]

Regards, Gabriel

rolandhill commented 2 years ago

Thanks, Gabriel. Landky, can you let me know if that works for you. If so, I'll look at incorporating it in the plugin. It might take a while because I'm travelling for work right now.

Regards, Roland

On Fri, 18 Feb 2022 at 19:50, Gabriel De Luca @.***> wrote:

Hi Landky and Roland,

The transformation parameters are well calculated by the plugin. When calculating from one system to another, the algorithm does not know if they are meters, feet, or any other unit of measure. It only finds the transformation parameters between one system and another. QGIS, recognizing that the original system is in feet, downscales the transformation causing the points to be placed in the wrong place. So in the resulting coordinate system, we must overscale the rotate/scale parameters: A1, A2, B1, B2, by dividing them by 0.304800609601219.

For this particular case, the correct definition would be:

DERIVEDPROJCRS[ "local_derived_from_6579", BASEPROJCRS[ "NAD83(2011) / Washington North (ftUS)", BASEGEOGCRS[ "NAD83(2011)", DATUM[ "NAD83 (National Spatial Reference System 2011)", ELLIPSOID["GRS 1980",6378137,298.257222101,LENGTHUNIT["metre",1]]], PRIMEM["Greenwich",0,ANGLEUNIT["degree",0.0174532925199433]], ID["EPSG",6318]], CONVERSION[ "SPCS83 Washington North zone (US Survey feet)", METHOD[ "Lambert Conic Conformal (2SP)",ID["EPSG",9802]], PARAMETER["Latitude of false origin",47,ANGLEUNIT["degree",0.0174532925199433],ID["EPSG",8821]], PARAMETER["Longitude of false origin",-120.833333333333,ANGLEUNIT["degree",0.0174532925199433],ID["EPSG",8822]], PARAMETER["Latitude of 1st standard parallel",48.7333333333333,ANGLEUNIT["degree",0.0174532925199433],ID["EPSG",8823]], PARAMETER["Latitude of 2nd standard parallel",47.5,ANGLEUNIT["degree",0.0174532925199433],ID["EPSG",8824]], PARAMETER["Easting at false origin",1640416.667,LENGTHUNIT["US survey foot",0.304800609601219],ID["EPSG",8826]], PARAMETER["Northing at false origin",0,LENGTHUNIT["US survey foot",0.304800609601219],ID["EPSG",8827]]]], DERIVINGCONVERSION[ "Affine", METHOD[ "Affine parametric transformation",ID["EPSG",9624]], PARAMETER["A0",-1232967.3553904383,LENGTHUNIT["metre",1],ID["EPSG",8623]], PARAMETER["A1",3.280144648,SCALEUNIT["coefficient",1],ID["EPSG",8624]], PARAMETER["A2",-0.06519281688,SCALEUNIT["coefficient",1],ID["EPSG",8625]], PARAMETER["B0",-225268.52375864593,LENGTHUNIT["metre",1],ID["EPSG",8639]], PARAMETER["B1",0.06519281688,SCALEUNIT["coefficient",1],ID["EPSG",8640]], PARAMETER["B2",3.280144648,SCALEUNIT["coefficient",1],ID["EPSG",8641]]], CS[Cartesian,2], AXIS["easting (X)",east,ORDER[1],LENGTHUNIT["US survey foot",0.304800609601219]], AXIS["northing (Y)",north,ORDER[2],LENGTHUNIT["US survey foot",0.304800609601219]]]

Regards, Gabriel

— Reply to this email directly, view it on GitHub https://github.com/rolandhill/geoscience/issues/10#issuecomment-1045535220, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAPOEQYZX5F4NXUUTU5I373U33ZOLANCNFSM5OY2AXNQ . You are receiving this because you commented.Message ID: @.***>

landky commented 2 years ago

Yes that approach of adjusting the A1, A2, B1, and B2 values has done the trick.

Now if only these derived projected coordinate reference systems worked with ESRI...

caprieldeluca commented 2 years ago

Roland, About translation parameters (A0 and B0) units of measure or LENGTHUNIT node: is actually set to metre but I guess assumed as feets in QGIS, at least. I tried change it to feet but can't see any difference.

landky, This is the OGC standarized WKT2:2019 definition of the EPSG registered Affine parametric transformation, brought to us thanks to the PROJ, GDAL/OGR and QGIS developers eforts. It is up to ESRI to adjust.

axyzdile commented 1 year ago

https://www.youtube.com/watch?v=TipwIlxZyDw

there's really some problem with transformation. In my case - there is transformation between two "meter's" projections but with different datums and GeogCRS. But the most riddle why section line jump off.

landky commented 3 months ago

Did this meters/feet issue ever get fixed?

rolandhill commented 3 months ago

Hi Landky,

Geoscience now produces the following output for your example. Note that the length units are listed as "feet" as well as the parameters being as Gabriel described.

Look out for version 1.15 to be released in the next couple of days.

Regards, Roland

DERIVEDPROJCRS["MyTestFeet",BASEPROJCRS["NAD83(2011) / Washington North (ftUS)",BASEGEOGCRS["NAD83(2011)",DATUM["NAD83 (National Spatial Reference System 2011)",ELLIPSOID["GRS 1980",6378137,298.257222101,LENGTHUNIT["metre",1]]],PRIMEM["Greenwich",0,ANGLEUNIT["degree",0.0174532925199433]],ID["EPSG",6318]],CONVERSION["SPCS83 Washington North zone (US survey foot)",METHOD["Lambert Conic Conformal (2SP)",ID["EPSG",9802]],PARAMETER["Latitude of false origin",47,ANGLEUNIT["degree",0.0174532925199433],ID["EPSG",8821]],PARAMETER["Longitude of false origin",-120.833333333333,ANGLEUNIT["degree",0.0174532925199433],ID["EPSG",8822]],PARAMETER["Latitude of 1st standard parallel",48.7333333333333,ANGLEUNIT["degree",0.0174532925199433],ID["EPSG",8823]],PARAMETER["Latitude of 2nd standard parallel",47.5,ANGLEUNIT["degree",0.0174532925199433],ID["EPSG",8824]],PARAMETER["Easting at false origin",1640416.667,LENGTHUNIT["US survey foot",0.304800609601219],ID["EPSG",8826]],PARAMETER["Northing at false origin",0,LENGTHUNIT["US survey foot",0.304800609601219],ID["EPSG",8827]]]],DERIVINGCONVERSION["Affine",METHOD["Affine parametric transformation",ID["EPSG",9624]],PARAMETER["A0",-1232967.3555468218,LENGTHUNIT["feet",1],ID["EPSG",8623]],PARAMETER["A1",3.280144648746871,SCALEUNIT["coefficient",1],ID["EPSG",8624]],PARAMETER["A2",-0.06519281688014336,SCALEUNIT["coefficient",1],ID["EPSG",8625]],PARAMETER["B0",-225268.5237861151,LENGTHUNIT["feet",1],ID["EPSG",8639]],PARAMETER["B1",0.06519281688014336,SCALEUNIT["coefficient",1],ID["EPSG",8640]],PARAMETER["B2",3.280144648746871,SCALEUNIT["coefficient",1],ID["EPSG",8641]]],CS[Cartesian,2],AXIS["easting (X)",east,ORDER[1],LENGTHUNIT["US survey foot",0.304800609601219]],AXIS["northing (Y)",north,ORDER[2],LENGTHUNIT["US survey foot",0.304800609601219]]]

rolandhill commented 2 months ago

Fixed in release 1.15