[Gdal-dev] xyz to gdal
Jason M. Nielsen
jnielsen at aero-graphics.com
Thu Jul 22 10:51:53 EDT 2004
Quoting uli <uli.mueller at gmx.ch>:
> Hi
> I need to convert lots of ASCII XYZ files to GDAL. Is there any utility
> to accomplish this in batch mode? I would like not having to go for any
> large GIS packages like GRASS. I have found gdal2xyz.py, but I would
> need it the other way round.
> Uli
>
>
> _______________________________________________
> Gdal-dev mailing list
> Gdal-dev at xserve.flids.com
> http://xserve.flids.com/mailman/listinfo/gdal-dev
>
If you can get the xyz data in an ArcGRID (AAIGrid) format you can easily
transform that to others such as img.
For example:
gdal_translate foo.AAIGrid foo.img -of HFA
It wouldnt be too difficult to make a program translate the xyz to the arcgrid.
Just sort into rows of Y(northing) by columns X(easting) starting with max Y
min X at the beginning. For each X in Y write out the elevations then start a
new line on each new Y of elevations. Of course if you do not have NO_DATA
points represented in the xyz data then you will have to watch for those missing
entities and make sure to add them in the arcgrid file otherwise your data will
be "skewed". ie: Current Y exceeds previous Y by more than cellsize(distance
between each grid point). The same applies to X.
More information about the Gdal-dev
mailing list