Forum

Author Topic: Point Grid from Mesh  (Read 4635 times)

dpitman

  • Full Member
  • ***
  • Posts: 246
    • View Profile
Point Grid from Mesh
« on: August 25, 2021, 02:36:37 AM »
re: topographic surface mesh.

I am sometimes asked for a grid of points (xyz in project CRS) rather than a 3D mesh.  I don't think there is a way to accomplish this in the GUI but I thought I'd ask if this can be accomplished with scripting.  For example, from the surface mesh extract a point every 10' x and y.  A 100 acre surface would result in approximately 43,600 points evenly spaced at 10' x and y.

Possible?

Thank you,
Dave

Paulo

  • Hero Member
  • *****
  • Posts: 1320
    • View Profile
Re: Point Grid from Mesh
« Reply #1 on: August 25, 2021, 03:32:04 AM »
Hello Dave,

I see 2 ways to do this:
  • use Sample points from Tools/Dense Cloud menu and enter 10 ' in dialog. But I am not sure the point spacing will exactly be regularly spaced;
  • from the DEM, use export with pixel spacing 10 ' in X and Y and use Arc Grid format or XYZ grid. This way you will get a grid exaclly spaced...

Hope this can be helpful,
« Last Edit: August 25, 2021, 03:34:43 AM by Paulo »
Best Regards,
Paul Pelletier,
Surveyor

dpitman

  • Full Member
  • ***
  • Posts: 246
    • View Profile
Re: Point Grid from Mesh
« Reply #2 on: August 25, 2021, 05:44:07 AM »
Hi Paulo,

The dense cloud > sample points way seems to provide a grid that is pretty close. Nice!

For the DEM, I don't see those export options.

I really appreciate your help, thank you! Dave


Paulo

  • Hero Member
  • *****
  • Posts: 1320
    • View Profile
Re: Point Grid from Mesh
« Reply #3 on: August 25, 2021, 06:05:00 AM »
Great, Dave,

in Export DEM choose 1st option (Export TIF/BIL/XYZ...), define the output resolution (XY pixe size), coordinate system and any other options you need in Export DEM dialog and then use Export...  button to define your export file name and type. In drop down type menu you can choose  XYZ for grid formats....see following....
« Last Edit: August 25, 2021, 06:16:43 AM by Paulo »
Best Regards,
Paul Pelletier,
Surveyor

dpitman

  • Full Member
  • ***
  • Posts: 246
    • View Profile
Re: Point Grid from Mesh
« Reply #4 on: August 25, 2021, 06:31:13 AM »
I see Pixel "size" but not "spacing".  Isn't this going to export a raster of some sort rather than points?

Paulo

  • Hero Member
  • *****
  • Posts: 1320
    • View Profile
Re: Point Grid from Mesh
« Reply #5 on: August 25, 2021, 06:56:44 AM »
Yes but if you choose XYZ as file type then the exported file will be a grid with a point at every pixel size X Y... In my case I exported a DEM in XYZ format with 3.048 m size or spacing and see result in Global mapper...
Best Regards,
Paul Pelletier,
Surveyor

dpitman

  • Full Member
  • ***
  • Posts: 246
    • View Profile
Re: Point Grid from Mesh
« Reply #6 on: August 25, 2021, 07:06:05 AM »
I'm doing something wrong.  In the dialog I set x & y to 2 (meters) and then when I try to export as .xyz I get a warning "empty raster".

dpitman

  • Full Member
  • ***
  • Posts: 246
    • View Profile
Re: Point Grid from Mesh
« Reply #7 on: August 25, 2021, 07:08:20 AM »
I do not have Global mapper.  It is also able to generate a point grid, yes?  Have you done any feature extraction with Global Mapper?  I am considering getting it.

Paulo

  • Hero Member
  • *****
  • Posts: 1320
    • View Profile
Re: Point Grid from Mesh
« Reply #8 on: August 25, 2021, 07:25:43 AM »
Global Mapper is very good at reading/exporting multitudes of file formats...

So to generate a point grid elevation file from a loaded tif elevation file, you just do Create Point Features at grid cell centers and you will get a grid of elevation points superimposed on your original Tif DSM... see following...

« Last Edit: August 25, 2021, 07:36:43 AM by Paulo »
Best Regards,
Paul Pelletier,
Surveyor

Alexey Pasumansky

  • Agisoft Technical Support
  • Hero Member
  • *****
  • Posts: 14847
    • View Profile
Re: Point Grid from Mesh
« Reply #9 on: August 25, 2021, 11:03:25 AM »
I'm doing something wrong.  In the dialog I set x & y to 2 (meters) and then when I try to export as .xyz I get a warning "empty raster".

Hello Dave,

Do you actually set 2 meters for X and Y (via "Meters" button)? If you input 2 value as degrees, the "empty raster" error will appear, as 2 degrees is a very low resolution.
Best regards,
Alexey Pasumansky,
Agisoft LLC

dpitman

  • Full Member
  • ***
  • Posts: 246
    • View Profile
Re: Point Grid from Mesh
« Reply #10 on: August 25, 2021, 04:32:03 PM »

Hello Dave,

Do you actually set 2 meters for X and Y (via "Meters" button)? If you input 2 value as degrees, the "empty raster" error will appear, as 2 degrees is a very low resolution.

Hi Alexey.  That was my mistake.  The workflow Paulo suggested works when done properly. 

Why does the grid of points obtained from the first method, using sample points on a mesh, result in a grid of points without precise spacing?  The DEM method seems to result in a precisely spaced grid of points.

Also, in the DEM workflow, it would be helpful if exporting to .dxf was an option. 

Thank you!
Dave
« Last Edit: August 25, 2021, 04:39:30 PM by dpitman »

dpitman

  • Full Member
  • ***
  • Posts: 246
    • View Profile
Re: Point Grid from Mesh
« Reply #11 on: August 25, 2021, 04:37:03 PM »
Global Mapper is very good at reading/exporting multitudes of file formats...

So to generate a point grid elevation file from a loaded tif elevation file, you just do Create Point Features at grid cell centers and you will get a grid of elevation points superimposed on your original Tif DSM... see following...

Nice.  You can then export the points to a file?

It looks like Global Mapper is also working on a revised product they call Global Mapper Pro that is supposed to have some better feature extraction tools.  I sometimes get asked to generate some terrain and infrastructure (curbs, gutters, etc.) break lines, so that might also be a plus.

Thanks again, so much Paulo.  The grid of points workflows in MS are very helpful for me!

Paulo

  • Hero Member
  • *****
  • Posts: 1320
    • View Profile
Re: Point Grid from Mesh
« Reply #12 on: August 25, 2021, 11:04:22 PM »
Quote
Why does the grid of points obtained from the first method, using sample points on a mesh, result in a grid of points without precise spacing?  The DEM method seems to result in a precisely spaced grid of points.

My feeling and maybe Alexey can confirm, is that Sample points from Mesh is basically a 3D sampling method so points may have a very small spacing (much less than input spacing value) in plan (XY) but in 3D the spacing will be close to input spacing. This would be the case in steep areas (walls, trees, etc.). See extract from GM where I have side by sise a plan view (left) and 3d view (right) of portion of sampled points (3 m spacing) exported from Metashape. The 2 selected points are very close in plan but distance in Z (3D view) is close to 3 m....
Best Regards,
Paul Pelletier,
Surveyor

dpitman

  • Full Member
  • ***
  • Posts: 246
    • View Profile
Re: Point Grid from Mesh
« Reply #13 on: August 26, 2021, 02:40:26 AM »

My feeling and maybe Alexey can confirm, is that Sample points from Mesh is basically a 3D sampling method so points may have a very small spacing (much less than input spacing value) in plan (XY) but in 3D the spacing will be close to input spacing. This would be the case in steep areas (walls, trees, etc.). See extract from GM where I have side by sise a plan view (left) and 3d view (right) of portion of sampled points (3 m spacing) exported from Metashape. The 2 selected points are very close in plan but distance in Z (3D view) is close to 3 m....

Paulo, that is a very reasonable hypothesis.  I've found another benefit of the point grid. I brought a 5' point grid (exported using the DEM method) into QGIS and then extracted contours from that.  The contours came out way more "pleasing" than from the entire DEM.  While not as accurate, the result is more in line with what most folks expect contours to look like.

I have a client right now (that prompted this query) that wants a point grid at 10' xy for the entire 100 acre site and then dense triangle mesh for particular topography of interest.  So, this new understanding will be put to use straight away.

Thanks again, Paulo.  I'm not sure how you learned all of this, but I'm happy you are willing to help!

Dave