[FWTools] raster_format

Michael Sumner mdsumner at utas.edu.au
Wed Mar 14 15:44:12 EST 2007


An option is to use R with the rgdal package (very easy on Windows):

library(rgdal)  ## requires R and package 'sp', ( and GDAL etc on *nix)

## read from text file
d <- read.table("file.xt")

## provide column names for data
colnames(d) <- c("x", "y", "z")

## invoke spatial context
coordinates(d) <- ~x+y

## determine PROJ.4 string and assign . . .
## ##  proj4string(d) <- CRS( . . . p4string . . .)

## if the data really are gridded (they don't appear to be):
    gridded(d) <- TRUE
   
    ## output tiff
    writeGDAL(d, "file.tif")

## if the data are irregular
    ## output to vector format
    writeOGR(d, "lidar", layer = "lidar", driver = "ESRI Shapefile")
   
    ## and/or invoke rasterizing operation , , ,

What is the size of the text file?

Cheers, Mike.

Travis Kirstine wrote:
> I have been givin a lidar dataset and hoping I could translate it to a
> raster it with gdal, however there was no extension provided with the
> file.  The file seems to be a txt file with xyz values e.g.
> 283122.50 5039995.42 26.41
> 283123.70 5039996.25 26.25
> 283123.98 5039996.80 26.28
> 283125.52 5039996.01 26.44
> 283125.65 5039993.80 26.38
> 283126.78 5039999.64 26.39
> 283127.02 5039997.95 26.31
> Any thoughts
>



More information about the FWTools mailing list