[Liblas-devel] LAS file Coordinate Systems

Patel, Ronak Avinash (US SSA) ronak.patel at baesystems.com
Wed Jul 22 14:19:35 EDT 2009


Howard,

I am trying to set everything in WGS 84 as you described but I am seeing
some weird things:

I am setting my bounding box to the following envelope:

{-2.68934056019039, 51.501158065529, 56}
{-2.68570637283357, 51.5034265277949, 56}

However, when I output the las I made using lasinfo.exe (from libLAS
1.2) it truncates the precision and only shows 

min x y z                  -2.689341 51.501158 0
max x y z                  -2.685706 51.503427 0

Same thing for when I set scale to:

PointScales scales = new PointScales();
scales.setX(0.000000001D);
scales.setY(0.000000001D);
scales.setZ(1.0);
header.setScales(scales);

Last I checked these are all valid IEEE Double Precision Floating Point
Standard values.

Now, is lasinfo.exe to blame for rounding?? Or is the LAS Spec lying
when it says it supports the standard IEEE Double Precision Floating
Point Standard??

Ronak

-----Original Message-----
From: liblas-devel-bounces at lists.osgeo.org
[mailto:liblas-devel-bounces at lists.osgeo.org] On Behalf Of Howard Butler
Sent: Tuesday, July 21, 2009 6:17 PM
To: Liblas-devel at lists.osgeo.org
Subject: Re: [Liblas-devel] LAS file Coordinate Systems


On Jul 21, 2009, at 6:46 PM, Mateusz Loskot wrote:

> Patel, Ronak Avinash \(US SSA\) wrote:
>> Mateusz,
>>
>> So you're saying the Geotiff specification describes how to handle  
>> the
>> case where files cross UTM boundaries?
>

UTM boundaries are not hard.  You can have a point that is "in" UTM  
Zone 14 but its data are described in UTM Zone 15 and it is still  
valid (though not as accurate as if it were actually projected into  
Zone 14).  To answer your question, however, neither the GeoTIFF  
specification nor the LAS specification say anything about spanning  
UTM zones within the same file.  What is usually done is a coordinate  
system that is local enough to the area of interest is chosen with a  
specific scale and offset.  For small areas, UTM is ok, but for  
something like the state of Texas, you would want something else  
(multiple UTM zones there).

By appropriately setting the offset and scale, I think you should be  
able to finagle enough precision to work with WGS84 in LAS.  Look at  
some samples in the sample library <http://liblas.org/samples> and see  
how they are setting scale/offset values for some ideas.

I would note that other than Mateusz and myself comfort and  
familiarity with C/C++, one of the major reasons libLAS is implemented  
in C++ is we can easily stand on the shoulder of other giants  
(libgeotiff, GDAL, libspatialindex, etc).  The Java world lags a bit  
in the closer-to-the-metal geospatial libraries area.

I would suggest that you make a patch for GeoTools that is going to  
allow you to get/set GeoTIFF keys and separate that from the GeoTIFF  
header writing code.  Otherwise, you are going to have to implement  
all of the GeoTIFF "spec".  I use spec in scare quotes because out in  
the wild, it is much more widely (and poorly) implemented than even  
LAS.  Both GeoTools and libgeotiff (to an even stronger degree) have  
smoothed over some of these inconsistencies, though thar be many  
dragons there.

Howard
_______________________________________________
Liblas-devel mailing list
Liblas-devel at lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/liblas-devel




More information about the Liblas-devel mailing list