Global Mapper Pro Coming Soon

How to calculate accurate lidar coverage / LIDAR_POINT_SIZE value

VincentVincent Global Mapper UserPosts: 34Trusted User

I want to calculate the accurate coverage of lidar points cloud in las format

First attempt with a script to import one by one each las file :

1. Import lidar file: IMPORT TYPE=LIDAR_LAS…

2. Generation of an elevation grid from the previously imported point cloud in las format: GENERATE_ELEV_GRID…

3. calculation of the bounding surface on the newly created TIN: GENERATE_LAYER_ BOUNDS_TYPE=POLYGON…

4. Generation of a report to obtain the covered area (takes into account the holes, great !): GENERATE_REPORT…

The script works perfectly and I do obtain the expected results but it is very long especially for the TIN generation (step 2) since the input lidar files can contain tens of millions of points and extend over large areas, and the obligation to work with high resolutions to obtain accurate results

So I looked for a faster alternative. This alternative works well in the test phase with the graphical interface but I can't script it:

1. import the las file (full resolution, no decimation beforehand)

I define an all black palette whatever the altitude

2. export in black&white geotiff to speed up the process (black covered areas / white not covered areas): EXPORT_RASTER PALETTE=BW...

3. import of the previously created geotiff

4. Creation of the bounding surface: GENERATE_EQUAL_VAL_AREAS...

5. Generation of a report to obtain the covered area (takes into account the holes, great !): GENERATE_REPORT…

In the graphical interface, I can “play” with the size of the lidar points to simulate the coverage, and I get the desired result (accurate and fast).

However, I don't see how to use the LIDAR_POINT_SIZE option in my script.

I always get an error message "ERROR: Parameter LIDAR_POINT_SIZE value must be in range [16,-1]." What is this range [16,-1] ??

I suppose that for each las file processed, I have to calculate the pixel size / geographic resolution equivalence (my las files are in geographic coordinates) but I don't see how to do it?

Thanks for your support

Tagged:

Answers

  • VincentVincent Global Mapper User Posts: 34Trusted User
    Here is the script used :

    GLOBAL_MAPPER_SCRIPT VERSION=1.00
    UNLOAD_ALL

    // DEFINE_VAR NAME="DATA_DIR" PROMPT="DIR" PROMPT_TEXT="Veuillez sélectionner le répertoire de travail:"

    // Custom shader definition "Shader-black"
    DEFINE_SHADER SHADER_NAME="Shader-black" BLEND_COLORS=NO STRETCH_TO_RANGE=NO
    -100.0,RGB(0,0,0)
    12000.0,RGB(0,0,0)
    END_DEFINE_SHADER

    SET_VERT_DISP_OPTS SHADER_NAME="Shader-black"

    SET_OPT AREA_UNITS="SQUARE KILOMETERS"

    DIR_LOOP_START FILENAME_MASKS="*.las" RECURSE_DIR=NO

    // Import of each point cloud in las format, las file in geographic coordinates in the geodetic system wgs84 (EPSG 4326)
    // Issue with the LIDAR_POINT_SIZE value
    IMPORT FILENAME="%FNAME%" TYPE=LIDAR_LAS PROJ="EPSG:4326" LIDAR_DRAW_MODE=ELEV LIDAR_POINT_SIZE=2

    // Export of a black and white GeoTiff representing the point cloud coverage
    EXPORT_RASTER FILENAME="%FNAME_WO_EXT%-Geotiff.tif" TYPE=GEOTIFF SPATIAL_RES=0.00003,0.00003 FORCE_SQUARE_PIXELS=YES PALETTE=BW GEN_WORLD_FILE=YES GEN_PRJ_FILE=YES

    UNLOAD_ALL

    // GeoTiff coverage import
    IMPORT FILENAME="%FNAME_WO_EXT%-Geotiff.tif" TYPE=GEOTIFF

    // Creation of the bounding surface
    GENERATE_EQUAL_VAL_AREAS LAYER_DESC="coverage-geotiff" EQUAL_COLORS=RGB(0,0,0)

    // Export of the bounding surface as a shape
    EXPORT_VECTOR FILENAME="%FNAME_WO_EXT%-coverage.shp" EXPORT_LAYER="coverage-geotiff" TYPE=SHAPEFILE SHAPE_TYPE=AREAS GEN_WORLD_FILE=YES GEN_PRJ_FILE=YES

    // Generation of a report to obtain the covered area
    GENERATE_REPORT OUTPUT_FILENAME="%FNAME_WO_EXT%-report-coverage.csv" FILENAME="coverage-geotiff"

    UNLOAD_ALL

    DIR_LOOP_END

  • bmg_bobbmg_bob Global Mapper Programmer Posts: 2,328
    Hello,

    According to the Scripting Reference, the LIDAR_POINT_SIZE "specifies how large the points in a Lidar point cloud are drawn. The default value of 0 will automatically scale the points to be larger as you zoom in on them. Specify a fixed number to always draw them at a particular size in pixels." That is why it has a valid range of [16,-1].
    In the graphical interface, I can “play” with the size of the lidar points to simulate the coverage, and I get the desired result (accurate and fast).
    Where in the UI do you adjust the lidar point size? I don't understand what is happening when you adjust the size. Could you provide more details? Thanks.

    Cheers,
    Bob
  • VincentVincent Global Mapper User Posts: 34Trusted User
    When I change the lidar point size in the UI, it works perfectly well.
    When I try to use the lidar point size in a script (for example LIDAR_POINT_SIZE=2), I get an error message in the log console: "ERROR: Parameter LIDAR_POINT_SIZE value must be in range [16,-1]
    In the user interface I can adjust the value for this parameter between 1 to 16.
    So in my script, I use a value between 1 to 16 but except if I use the value 16, I get an error message.
    (I use GM v 20.1.2)
    But in the UI the size in pixel makes automaticaly sense.
    I suppose that additional information are required in the script to make a ling between the lidar coordinates and a size in pixel. But I don't find how to manage this equivalence
    Thanks


  • bmg_bobbmg_bob Global Mapper Programmer Posts: 2,328
    Hello,

    Global Mapper should not be displaying that message in your case. That is a bug that is fixed in Global Mapper 22.1.

    Having said that, the LIDAR_POINT_SIZE is only used when displaying lidar data. Can you explain what you are trying to accomplish by changing the value?

    Cheers,
    Bob
  • VincentVincent Global Mapper User Posts: 34Trusted User
    Thanks Bob for your reply
    I tried to use the lidar point size to simulate quickly the lidar coverage but it doesn't make a sense in a script.
    I went back to my initial idea to produce a TIN from the point cloud and generate the coverage of the TIN. After some adjustments, it works pretty fast with very accurate results.
Sign In or Register to comment.