Las to shp with attributes

2,622 views
Skip to first unread message

TerraMap

unread,
Feb 7, 2015, 5:14:37 PM2/7/15
to last...@googlegroups.com
I notice that Las2shp does not export point attributes to the shp file. eg class, intensity elevation etc. I can do it by exporting via a txt file but that seems to be very inefficient. I there a better way of doing it. Thanks

Albert Godfrind

unread,
Feb 8, 2015, 5:45:17 AM2/8/15
to last...@googlegroups.com
What do you mean by "inefficient" ? Is the export taking too long ? Or do you have problem using the txt format - i.e is it too slow to process ?

What are you exporting the points for ?

Albert
--
Albert Godfrind
+33 6 09 97 27 23
Sent from my iPhone

On 7 févr. 2015, at 23:14, TerraMap <apw....@gmail.com> wrote:

I notice that Las2shp does not export point attributes to the shp file. eg class, intensity elevation etc. I can do it by exporting via a txt file but that seems to be very inefficient. I there a better way of doing it. Thanks

TerraMap

unread,
Feb 8, 2015, 3:29:30 PM2/8/15
to last...@googlegroups.com
Our client requires tiled las files to be exported to attributed shp files. I am assuming they have lots of different user requirements and shp is the most widely read. Its about 100GB data in 7500 tiles.
Actually it didn't work. Export to txt file using:

las2txt -i *.las -parse xyzirtc 

I get:
1750240.78 5951040.71 17.70 69 1 58133900.086018 2

Which has all required attributes for the point.

I now need to get it to a shp file but I only get the height attribute using:

las2shp -i *.txt -iparse xyzirtc

Or

las2shp -i *.txt

Ideally I would like to go from Las direct to attributel shp.

Any ideas anyone?

Thanks

Kirk Waters - NOAA Federal

unread,
Feb 9, 2015, 10:10:55 AM2/9/15
to LAStools - efficient command line tools for LIDAR processing
I think a lot of the issue you're having is related to balancing efficiency with the structure of a shapefile. For each shape in a shapefile, you have exactly one record in the dbf file holding the attributes. So, to do what you want, you need to have each shape be a single point. las2shp uses a multi-point shape type, which is going to be much more efficient in terms of both disk space and functionality. This is because each shape contains the bounding box information, so doing single points effectively triples (at least) the size of the file. You have the point, the point again as one corner of a box, and the point a third time as the other corner. Similarly, when using the file, a program will have to check each point's bounding box to see if it is in the area of interest instead of checking one bounding box for a large group of points.

At a minimum, you would need to specify the -single_points option just to have a file type that could hold what you want. That still might not get what you want, but you would then have the possibility of extracting those attributes separately and creating a dbf file with them.

Regards,
Kirk
--

Kirk Waters, PhD                     | NOAA Office for Coastal Management
Applied Sciences Program      | 2234 South Hobson Ave
843-740-1227                          | Charleston, SC 29405    

--

TerraMap

unread,
Feb 9, 2015, 5:32:32 PM2/9/15
to last...@googlegroups.com
Thanks for the info on shp format.
Nothing I try in las2shp seems to give me attributes in my shp file. I tried -single_points flag and I get an elevation attribute but I also require GPS time, Intensity, Class, Return, etc. I am beginning think that outputting point attributes to shp format is not available with las2shp and I have no idea how to do it separately

Martin Isenburg

unread,
Feb 9, 2015, 5:46:00 PM2/9/15
to LAStools - efficient command line tools for LIDAR processing

Hello,

This is correct. The (venerable) las2shp tool was written in the "good old days" when LiDAR surveys were small and point densities low so one could on occasions try to load the (at least the key-) points into the ArcGIS software for triangulation and rasterization or contouring. Only the xyz coordinates are exported and the DBF files are not populated. I usually tell people "if you want to convert LAS to SHP then your workflow must be highly suboptimal" ... (-:

Martin @rapidlasso

Evon Silvia

unread,
Feb 9, 2015, 7:43:24 PM2/9/15
to last...@googlegroups.com
We needed to do this for a client a couple years ago, both as shapefiles and as a FileGeodatabase... not pretty at all once your files hit the millions of points. We ended up coding our own shapefile converter since nothing I could find performed fast enough to meet our deadline - literally WEEKS of processing time to do a simple conversion.

Still, it's a very archaic way to view a point cloud - I'm surprised Martin even supports the "venerable" las2shp any more. :)

If I remember correctly Blue Marble's Geographic Calculator (and maybe Global Mapper) might be able to do what you want, but it was pretty slow (I'm not affiliated with them, btw, except as a customer). I think I might have my converter laying around somewhere...

Evon

TerraMap

unread,
Feb 9, 2015, 8:16:24 PM2/9/15
to last...@googlegroups.com

We usually use GlobalMapper to create our shp files but unfortunately GM puts some extra info into the CLASS attribute which our client does not like. Using 4 machines takes us about 12 hours and as Martin says is “highly suboptimal”. I could edit the dbf files but that may open another can of worms so a simple solution would be preferable. I’d be interested in giving your converter a try.

Thanks.

David Richey

unread,
Jun 6, 2016, 8:22:47 PM6/6/16
to LAStools - efficient tools for LiDAR processing
Hello:

It may be sub optimal, but I am interested in attaching the attributes for small samples of the point cloud for visualization purposes. Having the set of attributes available for rendering the qualities of the points illuminates my own understanding of the data and is valuable for conveying aspects of the data to others. I'll work around this, but it would be valuable to me to have the ability to export individual points with a choice of attributes.

Thanks!

David Richey
GIS Analyst
Lane Council of Governments

Nicolas Cadieux

unread,
Jun 6, 2016, 10:44:47 PM6/6/16
to last...@googlegroups.com

Hi,
Using a shp file for lidar data is a very bad idea if you have anything more than a few thousand points. Anything more and the user will not use it as loading it will be very slow and painful at best.  It will be impossible over a file server.

If you need to see the file, I recommend using las2txt and then Cloud Compare (CC) software.  With that, you can see what you have and visualize the data by field types.  (It will also work with .las files).

The txt files can also be imported in ArcGis I guess or in QGIS (my preference).  That is already much faster than using a shp file but slower than a specialized point viewer like CC or the lastools viewer.  You could also rasterize the data in 1m pixel posting to view it more effectively in a GIS.

If you really want to use shape files with all the attributes, you could import the txt files directly in Qgis and convert them to shape files with all the fields.  You can most likely use the processing plugin to script the workflow.  The best would be to use GDAL translate directly in a loop. I would keep the files tiles under 1000x1000m for a 1 to 4 pt-m density.   I imagine this can also all be done in ArcGIS.

Nicolas

Martin Isenburg

unread,
Jan 22, 2017, 8:05:49 AM1/22/17
to LAStools - efficient command line tools for LIDAR processing
Hello,

las2shp is finally able to also produce a DBF file that contains all the other point attributes available in a LAS/LAZ file as you can see in the attached screen. 

Regards,

Martin @rapidlasso

--
las2shp_export_dbf.png

Irf

unread,
Jan 24, 2017, 10:28:37 PM1/24/17
to LAStools - efficient tools for LiDAR processing
Hi Martin,
Thanks for this. May I suggest that the output DBF should also include xy coordinates? This will save the an additional step of adding XY in arcgis or a similar software package.

Kind regards,
Irfan

Martin Isenburg

unread,
Jan 30, 2017, 9:14:29 PM1/30/17
to LAStools - efficient command line tools for LIDAR processing
Hi Irfan,

Okay. I won't add it in the GUI (out of space) but I make it possible to add 'x' and 'y' into the parse string in the next version.

Regards,

Martin

Irf

unread,
Mar 22, 2017, 7:49:57 AM3/22/17
to LAStools - efficient tools for LiDAR processing
Hi Martin,

Thank you for adding the 'x' and 'y' into parsing. I spent some time outputting shapefiles using the -single_points flag in the las2shp GUI (figure 001). I tried to open the resulting shapefile in QGIS as well as ArcMap, but both refused to show what one would.

First I used:

las2shp -i fusa.laz -single_points -parse irnupt -fusa_parse.shp

The result was fusa_parse.shp, showing one point only (figure 003) but the attribute table had all the records (figure 004). During loading, ArcMap warned of an 'inconsistent extent' (figure 002). My feeling is that the output isn't actually one point only but all points were on top of each other (same xy coords).

No parsing (figure 005) will show all points but without attribute data in the dbf (006).

I reckon there's an itsy-bitsy glitch in the code. It would be great to hear from you on this.

Kind regards,
Irf
001_las2shp_gui_parse.png
002_Argh_Warning.png
003_fusa_parse_single_points.png
004_fusa_parse_single_points_table.png
005_fusa_no_parse_single_points.png
006_fusa_no_parse_single_points_table.png

Martin Isenburg

unread,
Mar 23, 2017, 9:35:42 AM3/23/17
to LAStools - efficient command line tools for LIDAR processing
Hello,

I must have introduced a silly little bug when I added the 'x' and 'y' option. This was fixed in the release yesterday (170322) and the example below opens fine in QGIS. Not sure about the Arggghhh software ...

las2las -i ..\data\fusa.laz ^
            -subseq 0 1000 ^
            -o fusa1000.laz

las2shp -i fusa1000.laz ^
             -parse xyzirnupt
             -o fusa1000.shp ^

A nasty bug in lassort was squashed as well. If you had downloaded version 170313 in the 8 days it was online then please make sure to switch to the fixed version 170322 as there was a bug in sorting point types 0 through 5.

Regards,

Martin @rapidlasso

Irf

unread,
Mar 23, 2017, 8:10:23 PM3/23/17
to LAStools - efficient tools for LiDAR processing
Hi Martin,

Thanks for fixing this and for the heads-up. 'las2shp' works like a charm now :). The output opens both in QGIS and ArcMap.

Cheers,
Irfan
Reply all
Reply to author
Forward
0 new messages