Export raster from lidar .LAS intensity not working in script

JJKJJK Global Mapper UserPosts: 11Trusted User
edited March 2014 in GM Script Language
Hi, Mike

I'm trying to automate the creation of raster GeoTIFF images from loaded lidar .LAS point cloud tiles (using version 14.2; we don't have our enterprise license for v15 yet). First I import a lidar tile using Color by Intensity option (see attached image), then immediately export-raster to an 8-bit GeoTIFF.

It works just fine interactively using the viewer, but when I copy the code from the saved .gmw workspace file into my custom script, I get the following No-data-found error/warning:

Global Mapper v14.2 (b082813) [64-bit] - REGISTERED
Removed all loaded overlays.
Importing file E:\jjk\GRSM_Great_Smoky_Mountains_for_GAP\field_points_2013\test_Intensity\17SKV280345.las...
Exporting raster data to file test_geo.tif...
WARNING: No data found to export for EXPORT_RASTER command within specified bounds.


... and here's the import code (which was copied from the working interactive .gmw workspace file) that gives the above message:
GLOBAL_MAPPER_SCRIPT VERSION="1.00"
SET_LOG_FILE FILENAME="test.log"


UNLOAD_ALL


IMPORT FILENAME="E:\jjk\GRSM_Great_Smoky_Mountains_for_GAP\field_points_2013\test_Intensity\test_data.las" \
TYPE="LIDAR_LAS" ELEV_UNITS="METERS" LABEL_FIELD_FORCE_OVERWRITE="NO" LOAD_FLAGS="0,262.650,0,262142~0~0~0~0~0~0~0,,4294967295,0.00" \
LIDAR_DRAW_MODE="INTENSITY" LIDAR_POINT_SIZE="0" LIDAR_DRAW_QUALITY="50" SAMPLING_METHOD="NEAREST_NEIGHBOR" \
AUTO_CONTRAST="NO" CONTRAST_SHARED="YES" CONTRAST_MODE="NONE" CLIP_COLLAR="NONE" \
TEXTURE_MAP="NO"


EXPORT_RASTER FILENAME="test_geo.tif" \
TYPE=GEOTIFF PALETTE=OPTIMIZED \
SPATIAL_RES="1.5000000,1.5000000" FORCE_SQUARE_PIXELS=YES \
COMPRESSION=PACKBITS QUALITY=95 FILL_GAPS=YES \
SAVE_SCALE_AND_LEGEND=NO


UNLOAD_ALL



Any ideas? I tried the script import without some of the diplay options, to no avail. I've also attached the small test_data.LAS file (zipped) for you to try to duplicate this. Nice talking with you at ILMF last month. Thanks.


>>John

Comments

  • global_mapperglobal_mapper Administrator Posts: 17,238
    edited March 2014
    If you add INC_VECTOR_DATA=YES to the EXPORT_RASTER command does the data export then? The Lidar point cloud data counts as a vector layer when not gridded, so you need to specify to include vector data to output a rendered copy in the raster.

    Thanks,

    Mike
    Global Mapper Guru
    geohelp@bluemarblegeo.com
    Blue Marble Geographics for Coordinate Conversion, Image Reprojection and Vector Translation
  • JJKJJK Global Mapper User Posts: 11Trusted User
    edited March 2014
    Mike,

    I added INC_VECTOR_DATA=YES to the script, but still get a Data-not-found warning:


    Running Script at: 03/06/14 07:38:21
    Global Mapper v14.2 (b082813) [64-bit] - REGISTERED
    Removed all loaded overlays.
    Importing file E:\jjk\GRSM_Great_Smoky_Mountains_for_GAP\field_points_2013\test_Intensity\test_data.las...
    Exporting raster data to file test_3_geo.tif...
    WARNING: No data found to export for EXPORT_RASTER command within specified bounds.
    Removed all loaded overlays.
    Script processing COMPLETED [End Time: 03/06/14 07:38:22, Elapsed Time: 0.359 seconds]




    The script code is:


    GLOBAL_MAPPER_SCRIPT VERSION="1.00"
    SET_LOG_FILE FILENAME="test_3.log"
    UNLOAD_ALL
    IMPORT FILENAME="test_data.las" TYPE="LIDAR_LAS" LIDAR_DRAW_MODE="INTENSITY" \
    ELEV_UNITS="METERS" \
    PROMPT_IF_TYPE_UNKNOWN=NO CLIP_COLLAR=NONE \
    LOAD_FLAGS="0,262.650,0,262142~0~0~0~0~0~0~0,,4294967295,0.00"
     
    EXPORT_RASTER FILENAME="test_3_geo.tif" INC_VECTOR_DATA=YES TYPE=GEOTIFF \
    PALETTE=OPTIMIZED \
    SPATIAL_RES="1.5000000,1.5000000" FORCE_SQUARE_PIXELS=YES \
    COMPRESSION=PACKBITS QUALITY=95 FILL_GAPS=YES \
    SAVE_SCALE_AND_LEGEND=NO \
    UNLOAD_ALL
  • global_mapperglobal_mapper Administrator Posts: 17,238
    edited March 2014
    I took a look and found that rendered Lidar point clouds weren't supported for the EXPORT_RASTER command. I have added support for this in the latest build. I have placed a new build at http://www.bluemarblegeo.com/downloads/global-mapper/global_mapper15.zip with the latest changes for you to try. Simply download that file and extract the contents into your existing v15.xx installation folder to give it a try. If you are using the 64-bit v15 version there is a new build at http://www.bluemarblegeo.com/downloads/global-mapper/global_mapper15_64bit.zip .

    If you are stuck on v14 the workaround would be to export the Lidar points to a normal vector format, like a Shapefile with style attributes, then load that back in and use EXPORT_RASTER.

    Thanks,

    Mike
    Global Mapper Guru
    geohelp@bluemarblegeo.com
    Blue Marble Geographics for Coordinate Conversion, Image Reprojection and Vector Translation
  • JJKJJK Global Mapper User Posts: 11Trusted User
    edited March 2014
    Thanks for the quick response, Mike. That's great!

    >>John
  • avisseavisse Posts: 1
    I'm working on W7, GM17. I'm triying to use EXPORT_RASTER script. I have IMPORT_ASCII TYPE=LIDAR / tif and a shape. I have a mistake when the Lidar is Loaded. The script :
    GLOBAL_MAPPER_SCRIPT VERSION=1.00
    UNLOAD_ALL


    IMPORT FILENAME=image.tif

    IMPORT_ASCII FILENAME=point.xyz PROJ="EPSG:4326" \
            TYPE=LIDAR COORD_DELIM=AUTO COORD_ORDER=X_FIRST \
            SKIP_ROWS=3 \
            COORD_SCALE=0,0,-1 \
            ELEV_FIELD=ELEVATION \
            SHADER_NAME=homonim_100m \
           
    IMPORT FILENAME=contour.shp TYPE=SHAPEFILE SHOW_LABELS=NO
    EDIT_VECTOR SHAPE_TYPE="AREAS" STYLE_ATTR="BORDER_COLOR=RGB(255,0,0)" STYLE_ATTR="BORDER_STYLE=Solid FILL" STYLE_ATTR="LINE_WIDTH=4"


    EXPORT_RASTER FILENAME=imagette.jpg TYPE=jpeg INC_VECTOR_DATA=YES SPATIAL_RES="200%,200%"

    UNLOAD_ALL

    Thanks for help !
Sign In or Register to comment.