pktools  2.6.7
Processing Kernel for geospatial data
examples_pkascii2img

Examples of pkascii2img

We create a 5x5 raster dataset containing all 0 values except for its center (value=1)

1 cat input.txt
2 
3 0 0 0 0 0
4 0 0 0 0 0
5 0 0 1 0 0
6 0 0 0 0 0
7 0 0 0 0 0

We define a pixel size of 25 by 25 m and and a projected in the European projection system ETS89/LAEA. The location of the upper left pixel is also set:

1 pkascii2img -i input.txt -o output.tif -of GTiff -a_srs epsg:3035 -dx 25 -dy 25 -ulx 1000000 -uly 1000000

We check the output GeoTIFF using gdalinfo :

1 gdalinfo output.tif
2 
3 Driver: GTiff/GeoTIFF
4 Files: output.tif
5 Size is 5, 5
6 Coordinate System is:
7 PROJCS["ETRS89 / LAEA Europe",
8  GEOGCS["ETRS89",
9  DATUM["European_Terrestrial_Reference_System_1989",
10  SPHEROID["GRS 1980",6378137,298.2572221010042,
11  AUTHORITY["EPSG","7019"]],
12  TOWGS84[0,0,0,0,0,0,0],
13  AUTHORITY["EPSG","6258"]],
14  PRIMEM["Greenwich",0],
15  UNIT["degree",0.0174532925199433],
16  AUTHORITY["EPSG","4258"]],
17  PROJECTION["Lambert_Azimuthal_Equal_Area"],
18  PARAMETER["latitude_of_center",52],
19  PARAMETER["longitude_of_center",10],
20  PARAMETER["false_easting",4321000],
21  PARAMETER["false_northing",3210000],
22  UNIT["metre",1,
23  AUTHORITY["EPSG","9001"]],
24  AUTHORITY["EPSG","3035"]]
25 Origin = (1000000.000000000000000,1000000.000000000000000)
26 Pixel Size = (25.000000000000000,-25.000000000000000)
27 Metadata:
28  AREA_OR_POINT=Area
29  TIFFTAG_DATETIME=2014:11:08 11:33:52
30  TIFFTAG_DOCUMENTNAME=output.tif
31  TIFFTAG_SOFTWARE=pktools 2.5.4 by Pieter Kempeneers
32 Image Structure Metadata:
33  INTERLEAVE=BAND
34 Corner Coordinates:
35 Upper Left ( 1000000.000, 1000000.000) ( 23d13' 9.44"W, 25d30'21.01"N)
36 Lower Left ( 1000000.000, 999875.000) ( 23d13' 8.02"W, 25d30'17.24"N)
37 Upper Right ( 1000125.000, 1000000.000) ( 23d13' 5.27"W, 25d30'22.72"N)
38 Lower Right ( 1000125.000, 999875.000) ( 23d13' 3.85"W, 25d30'18.95"N)
39 Center ( 1000062.500, 999937.500) ( 23d13' 6.65"W, 25d30'19.98"N)
40 Band 1 Block=5x5 Type=Byte, ColorInterp=Gray