GDAL processing output to memory in Pyqgis Planned maintenance scheduled April 17/18, 2019 at...

How can players take actions together that are impossible otherwise?

Can a zero nonce be safely used with AES-GCM if the key is random and never used again?

When is phishing education going too far?

Is there a documented rationale why the House Ways and Means chairman can demand tax info?

How to politely respond to generic emails requesting a PhD/job in my lab? Without wasting too much time

What is the electric potential inside a point charge?

How to stop my camera from exagerrating differences in skin colour?

What do you call a plan that's an alternative plan in case your initial plan fails?

If A makes B more likely then B makes A more likely"

Why does this iterative way of solving of equation work?

How to rotate it perfectly?

Problem when applying foreach loop

Classification of bundles, Postnikov towers, obstruction theory, local coefficients

Limit for e and 1/e

Estimate capacitor parameters

Using "nakedly" instead of "with nothing on"

What was the last x86 CPU that did not have the x87 floating-point unit built in?

Area of a 2D convex hull

Antler Helmet: Can it work?

What LEGO pieces have "real-world" functionality?

Is there folklore associating late breastfeeding with low intelligence and/or gullibility?

Can a monk deflect thrown melee weapons?

Is above average number of years spent on PhD considered a red flag in future academia or industry positions?

Do we know why communications with Beresheet and NASA were lost during the attempted landing of the Moon lander?



GDAL processing output to memory in Pyqgis



Planned maintenance scheduled April 17/18, 2019 at 00:00UTC (8:00pm US/Eastern)
Announcing the arrival of Valued Associate #679: Cesar Manara
Unicorn Meta Zoo #1: Why another podcast?Creating in-memory raster layer using PyQGIS?VSIMalloc3() and UnifiedSrcDensity mask errors when running gdal_warp in OSGEO4w shellPython, GDAL, VRT: help wth code efficiency and processing timeDifferent output from rasterizeextent parameter pyqgis gdal processing rasterizeSaving pyqgis QgsGeometryAnalyzer.dissolve output in memory?Translate (convert format): Set the size of the output fileWriting PDF Output with PyQGIS?Using gdal_proximity in QGIS modeler?Output layer from PyQGIS 3 processing script is emptyPyQGIS Processing: “memory: not found”





.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty{ margin-bottom:0;
}







0















How do I save GDAL processing output rasters to a temporary layer? Using 'memory:' for vector processes works fine, but I couldn't get it to work for GDAL processes.



output_rast = self.parameterAsOutputLayer(parameters,self.OUTPUTR,context)

if True:
magnitude_rast = processing.run("gdal:rasterize", {
'INPUT':buffer_extent,
'BURN': magnitude,
'UNITS': 1,
'WIDTH': 1.0,
'HEIGHT': 1.0,
'EXTENT': buffer_extent,
'OUTPUT': 'memory:'
}, context=context, feedback=feedback)['OUTPUT']

if True:
source_rast = processing.run("gdal:rasterize", {
'INPUT':parameters['SOURCE'],
'BURN': 100,
'UNITS': 1,
'WIDTH': 1.0,
'HEIGHT': 1.0,
'EXTENT': buffer_extent,
'OUTPUT': 'memory:'
}, context=context, feedback=feedback)['OUTPUT']

if True:
proximity_rast = processing.run("gdal:proximity", {
'INPUT':source_rast,
'BAND': 1,
'VALUES': 100,
'UNITS': 0,
'DATA_TYPE': 5,
'OUTPUT': output_rast
}, context=context, feedback=feedback)['OUTPUT']
return {self.OUTPUTR: output_rast}


I've also tried using None for the output parameter as recommended here but I get an incorrect parameter value error.









share































    0















    How do I save GDAL processing output rasters to a temporary layer? Using 'memory:' for vector processes works fine, but I couldn't get it to work for GDAL processes.



    output_rast = self.parameterAsOutputLayer(parameters,self.OUTPUTR,context)

    if True:
    magnitude_rast = processing.run("gdal:rasterize", {
    'INPUT':buffer_extent,
    'BURN': magnitude,
    'UNITS': 1,
    'WIDTH': 1.0,
    'HEIGHT': 1.0,
    'EXTENT': buffer_extent,
    'OUTPUT': 'memory:'
    }, context=context, feedback=feedback)['OUTPUT']

    if True:
    source_rast = processing.run("gdal:rasterize", {
    'INPUT':parameters['SOURCE'],
    'BURN': 100,
    'UNITS': 1,
    'WIDTH': 1.0,
    'HEIGHT': 1.0,
    'EXTENT': buffer_extent,
    'OUTPUT': 'memory:'
    }, context=context, feedback=feedback)['OUTPUT']

    if True:
    proximity_rast = processing.run("gdal:proximity", {
    'INPUT':source_rast,
    'BAND': 1,
    'VALUES': 100,
    'UNITS': 0,
    'DATA_TYPE': 5,
    'OUTPUT': output_rast
    }, context=context, feedback=feedback)['OUTPUT']
    return {self.OUTPUTR: output_rast}


    I've also tried using None for the output parameter as recommended here but I get an incorrect parameter value error.









    share



























      0












      0








      0








      How do I save GDAL processing output rasters to a temporary layer? Using 'memory:' for vector processes works fine, but I couldn't get it to work for GDAL processes.



      output_rast = self.parameterAsOutputLayer(parameters,self.OUTPUTR,context)

      if True:
      magnitude_rast = processing.run("gdal:rasterize", {
      'INPUT':buffer_extent,
      'BURN': magnitude,
      'UNITS': 1,
      'WIDTH': 1.0,
      'HEIGHT': 1.0,
      'EXTENT': buffer_extent,
      'OUTPUT': 'memory:'
      }, context=context, feedback=feedback)['OUTPUT']

      if True:
      source_rast = processing.run("gdal:rasterize", {
      'INPUT':parameters['SOURCE'],
      'BURN': 100,
      'UNITS': 1,
      'WIDTH': 1.0,
      'HEIGHT': 1.0,
      'EXTENT': buffer_extent,
      'OUTPUT': 'memory:'
      }, context=context, feedback=feedback)['OUTPUT']

      if True:
      proximity_rast = processing.run("gdal:proximity", {
      'INPUT':source_rast,
      'BAND': 1,
      'VALUES': 100,
      'UNITS': 0,
      'DATA_TYPE': 5,
      'OUTPUT': output_rast
      }, context=context, feedback=feedback)['OUTPUT']
      return {self.OUTPUTR: output_rast}


      I've also tried using None for the output parameter as recommended here but I get an incorrect parameter value error.









      share
















      How do I save GDAL processing output rasters to a temporary layer? Using 'memory:' for vector processes works fine, but I couldn't get it to work for GDAL processes.



      output_rast = self.parameterAsOutputLayer(parameters,self.OUTPUTR,context)

      if True:
      magnitude_rast = processing.run("gdal:rasterize", {
      'INPUT':buffer_extent,
      'BURN': magnitude,
      'UNITS': 1,
      'WIDTH': 1.0,
      'HEIGHT': 1.0,
      'EXTENT': buffer_extent,
      'OUTPUT': 'memory:'
      }, context=context, feedback=feedback)['OUTPUT']

      if True:
      source_rast = processing.run("gdal:rasterize", {
      'INPUT':parameters['SOURCE'],
      'BURN': 100,
      'UNITS': 1,
      'WIDTH': 1.0,
      'HEIGHT': 1.0,
      'EXTENT': buffer_extent,
      'OUTPUT': 'memory:'
      }, context=context, feedback=feedback)['OUTPUT']

      if True:
      proximity_rast = processing.run("gdal:proximity", {
      'INPUT':source_rast,
      'BAND': 1,
      'VALUES': 100,
      'UNITS': 0,
      'DATA_TYPE': 5,
      'OUTPUT': output_rast
      }, context=context, feedback=feedback)['OUTPUT']
      return {self.OUTPUTR: output_rast}


      I've also tried using None for the output parameter as recommended here but I get an incorrect parameter value error.







      python pyqgis gdal qgis-3





      share














      share












      share



      share








      edited 4 mins ago









      Vince

      14.8k32850




      14.8k32850










      asked 7 mins ago









      strythestrythe

      1039




      1039






















          0






          active

          oldest

          votes












          Your Answer








          StackExchange.ready(function() {
          var channelOptions = {
          tags: "".split(" "),
          id: "79"
          };
          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: false,
          noModals: true,
          showLowRepImageUploadWarning: true,
          reputationToPostImages: null,
          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%2fgis.stackexchange.com%2fquestions%2f318767%2fgdal-processing-output-to-memory-in-pyqgis%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 Geographic Information Systems Stack Exchange!


          • 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%2fgis.stackexchange.com%2fquestions%2f318767%2fgdal-processing-output-to-memory-in-pyqgis%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

          Щит и меч (фильм) Содержание Названия серий | Сюжет |...

          is 'sed' thread safeWhat should someone know about using Python scripts in the shell?Nexenta bash script uses...

          Meter-Bus Содержание Параметры шины | Стандартизация |...