How to extract xy and z units from lasinfo?

491 views
Skip to first unread message

Jordan, Tom

unread,
Sep 15, 2017, 10:45:54 AM9/15/17
to last...@googlegroups.com, Martin Isenburg

Martin,

I am trying to programmatically extract metadata from lasinfo output for entry into a catalog. I’m having trouble extracting the units for both the xy plane and z axis for LAS 1.2 and 1.4 files. Specifically, I need to know the units of these values reported by lasinfo:

min x y z:                  1620000.00002 6628000.00005 445.27980

max x y z:                  1620999.99999 6628999.99999 475.97440

 

How can the units be determined for LAS 1.2 files?  I see this section in the lasinfo output:

description          '    GeoTIFF GeoKeysDirectoryTag'

    GeoKeyDirectoryTag version 1.1.0 number of keys 3

      key 3072 tiff_tag_location 0 count 1 value_offset 6580 - ProjectedCSTypeGeoKey: NAD83(2011) / Texas Centric Lambert Conformal

      key 1024 tiff_tag_location 0 count 1 value_offset 1 - GTModelTypeGeoKey: ModelTypeProjected

      key 4096 tiff_tag_location 0 count 1 value_offset 5703 - VerticalCSTypeGeoKey: NAVD88 height (Reserved EPSG)

 

                However, as I understand it, the units of NAD83 and NAVD88 can be either feet or meters (although the default for NAVD88 is meters).

 

                Using lasinfo’s “-cd” option, this section is included in the output:

point density: all returns 78.83 last only 78.83 (per square meter)

      spacing: all returns 0.11 last only 0.11 (in meters)

 

                How does lasinfo determine these units? Are these units guaranteed to be correct for LAS 1.2?

 

For LAS 1.4, the units are embedded in the “description” field as shown here:

  description          'Projection'

    WKT OGC COORDINATE SYSTEM:

    COMPD_CS["NAD83(2011) / Texas Centric Lambert Conformal + NAVD88 height - Geoid12B",

    PROJCS["NAD83(2011) / Texas Centric Lambert Conformal",

        . . .

        UNIT["metre",1,

            AUTHORITY["EPSG","9001"]],

         . . .

    VERT_CS["NAVD88 height",

        VERT_DATUM["North American Vertical Datum 1988",2005,

            AUTHORITY["EPSG","5103"]],

        UNIT["metre",1,

            AUTHORITY["EPSG","9001"]],

        AXIS["Up",UP],

        AUTHORITY["EPSG","5703"]]]

 

                But strangely, the “point density” and “point spacing” values don’t indicate the actual units as they did for LAS 1.2 files. For example:

point density: all returns 78.83 last only 78.83 (per square units)

      spacing: all returns 0.11 last only 0.11 (in units)

overview over extended number of returns of given pulse: 78585827 0 0 0 0 0 0 0 0 0 0 0 0 0 0

 

I am using version 170828:

lasinfo -version

LAStools (by mar...@rapidlasso.com) version 170828

The complete lasinfo files are attached.

 

Recommendations

Can you fix the “point density” and “point spacing” fields to indicate the actual units for LAS 1.4 files?

 

Even better, can you add “xy units” and “z units” fields to the lasinfo output beneath the min and max x y z fields to make this important information easier to find?

min x y z:                  1620000.00002 6628000.00005 445.27980

max x y z:                  1620999.99999 6628999.99999 475.97440

xy units: [meter, feet, etc.]

z units: [meter, feet, etc.]

 

Thanks

Tom Jordan, MSCS
Software Engineer

Geospatial data processing and visualization

Space and intelligence systems / HARRIS CORPORATION

Melbourne, FL / HTC-C3014

 

16206628-las14_info.txt
16206628-las12_info.txt

Martin Isenburg

unread,
Sep 15, 2017, 11:46:28 AM9/15/17
to last...@googlegroups.com, Jordan, Tom
Hello,

the EPSG code 6580 specifies implicitly that the units are meters.

[...]
6580,"NAD83(2011) / Texas Centric Lambert Conformal",9001,6318,14253,9802,1,0,4499,8821,18,9110,8822,-100,9110,8823,27.3,9110,8824,35,9110,8826,1500000,9001,8827,5000000,9001,,,
[...]

It seem that lasinfo is currently only parsing the GeoTiff tags but not the OGC WKT string for LAS 1.4 files. I'll fix that in a future release.

May I suggest you change your exporter to use *proper* scaling factors and *nicer* offsets? This is simply not very useful and somewhat "unprofessional" in my opinion.

scale factor x y z:         0.00001 0.00001 0.00001
  offset x y z:               1620949.2261445154 6628004.618179461 431.85015293490142
  min x y z:                  1620000.00002 6628000.00005 445.27980
  max x y z:                  1620999.99999 6628999.99999 475.97440

A three magnitude lower scale factor of 0.01 would be much more appropriate for airborne LiDAR than the current scale factor 0.00001.

Also an offset factor with more decimal digits than the scale factor means that all LiDAR points get (most likely randomly) shifted in the moment they are converted to floating-point. In your case the offset for x is 1620949.2261445154. Hence for each x coordinate there is a fractional shift of 0.0000045154. Your offset for y is 6628004.618179461. Hence for each y coordinate there is a fractional shift of 0.000009461. Your offset for z is 431.85015293490142. Hence for each z coordinate there is a fractional shift of 0.00000293490142.

Therefore all your xyz coordinates will look like this after they were converted to floating point:

162XXXX.XXXXX45154 662XXXX.XXXXX9461 XXXX.XXXXX293490142

Run the following on your LiDAR file to get a file with "reasonable" values for scale and offset.

las2las -i in.laz -rescale 0.01 0.01 0.01 -auto_reoffset -o out.laz

Regards,

Martin @rapidlasso



Jordan, Tom

unread,
Sep 15, 2017, 8:39:40 PM9/15/17
to Martin Isenburg, last...@googlegroups.com

Thank you Martin. Just two comments…

 

>> May I suggest you change your exporter to use *proper* scaling factors and *nicer* offsets? This is simply not very useful and somewhat "unprofessional" in my opinion.

 

Yes, I agree 0.00001 m is way too small. I really appreciate your thorough explanation and I forwarded your comments to our LiDAR production team for review.

 

>> It seem that lasinfo is currently only parsing the GeoTiff tags but not the OGC WKT string for LAS 1.4 files. I'll fix that in a future release.

 

Thank you Martin. That should fix the bug in the “point density” and “point spacing” units for LAS 1.4 files (as indicated below).

 

point density: all returns 78.83 last only 78.83 (per square units)

      spacing: all returns 0.11 last only 0.11 (in units)

 

However, those fields are only displayed when the “-cd” option is used. Can you also add “xy units” and “z units” fields to the lasinfo output; for instance, beneath the min and max x y z fields as shown below?

 

min x y z:        1620000.00002 6628000.00005 445.27980

max x y z:        1620999.99999 6628999.99999 475.97440

xy units:         [degree, meter, metre, m, foot, US survey foot,  etc.]

z units:          [meter, metre, m, foot, US survey foot, etc.]

 

That would greatly clarify the dimensions. Also, since lasinfo only reports the EPSG codes for LAS 1.2, users currently have to manually lookup, or write a program to lookup, the XY and Z EPSG codes just to determine the units (quite burdensome).

Since your lasinfo code already determines the correct units, it would be most helpful to include them in the output.

Reply all
Reply to author
Forward
0 new messages