IDW interpolation in Python in QGIS 3.4 The 2019 Stack Overflow Developer Survey Results Are...

What is preventing me from simply constructing a hash that's lower than the current target?

How to translate "being like"?

What is this business jet?

How to support a colleague who finds meetings extremely tiring?

The difference between dialogue marks

Using the end of the list as an indexing variable in a for loop

Can you cast a spell on someone in the Ethereal Plane, if you are on the Material Plane and have the True Seeing spell active?

Keeping a retro style to sci-fi spaceships?

If I score a critical hit on an 18 or higher, what are my chances of getting a critical hit if I roll 3d20?

Can we generate random numbers using irrational numbers like π and e?

I am an eight letter word. What am I?

Cooking pasta in a water boiler

"as much details as you can remember"

Does adding complexity mean a more secure cipher?

Why isn't the circumferential light around the M87 black hole's event horizon symmetric?

Are there any other methods to apply to solving simultaneous equations?

Can a flute soloist sit?

Correct punctuation for showing a character's confusion

Output the Arecibo Message

Why was M87 targeted for the Event Horizon Telescope instead of Sagittarius A*?

What to do when moving next to a bird sanctuary with a loosely-domesticated cat?

Button changing its text & action. Good or terrible?

Accepted by European university, rejected by all American ones I applied to? Possible reasons?

Did Scotland spend $250,000 for the slogan "Welcome to Scotland"?



IDW interpolation in Python in QGIS 3.4



The 2019 Stack Overflow Developer Survey Results Are InError #010067 when running spline interpolationExcluding stations from IDW interpolation?Interpolation with z-values taken from a related tableIterative Interpolation w/ Built-In Python Console Not Changing Columns in PyQGIS?Iterating Fields in shapefile and exporting after interpolation geoprocessing?Specify output data type from TIN interpolationQGIS 3 Python plugin psycopg2 Postgres Notify/Listen Live ConnectionProblem editing, clipping, and saving large shapefile QGIS 3.4Unequally spaced points along a line script - QGIS Python error trying to add integer attributeHow to generate triangulation file via QGIS C++ API





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







1















I have a problem with IDW interpolation. I need to use canvas extent and other attributes (I created an option with only attribute 0, other attributes aren't working). The documentation is not very helpful.



My code:



layer = iface.activeLayer() 

layer_data = QgsInterpolator.LayerData()
layer_data.source = xlayer
layer_data.zCoordInterpolation=False
layer_data.interpolationAttribute =0
layer_data.SourceType =SourcePoints
layer_data.distanceCoefficient=2


tin_interpolator = QgsIDWInterpolator([layer_data])

export_path = r"C:UsersMariaDocumentsmiau.tif"

cos= canvas.extent()

output = QgsGridFileWriter(tin_interpolator,export_path,cos,2000,2000)
output.writeFile()

rlayer=iface.addRasterLayer(export_path, "interpolation_output")









share|improve this question









New contributor




Maria is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.



























    1















    I have a problem with IDW interpolation. I need to use canvas extent and other attributes (I created an option with only attribute 0, other attributes aren't working). The documentation is not very helpful.



    My code:



    layer = iface.activeLayer() 

    layer_data = QgsInterpolator.LayerData()
    layer_data.source = xlayer
    layer_data.zCoordInterpolation=False
    layer_data.interpolationAttribute =0
    layer_data.SourceType =SourcePoints
    layer_data.distanceCoefficient=2


    tin_interpolator = QgsIDWInterpolator([layer_data])

    export_path = r"C:UsersMariaDocumentsmiau.tif"

    cos= canvas.extent()

    output = QgsGridFileWriter(tin_interpolator,export_path,cos,2000,2000)
    output.writeFile()

    rlayer=iface.addRasterLayer(export_path, "interpolation_output")









    share|improve this question









    New contributor




    Maria is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
    Check out our Code of Conduct.























      1












      1








      1








      I have a problem with IDW interpolation. I need to use canvas extent and other attributes (I created an option with only attribute 0, other attributes aren't working). The documentation is not very helpful.



      My code:



      layer = iface.activeLayer() 

      layer_data = QgsInterpolator.LayerData()
      layer_data.source = xlayer
      layer_data.zCoordInterpolation=False
      layer_data.interpolationAttribute =0
      layer_data.SourceType =SourcePoints
      layer_data.distanceCoefficient=2


      tin_interpolator = QgsIDWInterpolator([layer_data])

      export_path = r"C:UsersMariaDocumentsmiau.tif"

      cos= canvas.extent()

      output = QgsGridFileWriter(tin_interpolator,export_path,cos,2000,2000)
      output.writeFile()

      rlayer=iface.addRasterLayer(export_path, "interpolation_output")









      share|improve this question









      New contributor




      Maria is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.












      I have a problem with IDW interpolation. I need to use canvas extent and other attributes (I created an option with only attribute 0, other attributes aren't working). The documentation is not very helpful.



      My code:



      layer = iface.activeLayer() 

      layer_data = QgsInterpolator.LayerData()
      layer_data.source = xlayer
      layer_data.zCoordInterpolation=False
      layer_data.interpolationAttribute =0
      layer_data.SourceType =SourcePoints
      layer_data.distanceCoefficient=2


      tin_interpolator = QgsIDWInterpolator([layer_data])

      export_path = r"C:UsersMariaDocumentsmiau.tif"

      cos= canvas.extent()

      output = QgsGridFileWriter(tin_interpolator,export_path,cos,2000,2000)
      output.writeFile()

      rlayer=iface.addRasterLayer(export_path, "interpolation_output")






      python pyqgis qgis-3 interpolation






      share|improve this question









      New contributor




      Maria is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.











      share|improve this question









      New contributor




      Maria is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.









      share|improve this question




      share|improve this question








      edited 5 mins ago









      Taras

      2,2903729




      2,2903729






      New contributor




      Maria is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.









      asked 1 hour ago









      MariaMaria

      61




      61




      New contributor




      Maria is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.





      New contributor





      Maria is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.






      Maria is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.






















          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
          });


          }
          });






          Maria is a new contributor. Be nice, and check out our Code of Conduct.










          draft saved

          draft discarded


















          StackExchange.ready(
          function () {
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fgis.stackexchange.com%2fquestions%2f318554%2fidw-interpolation-in-python-in-qgis-3-4%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








          Maria is a new contributor. Be nice, and check out our Code of Conduct.










          draft saved

          draft discarded


















          Maria is a new contributor. Be nice, and check out our Code of Conduct.













          Maria is a new contributor. Be nice, and check out our Code of Conduct.












          Maria is a new contributor. Be nice, and check out our Code of Conduct.
















          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%2f318554%2fidw-interpolation-in-python-in-qgis-3-4%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 Содержание Параметры шины | Стандартизация |...