<html>
<head>
<meta http-equiv="Content-Type" content="text/html;
charset=iso-8859-15">
</head>
<body text="#000000" bgcolor="#FFFFFF">
<p>Hi Joaquim,</p>
<p>Interesting. Thanks for sharing. As always with OpenSource there
are more solutions than just one ;-)</p>
<p>Yes, I am aware about the missing data in the lower right corner
- this is outside of the province and outside of my area of
interest.</p>
<p>Thanks and greetings,</p>
<p>Andreas<br>
</p>
<br>
<div class="moz-cite-prefix">On 11.09.2017 16:45, Joaquim Luis
wrote:<br>
</div>
<blockquote type="cite" cite="mid:op.y6eomoe2dbaoe8@macmarilu">
<meta http-equiv="Content-Type" content="text/html;
charset=iso-8859-15">
<style type="text/css">body { font-family:'Times New Roman'; font-size:13px}</style>
<div>You could have done it with GMT as well</div>
<div><br>
</div>
<div>gmtinfo DTM_swissALTI3D_XYZ.txt -I2<br>
-R2708001/2717999/1210001/1219999</div>
<div><br>
</div>
<div>xyz2grd -R2708001/2717999/1210001/1219999 -I2
-GDTM_swissALTI3D_XYZ.grd DTM_swissALTI3D_XYZ.txt</div>
<div><br>
</div>
<div>and you get a netCDF grid (it can do GeoTIFs too but would
need to go see the docs)</div>
<div><br>
</div>
<div>The grid misses a tile of data at the lower right corner </div>
<div><br>
</div>
<div>Joaquim</div>
<div><br>
</div>
<blockquote style="margin: 0 0 0.80ex; border-left: #0000FF 2px
solid; padding-left: 1ex">
<p>Hi Mark (and others),</p>
<p>Your sort command worked like a charm. It was also very fast!</p>
<p>Now gdalinfo produces this nice information output:</p>
<p>Driver: XYZ/ASCII Gridded XYZ<br>
Files: dtmav_sorted.xyz<br>
Size is 5000, 5000<br>
Coordinate System is `'<br>
Origin = (2708000.000000000000000,1210000.000000000000000)<br>
Pixel Size = (2.000000000000000,2.000000000000000)<br>
Corner Coordinates:<br>
Upper Left ( 2708000.000, 1210000.000) <br>
Lower Left ( 2708000.000, 1220000.000) <br>
Upper Right ( 2718000.000, 1210000.000) <br>
Lower Right ( 2718000.000, 1220000.000) <br>
Center ( 2713000.000, 1215000.000) <br>
Band 1 Block=5000x1 Type=Float32, ColorInterp=Undefined<br>
Min=728.210 Max=2294.290 <br>
NoData Value=0<br>
</p>
<p>Now I can open this in QGIS as a normal data source and
simply safe as a GeoTIFF file.</p>
<p>Thanks a lot to all who answered so quickly!</p>
<p>Glad that a simple sort command on the command line helped to
solve the issue! I will contact the data provider and ask them
if they could deliver this data in an already sorted form so
that GDAL recognizes it as gridded data.<br>
</p>
<p>Andreas<br>
</p>
<br>
<div class="moz-cite-prefix">On 11.09.2017 16:12, Mark Johnson
wrote:<br>
</div>
<blockquote type="cite"
cite="mid:CAEEbjBgFHm4H3u6NH2+YwUcX-oxxKb7_QHiWagp1srMy6bxVow@mail.gmail.com">
<div dir="ltr">You must sort the data beforehand
<div>- the y position must be sorted properly (ASC or DESC)</div>
<div><br>
</div>
<div>Standard linux sort program:</div>
<div><br>
</div>
<div>sort -k2 -n -k1 <a href="http://392_5810.xyz"
moz-do-not-send="true">392_5810.xyz</a> -o <a
href="http://392_5810.sort.xyz" moz-do-not-send="true">392_5810.sort.xyz</a><br>
</div>
<div><br>
</div>
<div>(2nd column (y) as numeric, then first column (x) -o =
output file</div>
<div><br>
</div>
<div>As a zip file you can also do:</div>
<div><br>
</div>
<div>unzip -p 390_5820.zip | sort -k2 -n -k1 -o
../xyz/390_5820.dhhn92.txt<br>
</div>
<div><br>
</div>
<div>that would deal with problem in 1 step.</div>
<div><br>
</div>
<div>ogr needs to know the range/area to build
(minx,miny,maxx, maxy), so when the y switches it assumes
a new column.</div>
<div><br>
</div>
<div>Mark</div>
</div>
<br>
<br>
<pre wrap="">_______________________________________________
gdal-dev mailing list
<a class="moz-txt-link-abbreviated" href="mailto:gdal-dev@lists.osgeo.org" moz-do-not-send="true">gdal-dev@lists.osgeo.org</a>
<a class="moz-txt-link-freetext" href="https://lists.osgeo.org/mailman/listinfo/gdal-dev" moz-do-not-send="true">https://lists.osgeo.org/mailman/listinfo/gdal-dev</a></pre>
</blockquote>
<br>
</blockquote>
<br>
<br>
<br>
</blockquote>
<br>
</body>
</html>