Re: Lasclip issue

582 views
Skip to first unread message

Martin Isenburg

unread,
Jun 27, 2012, 6:49:47 PM6/27/12
to LAStools - efficient tools for LiDAR processing
Hello,

after a few offline emails we figures out the issue. The LAS file was
in a stateplane83 projection and the SHP file in longitude/latitude. i
added a warning to lasclip that will inform the user when the bounding
boxes have no overlap:

lasclip -v -i q29094f81.laz -poly bridge_rect.shp -nil
WARNING: bounding boxes of 'bridge_rect.shp' and 'q29094f81.laz' have
no overlap
'bridge_rect.shp' has bounding box:
[-95.1177,29.5075] to [-94.9163,29.7711]
'q29094f81.laz' has bounding box:
[3.23743e+006,1.38193e+007] to [3.25804e+006,1.38427e+007]
WARNING: written 0 points but expected 48223887 points

note the '-nil' option. that is useful for quickly testing something
without actually producing an output LAS file. So I suggested to
Mukesh to convert this LAS file to longitude/latitude as well with:

las2las -i q29094f81.laz -o q29094f81_ll.laz -sp83 TX_SC -feet -
target_longlat

afterwards both files were in the same coordinate system and all LiDAR
points corresponding to bridges where extracted correctly with a call
to

lasclip -v -i q29094f81_ll.laz -poly bridge_rect.shp -o
q29094f81_ll_bridges.laz

Regards,

Martin @rapidlasso

On Jun 26, 10:11 am, Mukesh Rungta <mukeshrun...@gmail.com> wrote:
> Hi Martin,
>
> I am trying to use lasclip.exe to clip away the points outside of a shape
> file. When I give the input .las file and the polygons using .shp file, I
> encounter a warning saying that there is no overlap. I made sure that the
> projections of .las file and .shp file are same and verified the overlap
> using QT modeler.
>
> I use lasclip but get a warning like this: "Warning: written 0 points but
> expected 48223887 points"
>
> lasclip -i q29094f81.las -poly rect.shp -olas -sp83 TX_SC -feet
>
> Can you please guide me on this issue.
>
> Thanks,
> Mukesh
> University of Houston

Martin Isenburg

unread,
Sep 13, 2012, 7:52:26 AM9/13/12
to LAStools - efficient tools for LiDAR processing
Hello,

> [...] I created a
> shapefile which I imported the coordinate system from the lasd (created
> from las which I need to clip). So the shapefile and the las have the exact
> same projection. But why it still gave me "no overlap" warning and no
> points are produced?

Bing has sent me the files in question. Turns out that his LAZ file
(state plane NAD83 Maryland) and his SHP file (utm 14N) in fact do use
different projections as you can see in the output at the end of this
message. Therefore there is obviously no overlap in the bounding boxes
of the coordinates of the points. Hence, before using lasclip you need
to get the LAZ file to UTM 14N. For that you can run

las2las -i 354.laz -target_utm 14N -o 354_utm.laz

and then the clipping works just fine:

lasclip -i 354_utm.laz -poly Cutter.shp -o 354_clipped.laz -v

counting number of polygon points (5) took 0 sec.
triangulating polygon points took 0 sec.
outputting 14386 clipped points took 4.141 sec.
done with '354_utm.laz'. total time 4.141 sec.

Regards,

Martin @rapidlasso

---------------------------------------------------------------------------------------------------------------

C:\lastools\bin>more Cutter.prj
PROJCS["NAD83_HARN_UTM_zone_14N",GEOGCS["GCS_North_American_1983_HARN",DATUM["D_North_American_1983_HARN",SPHEROID["GRS_1980",
6378137.0,298.257222101]],PRIMEM["Greenwich",0.0],UNIT["Degree",
0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["false_easting",
500000.0],PARAMETER["false_northing",
0.0],PARAMETER["central_meridian",-99.0],PARAMETER["scale_factor",
0.9996],PARAMETER["latitude_of_origin",0.0],UNIT["Meter",
1.0]],VERTCS["Unknown VCS from ArcInfo
Workstation",VDATUM["Unknown"],PARAMETER["Vertical_Shift",
0.0],PARAMETER["Direction",1.0],UNIT["Meter",1.0]]

---------------------------------------------------------------------------------------------------------------

C:\lastools\bin>lasinfo -i 354.laz
reporting all LAS header entries:
file signature: 'LASF'
file source ID: 0
global_encoding: 0
project ID GUID data 1-4: 0 0 0 ''
version major.minor: 1.2
system identifier: ''
generating software: 'TerraScan'
file creation day/year: 228/2011
header size: 227
offset to point data: 916
number var. length records: 5
point data format: 1
point data record length: 28
number of point records: 4200718
number of points by return: 2940215 917999 298555 43949 0
scale factor x y z: 0.001 0.001 0.001
offset x y z: 2400000 850000 0
min x y z: 1348000.020 587000.000 274.650
max x y z: 1353999.980 590999.990 966.680
variable length header record 1 of 5:
reserved 43707
user ID 'LASF_Projection'
record ID 34735
length after header 200
description 'GeoTiff Projection Keys'
GeoKeyDirectoryTag version 1.1.0 number of keys 24
key 1024 tiff_tag_location 0 count 1 value_offset 1 -
GTModelTypeGeoKey: ModelTypeProjected
key 2048 tiff_tag_location 0 count 1 value_offset 4269 -
GeographicTypeGeoKey: GCS_NAD83
key 2049 tiff_tag_location 34737 count 24 value_offset 68 -
GeogCitationGeoKey: GCS_North_American_1983
key 2050 tiff_tag_location 0 count 1 value_offset 6269 -
GeogGeodeticDatumGeoKey: Datum_North_American_Datum_1983
key 2051 tiff_tag_location 0 count 1 value_offset 8901 -
GeogPrimeMeridianGeoKey: PM_Greenwich
key 2054 tiff_tag_location 0 count 1 value_offset 9102 -
GeogAngularUnitsGeoKey: Angular_Degree
key 2055 tiff_tag_location 34736 count 1 value_offset 10 -
GeogAngularUnitSizeGeoKey: 0.01745329252
key 2056 tiff_tag_location 0 count 1 value_offset 7019 -
GeogEllipsoidGeoKey: Ellipse_GRS_1980
key 2057 tiff_tag_location 34736 count 1 value_offset 7 -
GeogSemiMajorAxisGeoKey: 6378137
key 2059 tiff_tag_location 34736 count 1 value_offset 8 -
GeogInvFlatteningGeoKey: 298.2572221
key 2061 tiff_tag_location 34736 count 1 value_offset 9 -
GeogPrimeMeridianLongGeoKey: 0
key 3072 tiff_tag_location 0 count 1 value_offset 26985 -
ProjectedCSTypeGeoKey: PCS_NAD83_Maryland
key 3073 tiff_tag_location 34737 count 44 value_offset 0 -
PCSCitationGeoKey: NAD_1983_StatePlane_Maryland_FIPS_1900_Fee
key 3075 tiff_tag_location 0 count 1 value_offset 8 -
ProjCoordTransGeoKey: CT_LambertConfConic_2SP
key 3076 tiff_tag_location 0 count 1 value_offset 9003 -
ProjLinearUnitsGeoKey: Linear_Foot_US_Survey
key 3077 tiff_tag_location 34736 count 1 value_offset 6 -
ProjLinearUnitSizeGeoKey: 0.3048006096
key 3078 tiff_tag_location 34736 count 1 value_offset 3 -
ProjStdParallel1GeoKey: 38.3
key 3079 tiff_tag_location 34736 count 1 value_offset 4 -
ProjStdParallel2GeoKey: 39.45
key 3081 tiff_tag_location 34736 count 1 value_offset 5 -
ProjNatOriginLatGeoKey: 37.66666667
key 3082 tiff_tag_location 34736 count 1 value_offset 0 -
ProjFalseEastingGeoKey: 1312333.333
key 3083 tiff_tag_location 34736 count 1 value_offset 1 -
ProjFalseNorthingGeoKey: 0
key 3088 tiff_tag_location 34736 count 1 value_offset 2 -
ProjCenterLongGeoKey: -77
key 4097 tiff_tag_location 34737 count 24 value_offset 44 -
VerticalCitationGeoKey: NAVD88 - Geoid09 (Feet)
key 4099 tiff_tag_location 0 count 1 value_offset 9003 -
VerticalUnitsGeoKey: Linear_Foot_US_Survey
variable length header record 2 of 5:
reserved 43707
user ID 'LASF_Projection'
record ID 34736
length after header 88
description 'GeoTiff double parameters'
GeoDoubleParamsTag (number of doubles 11)
1.31233e+006 0 -77 38.3 39.45 37.6667 0.304801 6.37814e+006
298.257 0 0.0174533
variable length header record 3 of 5:
reserved 43707
user ID 'LASF_Projection'
record ID 34737
length after header 93
description 'GeoTiff ASCII parameters'
GeoAsciiParamsTag (number of characters 93)
NAD_1983_StatePlane_Maryland_FIPS_1900_Feet|NAVD88 - Geoid09
(Feet)|GCS_North_American_1983|
variable length header record 4 of 5:
reserved 43707
user ID 'NIIRS10'
record ID 4
length after header 10
description 'NIIRS10 Timestamp'
variable length header record 5 of 5:
reserved 43707
user ID 'NIIRS10'
record ID 1
length after header 26
description 'NIIRS10 Tile Index'
the header is followed by 2 user-defined bytes
LASzip compression (version 2.1r0 c2 50000): POINT10 2 GPSTIME11 2
reporting minimum and maximum for all LAS point record entries ...
X -1051999980 -1046000020
Y -263000000 -259000010
Z 274650 966680
intensity 0 255
edge_of_flight_line 0 1
scan_direction_flag 0 1
number_of_returns_of_given_pulse 1 4
return_number 1 4
classification 1 12
scan_angle_rank -24 24
user_data 157 175
point_source_ID 300 303
gps_time 149099.249646 151279.640950
overview over number of returns of given pulse: 2022681 1238634 763644
175759 0 0 0
histogram of classification of points:
952253 Unclassified (1)
1144558 Ground (2)
2994 Low Point (noise) (7)
1206659 Reserved for ASPRS Definition (11)
894254 Overlap Points (12)

---------------------------------------------------------------------------------------------------------------

C:\lastools\bin>lasinfo -i 354_utm.laz
reporting all LAS header entries:
file signature: 'LASF'
file source ID: 0
global_encoding: 0
project ID GUID data 1-4: 0 0 0 ''
version major.minor: 1.2
system identifier: 'LAStools (c) by Martin Isenburg'
generating software: 'las2las (version 120829)'
file creation day/year: 228/2011
header size: 227
offset to point data: 467
number var. length records: 3
point data format: 1
point data record length: 28
number of point records: 4200718
number of points by return: 2940215 917999 298555 43949 0
scale factor x y z: 0.01 0.01 0.001
offset x y z: 2400000 4500000 0
min x y z: 2416757.74 4588658.64 83.713
max x y z: 2418925.27 4590366.69 294.645
variable length header record 1 of 3:
reserved 43707
user ID 'LASF_Projection'
record ID 34735
length after header 40
description 'by LAStools of Martin Isenburg'
GeoKeyDirectoryTag version 1.1.0 number of keys 4
key 1024 tiff_tag_location 0 count 1 value_offset 1 -
GTModelTypeGeoKey: ModelTypeProjected
key 3072 tiff_tag_location 0 count 1 value_offset 26914 -
ProjectedCSTypeGeoKey: PCS_NAD83_UTM_zone_14N
key 3076 tiff_tag_location 0 count 1 value_offset 9001 -
ProjLinearUnitsGeoKey: Linear_Meter
key 4099 tiff_tag_location 0 count 1 value_offset 9001 -
VerticalUnitsGeoKey: Linear_Meter
variable length header record 2 of 3:
reserved 43707
user ID 'NIIRS10'
record ID 1
length after header 26
description 'NIIRS10 Tile Index'
variable length header record 3 of 3:
reserved 43707
user ID 'NIIRS10'
record ID 4
length after header 10
description 'NIIRS10 Timestamp'
the header is followed by 2 user-defined bytes
LASzip compression (version 2.1r0 c2 50000): POINT10 2 GPSTIME11 2
reporting minimum and maximum for all LAS point record entries ...
X 1675774 1892527
Y 8865864 9036669
Z 83713 294645
intensity 0 255
edge_of_flight_line 0 1
scan_direction_flag 0 1
number_of_returns_of_given_pulse 1 4
return_number 1 4
classification 1 12
scan_angle_rank -24 24
user_data 157 175
point_source_ID 300 303
gps_time 149099.249646 151279.640950
overview over number of returns of given pulse: 2022681 1238634 763644
175759 0 0 0
histogram of classification of points:
952253 Unclassified (1)
1144558 Ground (2)
2994 Low Point (noise) (7)
1206659 Reserved for ASPRS Definition (11)
894254 Overlap Points (12)

---------------------------------------------------------------------------------------------------------------

C:\lastools\bin>lasinfo -i 354_clipped.laz
reporting all LAS header entries:
file signature: 'LASF'
file source ID: 0
global_encoding: 0
project ID GUID data 1-4: 0 0 0 ''
version major.minor: 1.2
system identifier: 'LAStools (c) by Martin Isenburg'
generating software: 'lasclip (120829) commercial'
file creation day/year: 228/2011
header size: 227
offset to point data: 467
number var. length records: 3
point data format: 1
point data record length: 28
number of point records: 14386
number of points by return: 8989 3666 1387 344 0
scale factor x y z: 0.01 0.01 0.001
offset x y z: 2400000 4500000 0
min x y z: 2417755.20 4589456.52 114.163
max x y z: 2417841.62 4589560.18 153.754
variable length header record 1 of 3:
reserved 43707
user ID 'LASF_Projection'
record ID 34735
length after header 40
description 'by LAStools of Martin Isenburg'
GeoKeyDirectoryTag version 1.1.0 number of keys 4
key 1024 tiff_tag_location 0 count 1 value_offset 1 -
GTModelTypeGeoKey: ModelTypeProjected
key 3072 tiff_tag_location 0 count 1 value_offset 26914 -
ProjectedCSTypeGeoKey: PCS_NAD83_UTM_zone_14N
key 3076 tiff_tag_location 0 count 1 value_offset 9001 -
ProjLinearUnitsGeoKey: Linear_Meter
key 4099 tiff_tag_location 0 count 1 value_offset 9001 -
VerticalUnitsGeoKey: Linear_Meter
variable length header record 2 of 3:
reserved 43707
user ID 'NIIRS10'
record ID 1
length after header 26
description 'NIIRS10 Tile Index'
variable length header record 3 of 3:
reserved 43707
user ID 'NIIRS10'
record ID 4
length after header 10
description 'NIIRS10 Timestamp'
the header is followed by 2 user-defined bytes
LASzip compression (version 2.1r0 c2 50000): POINT10 2 GPSTIME11 2
reporting minimum and maximum for all LAS point record entries ...
X 1775520 1784162
Y 8945652 8956018
Z 114163 153754
intensity 0 255
edge_of_flight_line 0 0
scan_direction_flag 0 1
number_of_returns_of_given_pulse 1 4
return_number 1 4
classification 1 12
scan_angle_rank -15 -10
user_data 163 172
point_source_ID 301 302
gps_time 149805.491349 150522.166999
overview over number of returns of given pulse: 5320 4572 3141 1353 0
0 0
histogram of classification of points:
3362 Unclassified (1)
3076 Ground (2)
7948 Overlap Points (12)

enzo.campomanesv

unread,
Dec 8, 2014, 3:54:19 AM12/8/14
to last...@googlegroups.com
Hi Martin,

I'm getting a "polygon 1 does not have matching end points error". I want to clip out the powerlines from my las file so I have a powerline-less las file. I have a shapefile of the powerlines. But when I do lasclip, I get the said error. I think that their projections are the same (UTM 51N WGS84) so I don't know why I'm getting this error. Attached is the info of my las and my shapefile.

Thanks.

Enzo
Left_3_pwr.shp
left_3_h_info.txt
Reply all
Reply to author
Forward
0 new messages