Issue with rectify on rotated raster using R Raster












1















I am trying to rectify a rotated raster using the R Raster package.
Below is the implementation with the mnf_filename being the raster file I'm trying to read.



mnf <- brick(mnf_filename)



Throws the following warning:




This file has a rotation
Support for such files is limited and results of data processing might be wrong. Proceed with caution & consider using the "rectify" function




Running the rectify function
mnf_r <- rectify(mnf)



Throws the following error:




Error in .intersectExtent(x, y, validate = TRUE) :
Objects do not intersect
In addition: Warning messages:
1: In .local(x, ...) : min y larger than max y
2: In .local(x, ...) : min y larger than max y




And when rectifying just one layer in the raster stack like so,
mnf_r <- rectify(subset(mnf, 1)
generates the following error:




Error in validityMethod(object) : invalid extent: ymin >= ymax




I can't tell what's wrong. Below is the output of 'extent(mnf)':



class : Extent



xmin : 720770.2



xmax : 752353



ymin : 4328909



ymax : 4361487



Below is the output of gdalinfo(mnf_filename):



[1] "Driver: GTiff/GeoTIFF"

[2] "Files: X:gcwuAVIRISf150429t01p00r07_refl_hpc18_v1_topo_American_MNF2.tif"
[3] "Size is 701, 1821"

[4] "Coordinate System is:"

[5] "PROJCS["WGS 84 / UTM zone 10N","

[6] " GEOGCS["WGS 84","

[7] " DATUM["WGS_1984","

[8] " SPHEROID["WGS 84",6378137,298.257223563,"

[9] " AUTHORITY["EPSG","7030"]],"

[10] " AUTHORITY["EPSG","6326"]],"

[11] " PRIMEM["Greenwich",0,"

[12] " AUTHORITY["EPSG","8901"]],"

[13] " UNIT["degree",0.0174532925199433,"

[14] " AUTHORITY["EPSG","9122"]],"

[15] " AUTHORITY["EPSG","4326"]],"

[16] " PROJECTION["Transverse_Mercator"],"

[17] " PARAMETER["latitude_of_origin",0],"

[18] " PARAMETER["central_meridian",-123],"

[19] " PARAMETER["scale_factor",0.9996],"

[20] " PARAMETER["false_easting",500000],"

[21] " PARAMETER["false_northing",0],"

[22] " UNIT["metre",1,"

[23] " AUTHORITY["EPSG","9001"]],"

[24] " AXIS["Easting",EAST],"

[25] " AXIS["Northing",NORTH],"

[26] " AUTHORITY["EPSG","32610"]]"

[27] "GeoTransform ="

[28] " 720770.204, 13.16436670051244, -12.27597040459283"

[29] " 4352881.37, -12.27597040459283, -13.16436670051244"

[30] "Metadata:"

[31] " AREA_OR_POINT=Area"

[32] " TIFFTAG_XRESOLUTION=1"

[33] " TIFFTAG_YRESOLUTION=1"

[34] "Image Structure Metadata:"

[35] " INTERLEAVE=BAND"

[36] "Corner Coordinates:"

[37] "Upper Left ( 720770.204, 4352881.370) (120d26'23.54"W, 39d17'49.87"N)"

[38] "Lower Left ( 698415.662, 4328909.058) (120d42'21.35"W, 39d 5'12.32"N)"

[39] "Upper Right ( 729998.425, 4344275.915) (120d20' 9.24"W, 39d13' 2.37"N)"

[40] "Lower Right ( 707643.883, 4320303.603) (120d36' 6.99"W, 39d 0'25.66"N)"

[41] "Center ( 714207.043, 4336592.486) (120d31'15.89"W, 39d 9' 7.89"N)"










share|improve this question



























    1















    I am trying to rectify a rotated raster using the R Raster package.
    Below is the implementation with the mnf_filename being the raster file I'm trying to read.



    mnf <- brick(mnf_filename)



    Throws the following warning:




    This file has a rotation
    Support for such files is limited and results of data processing might be wrong. Proceed with caution & consider using the "rectify" function




    Running the rectify function
    mnf_r <- rectify(mnf)



    Throws the following error:




    Error in .intersectExtent(x, y, validate = TRUE) :
    Objects do not intersect
    In addition: Warning messages:
    1: In .local(x, ...) : min y larger than max y
    2: In .local(x, ...) : min y larger than max y




    And when rectifying just one layer in the raster stack like so,
    mnf_r <- rectify(subset(mnf, 1)
    generates the following error:




    Error in validityMethod(object) : invalid extent: ymin >= ymax




    I can't tell what's wrong. Below is the output of 'extent(mnf)':



    class : Extent



    xmin : 720770.2



    xmax : 752353



    ymin : 4328909



    ymax : 4361487



    Below is the output of gdalinfo(mnf_filename):



    [1] "Driver: GTiff/GeoTIFF"

    [2] "Files: X:gcwuAVIRISf150429t01p00r07_refl_hpc18_v1_topo_American_MNF2.tif"
    [3] "Size is 701, 1821"

    [4] "Coordinate System is:"

    [5] "PROJCS["WGS 84 / UTM zone 10N","

    [6] " GEOGCS["WGS 84","

    [7] " DATUM["WGS_1984","

    [8] " SPHEROID["WGS 84",6378137,298.257223563,"

    [9] " AUTHORITY["EPSG","7030"]],"

    [10] " AUTHORITY["EPSG","6326"]],"

    [11] " PRIMEM["Greenwich",0,"

    [12] " AUTHORITY["EPSG","8901"]],"

    [13] " UNIT["degree",0.0174532925199433,"

    [14] " AUTHORITY["EPSG","9122"]],"

    [15] " AUTHORITY["EPSG","4326"]],"

    [16] " PROJECTION["Transverse_Mercator"],"

    [17] " PARAMETER["latitude_of_origin",0],"

    [18] " PARAMETER["central_meridian",-123],"

    [19] " PARAMETER["scale_factor",0.9996],"

    [20] " PARAMETER["false_easting",500000],"

    [21] " PARAMETER["false_northing",0],"

    [22] " UNIT["metre",1,"

    [23] " AUTHORITY["EPSG","9001"]],"

    [24] " AXIS["Easting",EAST],"

    [25] " AXIS["Northing",NORTH],"

    [26] " AUTHORITY["EPSG","32610"]]"

    [27] "GeoTransform ="

    [28] " 720770.204, 13.16436670051244, -12.27597040459283"

    [29] " 4352881.37, -12.27597040459283, -13.16436670051244"

    [30] "Metadata:"

    [31] " AREA_OR_POINT=Area"

    [32] " TIFFTAG_XRESOLUTION=1"

    [33] " TIFFTAG_YRESOLUTION=1"

    [34] "Image Structure Metadata:"

    [35] " INTERLEAVE=BAND"

    [36] "Corner Coordinates:"

    [37] "Upper Left ( 720770.204, 4352881.370) (120d26'23.54"W, 39d17'49.87"N)"

    [38] "Lower Left ( 698415.662, 4328909.058) (120d42'21.35"W, 39d 5'12.32"N)"

    [39] "Upper Right ( 729998.425, 4344275.915) (120d20' 9.24"W, 39d13' 2.37"N)"

    [40] "Lower Right ( 707643.883, 4320303.603) (120d36' 6.99"W, 39d 0'25.66"N)"

    [41] "Center ( 714207.043, 4336592.486) (120d31'15.89"W, 39d 9' 7.89"N)"










    share|improve this question

























      1












      1








      1








      I am trying to rectify a rotated raster using the R Raster package.
      Below is the implementation with the mnf_filename being the raster file I'm trying to read.



      mnf <- brick(mnf_filename)



      Throws the following warning:




      This file has a rotation
      Support for such files is limited and results of data processing might be wrong. Proceed with caution & consider using the "rectify" function




      Running the rectify function
      mnf_r <- rectify(mnf)



      Throws the following error:




      Error in .intersectExtent(x, y, validate = TRUE) :
      Objects do not intersect
      In addition: Warning messages:
      1: In .local(x, ...) : min y larger than max y
      2: In .local(x, ...) : min y larger than max y




      And when rectifying just one layer in the raster stack like so,
      mnf_r <- rectify(subset(mnf, 1)
      generates the following error:




      Error in validityMethod(object) : invalid extent: ymin >= ymax




      I can't tell what's wrong. Below is the output of 'extent(mnf)':



      class : Extent



      xmin : 720770.2



      xmax : 752353



      ymin : 4328909



      ymax : 4361487



      Below is the output of gdalinfo(mnf_filename):



      [1] "Driver: GTiff/GeoTIFF"

      [2] "Files: X:gcwuAVIRISf150429t01p00r07_refl_hpc18_v1_topo_American_MNF2.tif"
      [3] "Size is 701, 1821"

      [4] "Coordinate System is:"

      [5] "PROJCS["WGS 84 / UTM zone 10N","

      [6] " GEOGCS["WGS 84","

      [7] " DATUM["WGS_1984","

      [8] " SPHEROID["WGS 84",6378137,298.257223563,"

      [9] " AUTHORITY["EPSG","7030"]],"

      [10] " AUTHORITY["EPSG","6326"]],"

      [11] " PRIMEM["Greenwich",0,"

      [12] " AUTHORITY["EPSG","8901"]],"

      [13] " UNIT["degree",0.0174532925199433,"

      [14] " AUTHORITY["EPSG","9122"]],"

      [15] " AUTHORITY["EPSG","4326"]],"

      [16] " PROJECTION["Transverse_Mercator"],"

      [17] " PARAMETER["latitude_of_origin",0],"

      [18] " PARAMETER["central_meridian",-123],"

      [19] " PARAMETER["scale_factor",0.9996],"

      [20] " PARAMETER["false_easting",500000],"

      [21] " PARAMETER["false_northing",0],"

      [22] " UNIT["metre",1,"

      [23] " AUTHORITY["EPSG","9001"]],"

      [24] " AXIS["Easting",EAST],"

      [25] " AXIS["Northing",NORTH],"

      [26] " AUTHORITY["EPSG","32610"]]"

      [27] "GeoTransform ="

      [28] " 720770.204, 13.16436670051244, -12.27597040459283"

      [29] " 4352881.37, -12.27597040459283, -13.16436670051244"

      [30] "Metadata:"

      [31] " AREA_OR_POINT=Area"

      [32] " TIFFTAG_XRESOLUTION=1"

      [33] " TIFFTAG_YRESOLUTION=1"

      [34] "Image Structure Metadata:"

      [35] " INTERLEAVE=BAND"

      [36] "Corner Coordinates:"

      [37] "Upper Left ( 720770.204, 4352881.370) (120d26'23.54"W, 39d17'49.87"N)"

      [38] "Lower Left ( 698415.662, 4328909.058) (120d42'21.35"W, 39d 5'12.32"N)"

      [39] "Upper Right ( 729998.425, 4344275.915) (120d20' 9.24"W, 39d13' 2.37"N)"

      [40] "Lower Right ( 707643.883, 4320303.603) (120d36' 6.99"W, 39d 0'25.66"N)"

      [41] "Center ( 714207.043, 4336592.486) (120d31'15.89"W, 39d 9' 7.89"N)"










      share|improve this question














      I am trying to rectify a rotated raster using the R Raster package.
      Below is the implementation with the mnf_filename being the raster file I'm trying to read.



      mnf <- brick(mnf_filename)



      Throws the following warning:




      This file has a rotation
      Support for such files is limited and results of data processing might be wrong. Proceed with caution & consider using the "rectify" function




      Running the rectify function
      mnf_r <- rectify(mnf)



      Throws the following error:




      Error in .intersectExtent(x, y, validate = TRUE) :
      Objects do not intersect
      In addition: Warning messages:
      1: In .local(x, ...) : min y larger than max y
      2: In .local(x, ...) : min y larger than max y




      And when rectifying just one layer in the raster stack like so,
      mnf_r <- rectify(subset(mnf, 1)
      generates the following error:




      Error in validityMethod(object) : invalid extent: ymin >= ymax




      I can't tell what's wrong. Below is the output of 'extent(mnf)':



      class : Extent



      xmin : 720770.2



      xmax : 752353



      ymin : 4328909



      ymax : 4361487



      Below is the output of gdalinfo(mnf_filename):



      [1] "Driver: GTiff/GeoTIFF"

      [2] "Files: X:gcwuAVIRISf150429t01p00r07_refl_hpc18_v1_topo_American_MNF2.tif"
      [3] "Size is 701, 1821"

      [4] "Coordinate System is:"

      [5] "PROJCS["WGS 84 / UTM zone 10N","

      [6] " GEOGCS["WGS 84","

      [7] " DATUM["WGS_1984","

      [8] " SPHEROID["WGS 84",6378137,298.257223563,"

      [9] " AUTHORITY["EPSG","7030"]],"

      [10] " AUTHORITY["EPSG","6326"]],"

      [11] " PRIMEM["Greenwich",0,"

      [12] " AUTHORITY["EPSG","8901"]],"

      [13] " UNIT["degree",0.0174532925199433,"

      [14] " AUTHORITY["EPSG","9122"]],"

      [15] " AUTHORITY["EPSG","4326"]],"

      [16] " PROJECTION["Transverse_Mercator"],"

      [17] " PARAMETER["latitude_of_origin",0],"

      [18] " PARAMETER["central_meridian",-123],"

      [19] " PARAMETER["scale_factor",0.9996],"

      [20] " PARAMETER["false_easting",500000],"

      [21] " PARAMETER["false_northing",0],"

      [22] " UNIT["metre",1,"

      [23] " AUTHORITY["EPSG","9001"]],"

      [24] " AXIS["Easting",EAST],"

      [25] " AXIS["Northing",NORTH],"

      [26] " AUTHORITY["EPSG","32610"]]"

      [27] "GeoTransform ="

      [28] " 720770.204, 13.16436670051244, -12.27597040459283"

      [29] " 4352881.37, -12.27597040459283, -13.16436670051244"

      [30] "Metadata:"

      [31] " AREA_OR_POINT=Area"

      [32] " TIFFTAG_XRESOLUTION=1"

      [33] " TIFFTAG_YRESOLUTION=1"

      [34] "Image Structure Metadata:"

      [35] " INTERLEAVE=BAND"

      [36] "Corner Coordinates:"

      [37] "Upper Left ( 720770.204, 4352881.370) (120d26'23.54"W, 39d17'49.87"N)"

      [38] "Lower Left ( 698415.662, 4328909.058) (120d42'21.35"W, 39d 5'12.32"N)"

      [39] "Upper Right ( 729998.425, 4344275.915) (120d20' 9.24"W, 39d13' 2.37"N)"

      [40] "Lower Right ( 707643.883, 4320303.603) (120d36' 6.99"W, 39d 0'25.66"N)"

      [41] "Center ( 714207.043, 4336592.486) (120d31'15.89"W, 39d 9' 7.89"N)"







      r raster image-rotation r-raster






      share|improve this question













      share|improve this question











      share|improve this question




      share|improve this question










      asked Nov 27 '18 at 20:45









      gcwgcw

      61




      61
























          0






          active

          oldest

          votes











          Your Answer






          StackExchange.ifUsing("editor", function () {
          StackExchange.using("externalEditor", function () {
          StackExchange.using("snippets", function () {
          StackExchange.snippets.init();
          });
          });
          }, "code-snippets");

          StackExchange.ready(function() {
          var channelOptions = {
          tags: "".split(" "),
          id: "1"
          };
          initTagRenderer("".split(" "), "".split(" "), channelOptions);

          StackExchange.using("externalEditor", function() {
          // Have to fire editor after snippets, if snippets enabled
          if (StackExchange.settings.snippets.snippetsEnabled) {
          StackExchange.using("snippets", function() {
          createEditor();
          });
          }
          else {
          createEditor();
          }
          });

          function createEditor() {
          StackExchange.prepareEditor({
          heartbeatType: 'answer',
          autoActivateHeartbeat: false,
          convertImagesToLinks: true,
          noModals: true,
          showLowRepImageUploadWarning: true,
          reputationToPostImages: 10,
          bindNavPrevention: true,
          postfix: "",
          imageUploader: {
          brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
          contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
          allowUrls: true
          },
          onDemand: true,
          discardSelector: ".discard-answer"
          ,immediatelyShowMarkdownHelp:true
          });


          }
          });














          draft saved

          draft discarded


















          StackExchange.ready(
          function () {
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53507862%2fissue-with-rectify-on-rotated-raster-using-r-raster%23new-answer', 'question_page');
          }
          );

          Post as a guest















          Required, but never shown

























          0






          active

          oldest

          votes








          0






          active

          oldest

          votes









          active

          oldest

          votes






          active

          oldest

          votes
















          draft saved

          draft discarded




















































          Thanks for contributing an answer to Stack Overflow!


          • Please be sure to answer the question. Provide details and share your research!

          But avoid



          • Asking for help, clarification, or responding to other answers.

          • Making statements based on opinion; back them up with references or personal experience.


          To learn more, see our tips on writing great answers.




          draft saved


          draft discarded














          StackExchange.ready(
          function () {
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53507862%2fissue-with-rectify-on-rotated-raster-using-r-raster%23new-answer', 'question_page');
          }
          );

          Post as a guest















          Required, but never shown





















































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown

































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown







          Popular posts from this blog

          Lallio

          Unable to find Lightning Node

          Futebolista