Menu

'Contour Lines from Grid' tool extent issue

Andrey
2023-10-30
2023-11-05
  • Andrey

    Andrey - 2023-10-30

    Dear developers,

    'Contour Lines from Grid' generates contours/polygons not to full grid extent but only up to the centres of the edge pixels. See attached image 1. This leads to serious artefacts in the resulting image: not only at the edges of the image, but also inside (gaps), if it is made up of separate parts. See attached image 2.
    I had high hopes for the tool because of its useful 'Interpolation Scale' parameter, but this extent issue is a blocker for me.
    Is it possible to implement contours/polygons creation aligned to the full raster extent?

     
    • Justus Spitzmüller

      I understand the problem, but I can't say how much effort it would take to adapt the tool as suggested. In my investigations I always choose data sets that are much larger than my area of interest / map because many algorithms behave differently at the edges. I then crop the resulting data sets, such as contour lines, accordingly to my AOI/map.
      Would this be possible for your investigations?

       
      • Andrey

        Andrey - 2023-10-31

        Justus,
        unfortunately, now I use data for a whole world. Yes, I can merge data, then retile this data with overlap, but I don't understand what to do with the edges along the dateline meridian. I need to eliminate the gap there somehow.
        I've used 'gdal_contour' before and did not expect that SAGA generates contours/polygons differently, smaller than the raster extent. But I really want to use SAGA.

         
        • Justus Spitzmüller

          This solution is kinda hacky so please take it with a grain of salt. You could copy the column at the meridian and then manipulate the metadata. For example if you have a .sg-grd file extension you cloud open it in a text editor an offset the POSITION_YMIN Value so it wraps around the dateline.

           
          • Andrey

            Andrey - 2023-11-01

            Actually, I already tried to do this yesterday. I merged the data tiles, extracted the outermost pixels, added them to the west and east of the 180° meridian, corrected the extent. But then I stopped at the difficulty of dividing the grid, enlarged by 2 pixels, back into tiles.
            So now I'm just waiting for the decision of the SAGA developers on the possibility of improving the 'Contour Lines from Grid' algorithm: to add an option that is available in many SAGA grid tools with 'grid cells' / 'grid nodes' available choices.

             
  • Andrey

    Andrey - 2023-11-01

    Would it make sense to create a feature request for this?

     
    • Justus Spitzmüller

      I'am sure this will be answered properly in the next days. I see no need for a feature request.

       
      • Andrey

        Andrey - 2023-11-02

        I decided that it would be right to commit the feature request.

         
  • Volker Wichmann

    Volker Wichmann - 2023-11-05

    Hi Andrey,

    please have a look at my response to your feature request.

    Best regards,
    Volker

     

Log in to post a comment.