[Liblas-devel] PROJ4 / Georeference info?
Jason Woolard
Jason.Woolard at noaa.gov
Wed Oct 29 23:27:00 EDT 2008
hi all,
Thanks for the great work here. The library is working quite well. I
have another quick question though. Sorry if I'm missing something obvious.
I'm trying to add projection and georeference info to LAS header files
that currently don't have any projection info. I was thinking something
like this would work:
>>> from liblas import file
>>> infile = liblas.file.File('C:\\liblas_test\\debug.las',mode='r')
>>> h = infile.header
>>> h.proj4 ='+proj=utm +zone=17 +ellps=WGS84 +units=m'
>>> h.proj4
'+proj=utm +zone=17 +ellps=WGS84 +units=m'
>>> outfile =
liblas.file.File('C:\\liblas_test\\debug_junk.las',mode='w', header=h)
>>> outfile.header.proj4
'+proj=utm +zone=17 +ellps=WGS84 +units=m'
>>> outfile.close()
>>> outfile = liblas.file.File('C:\\liblas_test\\debug_junk.las',mode='r')
>>> outfile.header.proj4
''
>>>
It seems to write the correct string '+proj=utm +zone=17 +ellps=WGS84
+units=m' but if the file is closed and open again it returns an empty
string. So, I guess it's not actually writing anything?
Thanks for any guidance or suggestions you can provide.
Jason
More information about the Liblas-devel
mailing list