<div dir="ltr">Thanks Stefan,<div><br></div><div>I didn't thought of gdalbuildvrt. I'll try that option.</div><div>The polygons do not overlap and I'm not sure about the height data. Perhaps they overlap a bit.</div><div><br></div><div>What I need to do in GRASS is:</div><div><ul><li>call r.slope.aspect to calculate the slope and aspect. I had planned doing this for every polygon but when I'm going to use gdalbuildvrt I can do it for the whole dataset in one time.<br>Is that a good choice? The height data spans The Netherlands and has 0.5m resolution. Can GRASS handle such a big dataset?</li><li>Next command is r.mapcalc. This can be done on a subset or on the whole dataset at once.</li><li>Then I need to call r.to.vect. I think it is best to do this for a subset because I only need the part within the polygon. I think I can set the region to the polygon and then call r.to.vect to speed this up, right?</li><li>Then I need to clip with the border and export this vector dataset to PostGIS.</li></ul><div>With the above workflow I don't think I need to convert the polygons to raster first, right?</div></div><div>I'm reading <a href="https://grasswiki.osgeo.org/wiki/PostGIS">https://grasswiki.osgeo.org/wiki/PostGIS</a> and I'm using GRASS v7 so if I understand it correctly I can link a PostGIS table using <span style="color:black;font-family:monospace,Courier;font-size:14px;line-height:1.3em;background-color:rgb(249,249,249)">v.external</span></div>Can I then loop through each feature and perform the above workflow and also update a field in PostGIS called something like 'processed' and set it to True?<div>And am I right I can do this all using Python? I'm running Ubuntu server so no GUI available.</div><div><br></div><div>Thanks</div><div class="gmail_extra"><div><div class="gmail_signature" data-smartmail="gmail_signature"><div dir="ltr"><div dir="ltr"><div dir="ltr">
<br>
Paul<br>
</div><div dir="ltr"><br></div></div></div></div></div>
<br><div class="gmail_quote">2016-06-24 10:17 GMT+02:00 Blumentrath, Stefan <span dir="ltr"><<a href="mailto:Stefan.Blumentrath@nina.no" target="_blank">Stefan.Blumentrath@nina.no</a>></span>:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">





<div lang="NO-BOK" link="#0563C1" vlink="#954F72">
<div>
<p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri",sans-serif">>
<b>From:</b></span><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri",sans-serif"> grass-user [mailto:<a href="mailto:grass-user-bounces@lists.osgeo.org" target="_blank">grass-user-bounces@lists.osgeo.org</a>]
<b>On Behalf Of </b>Paul Meems</span><span lang="EN-US"><u></u><u></u></span></p>
<div>
<div>
<p class="MsoNormal"><span lang="EN-US" style="color:#1f497d"><u></u> <u></u></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1f497d">Depends on several things, e.g
<u></u><u></u></span></p>
<p><u></u><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1f497d"><span>-<span style="font:7.0pt "Times New Roman"">       
</span></span></span><u></u><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1f497d">do polygons overlap or not,
<u></u><u></u></span></p>
<p><u></u><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1f497d"><span>-<span style="font:7.0pt "Times New Roman"">       
</span></span></span><u></u><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1f497d">do “height maps” overlap or not?<u></u><u></u></span></p>
<p><u></u><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1f497d"><span>-<span style="font:7.0pt "Times New Roman"">       
</span></span></span><u></u><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1f497d">What are the “several commands” you need to be performed<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1f497d"><u></u> <u></u></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1f497d">On the basis of the information you provided I would have a look at
<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1f497d"><u></u> <u></u></span></p>
<p><u></u><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1f497d"><span>-<span style="font:7.0pt "Times New Roman"">       
</span></span></span><u></u><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1f497d">gdalbuildvrt for merging your “height map” tiles<u></u><u></u></span></p>
<p><u></u><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1f497d"><span>-<span style="font:7.0pt "Times New Roman"">       
</span></span></span><u></u><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1f497d">import PostGIS polygon table to GRASS<u></u><u></u></span></p>
<p><u></u><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1f497d"><span>-<span style="font:7.0pt "Times New Roman"">       
</span></span></span><u></u><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1f497d">convert to raster using v.to.rast and assign ID to each raster representation of your polygons<u></u><u></u></span></p>
<p><u></u><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1f497d"><span>-<span style="font:7.0pt "Times New Roman"">       
</span></span></span><u></u><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1f497d">calculate statistics using either<u></u><u></u></span></p>
<p style="margin-left:72.0pt">
<u></u><span lang="EN-US" style="font-size:11.0pt;font-family:"Courier New";color:#1f497d"><span>o<span style="font:7.0pt "Times New Roman"">  
</span></span></span><u></u><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1f497d">r.stats<u></u><u></u></span></p>
<p style="margin-left:72.0pt">
<u></u><span lang="EN-US" style="font-size:11.0pt;font-family:"Courier New";color:#1f497d"><span>o<span style="font:7.0pt "Times New Roman"">  
</span></span></span><u></u><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1f497d">r.univar<u></u><u></u></span></p>
<p class="MsoNormal" style="margin-left:35.4pt"><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1f497d">to create CSV files, which can be read back to PostGIS (COPY command) and then joined to your original map using ID field<u></u><u></u></span></p>
<p class="MsoNormal" style="margin-left:35.4pt"><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1f497d"><u></u> <u></u></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1f497d">I would not consider WCS / GeoServer, that gives you only overhead and extra work...<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1f497d"><u></u> <u></u></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1f497d">Cheers<span class="HOEnZb"><font color="#888888"><u></u><u></u></font></span></span></p><span class="HOEnZb"><font color="#888888">
<p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1f497d">Stefan<u></u><u></u></span></p>
</font></span></div>
</div>
</div>
</div>

</blockquote></div><br></div></div>