<!DOCTYPE html>
<html>
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
  </head>
  <body>
    <p>Why not just trying?</p>
    <p>Demo:</p>
    <p>$ gdal_create -outsize 10 10 -burn 255 test.tif -a_srs EPSG:4326
      -a_ullr 0 10 10 0<br>
      $ gdal_rasterize -burn 0
      '{"type":"Polygon","coordinates":[[[2,2],[2,4],[4,4],[4,2],[2,2]]]}'
      test.tif<br>
      $ gdal_translate test.tif /vsistdout/ -of aaigrid<br>
      ncols        10<br>
      nrows        10<br>
      xllcorner    0.000000000000<br>
      yllcorner    0.000000000000<br>
      cellsize     1.000000000000<br>
      255 255 255 255 255 255 255 255 255 255 <br>
      255 255 255 255 255 255 255 255 255 255 <br>
      255 255 255 255 255 255 255 255 255 255 <br>
      255 255 255 255 255 255 255 255 255 255 <br>
      255 255 255 255 255 255 255 255 255 255 <br>
      255 255 255 255 255 255 255 255 255 255 <br>
      255 255 0 0 255 255 255 255 255 255 <br>
      255 255 0 0 255 255 255 255 255 255 <br>
      255 255 255 255 255 255 255 255 255 255 <br>
      255 255 255 255 255 255 255 255 255 255 <br>
    </p>
    <p>That said, I've attempted to clarifiy it pe
<a class="moz-txt-link-freetext" href="https://github.com/OSGeo/gdal/commit/4377ce22ec8d26b76760e8c1e4a9ffa2bd240b7d">https://github.com/OSGeo/gdal/commit/4377ce22ec8d26b76760e8c1e4a9ffa2bd240b7d</a><br>
    </p>
    <div class="moz-cite-prefix">Le 19/03/2024 à 13:42, Carsten
      Lockenkötter via gdal-dev a écrit :<br>
    </div>
    <blockquote type="cite"
cite="mid:trinity-1b18b0e2-d6cd-4638-a996-c5eb5b53cc9a-1710852121043@msvc-mesg-web101">
      <meta name="viewport" content="width=device-width">
      <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
      <div class="mail_android_message"
        style="line-height: 1; padding: 0.5em">Hi Frank,<br>
        <br>
        I have read about gdal_rasterize but it seems it works a bit
        different as i need it.<br>
        Gdal_rasterize converts a vector layer to a raster layer with
        specific dimensions and create a new file, like a mask.<br>
        It could be work for me yes, because i publish the raster files
        as image mosiac at the geoserver.<br>
        Maybe the new "mask" file overlays on me original files and the
        created wmts tiles of the geoserver could contain the mask.<br>
        <br>
        I will try it, but is there another option to burn the
        vectorlayer into existing tiles?<br>
        <br>
        Regards,<br>
        Carsten</div>
      <div class="mail_android_quote"
        style="line-height: 1; padding: 0.3em">Am 19.03.24, 00:14
        schrieb Frank Warmerdam <a class="moz-txt-link-rfc2396E" href="mailto:warmerdam@pobox.com"><warmerdam@pobox.com></a>:
        <blockquote class="gmail_quote"
style="margin: 0.8ex 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">
          <div dir="ltr">
            <div class="gmail_default"
              style="font-family:arial,sans-serif"> Carsten, </div>
            <div class="gmail_default"
              style="font-family:arial,sans-serif"> <br>
            </div>
            <div class="gmail_default"
              style="font-family:arial,sans-serif"> The gdal_rasterize
              command allows you to "burn in" polygons from an OGR
              supported datasource into an existing raster.  If your
              raster is a 3 band RGB file, you could use --burn 100 150
              200 to burn in the RGB value (100,150,200).   This will
              only work if the raster format you are using supports
              update-in-place. </div>
            <div class="gmail_default"
              style="font-family:arial,sans-serif"> <br>
            </div>
            <div class="gmail_default"
              style="font-family:arial,sans-serif"> You would have to
              regenerate pyramids after this process -- they are not
              automatically updated by GDAL when the "base layer" is
              updated.  </div>
            <div class="gmail_default"
              style="font-family:arial,sans-serif"> <br>
            </div>
            <div class="gmail_default"
              style="font-family:arial,sans-serif"> Best regards, </div>
            <div class="gmail_default"
              style="font-family:arial,sans-serif"> Frank </div>
            <div class="gmail_default"
              style="font-family:arial,sans-serif"> <br>
            </div>
          </div>
          <br>
          <div class="gmail_quote">
            <div class="gmail_attr" dir="ltr"> On Mon, Mar 18, 2024 at
              5:34 PM Carsten Lockenkötter via gdal-dev <<a
                href="mailto:gdal-dev@lists.osgeo.org"
                moz-do-not-send="true" class="moz-txt-link-freetext">gdal-dev@lists.osgeo.org</a>>
              wrote: <br>
            </div>
            <blockquote class="gmail_quote"
style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
              <div class="msg4228850956568425313">
                <div style="overflow-wrap: break-word;">
                  <div class="m_4228850956568425313WordSection1">
                    <p class="MsoNormal">Hi,</p>
                    <p class="MsoNormal"> </p>
                    <p class="MsoNormal">is it possible to censor
                      specific areas of an aerial image using GDAL?</p>
                    <p class="MsoNormal"> </p>
                    <p class="MsoNormal">I have several smaller tiles
                      that I've already transformed into my desired
                      coordinate system and generated internal pyramids.</p>
                    <p class="MsoNormal">Subsequently, I would like to
                      censor certain areas based on polygons (e.g., from
                      a shapefile or an Oracle DB) (coloring them
                      grayish).</p>
                    <p class="MsoNormal">Set the color must be done
                      after transforming coordinatesystem and generating
                      pyramids.</p>
                    <p class="MsoNormal"> </p>
                    <p class="MsoNormal">I usually use the compiled
                      Windows binaries from <a
                        href="http://gisinternals.com"
                        moz-do-not-send="true">gisinternals.com</a>.</p>
                    <p class="MsoNormal">Presumably, my plan doesn't
                      work with that, right? At least I haven't found
                      anything in that direction.</p>
                    <p class="MsoNormal">I suppose this could be done
                      with a Python, but I've never worked with Python
                      before.</p>
                    <p class="MsoNormal">Do I need to adjust the
                      internal pyramids as well? Or do I have to
                      recreate them?</p>
                    <p class="MsoNormal"> </p>
                    <p class="MsoNormal">Could you please show me a
                      brief example of how it could work, so I have an
                      approach?</p>
                    <p class="MsoNormal">I just need an idea of how to
                      implement this and possibly some tips on what else
                      I need to consider.</p>
                    <p class="MsoNormal"> </p>
                    <p class="MsoNormal">Regards,</p>
                    <p class="MsoNormal">Carsten</p>
                  </div>
                </div>
                _______________________________________________ <br>
                gdal-dev mailing list <br>
                <a href="mailto:gdal-dev@lists.osgeo.org"
                  moz-do-not-send="true" class="moz-txt-link-freetext">gdal-dev@lists.osgeo.org</a>
                <br>
                <a
href="https://lists.osgeo.org/mailman/listinfo/gdal-dev"
                  moz-do-not-send="true" class="moz-txt-link-freetext">https://lists.osgeo.org/mailman/listinfo/gdal-dev</a>
                <br>
              </div>
            </blockquote>
          </div>
          <br>
          <div> <br>
          </div>
          <span class="gmail_signature_prefix">-- </span> <br>
          <div class="gmail_signature" dir="ltr">
            <div dir="ltr">
              <div>
                <div dir="ltr">
                  <div> <font face="monospace">---------------------------------------+--------------------------------------<br>
                      I set the clouds in motion - turn up   | Frank
                      Warmerdam, <a href="mailto:warmerdam@pobox.com"
                        moz-do-not-send="true"
                        class="moz-txt-link-freetext">warmerdam@pobox.com</a><br>
                      light and sound - activate the windows | USA: +1
                      650-701-7823<br>
                      and watch the world go round - Rush    | CAN: +1
                      343-550-9984</font> </div>
                </div>
              </div>
            </div>
          </div>
        </blockquote>
      </div>
      <br>
      <fieldset class="moz-mime-attachment-header"></fieldset>
      <pre class="moz-quote-pre" wrap="">_______________________________________________
gdal-dev mailing list
<a class="moz-txt-link-abbreviated" href="mailto:gdal-dev@lists.osgeo.org">gdal-dev@lists.osgeo.org</a>
<a class="moz-txt-link-freetext" href="https://lists.osgeo.org/mailman/listinfo/gdal-dev">https://lists.osgeo.org/mailman/listinfo/gdal-dev</a>
</pre>
    </blockquote>
    <pre class="moz-signature" cols="72">-- 
<a class="moz-txt-link-freetext" href="http://www.spatialys.com">http://www.spatialys.com</a>
My software is free, but my time generally not.</pre>
  </body>
</html>