[pdal] Fixing the topology of the hexagon coverage from density

Jukka Rahkonen jukka.rahkonen at latuviitta.fi
Thu Dec 12 08:01:08 PST 2019


Hi,

I did a test with command

pdal density --driver readers.text  --readers.text.header="x y z" 
--filters.hexbin.precision=4 test.csv 4prec.shp

Precision option is documented to set the minimum precision and so it 
seems to be. Here are three adjacent polygons as an example.

POLYGON ((590196.8408004533 6855474.9200985655, 590181.6192204552 
6855501.2846485, 590196.8408004533 6855527.649198435, 590227.2839604495 
6855527.649198435, 590242.5055404477 6855501.2846485, 590227.2839604495 
6855474.9200985655, 590196.8408004533 6855474.9200985655))

POLYGON ((590196.8408004533 6855527.649198434, 590181.6192204552 
6855554.013748369, 590196.8408004533 6855580.378298304, 
590227.2839604495 6855580.378298304, 590242.5055404477 
6855554.013748369, 590227.2839604495 6855527.649198434, 
590196.8408004533 6855527.649198434))

POLYGON ((590151.1760604589 6855501.2846485, 590135.9544804607 
6855527.649198435, 590151.1760604589 6855554.01374837, 590181.6192204551 
6855554.01374837, 590196.8408004532 6855527.649198435, 590181.6192204551 
6855501.2846485, 590151.1760604589 6855501.2846485))

Polygons have one small gap and two overlaps around here because of 
non-snapped vertices:


Kohteen ID: 187271
[       0:2] POINT (590196.8408004533 6855527.649198435)
Kohteen ID: 187272
[       0:0] POINT (590196.8408004533 6855527.649198434)
Kohteen ID: 187273
[       0:4] POINT (590196.8408004532 6855527.649198435)



-Jukka Rahkonen-


Andrew Bell kirjoitti 2019-12-12 14:38:
> You should be able to do this by passing the precision argument to the
> hexbin filter.  For example: `--filters.hexbin.density=5`.
> 
> If this doesn't work, please let me know.
> 
> On Thu, Dec 12, 2019 at 3:26 AM Jukka Rahkonen
> <jukka.rahkonen at latuviitta.fi> wrote:
> 
>> Hi,
>> 
>> I noticed that the vertices of the hexagon cells that "pdal density"
>> 
>> writes out do not match exactly. It means that it is not easy to
>> union
>> the output into one polygon with GIS tools. The issue can be fixed
>> by
>> reducing the precision of coordinates with the PostGIS ST_Snap or
>> similar tool. With a projected CRS it was enough to round the
>> coordinates into 5 decimal places. It might be good to have a
>> coordinate
>> rounding option directly in the density tool.
>> 
>> -Jukka Rahkonen-
>> _______________________________________________
>> pdal mailing list
>> pdal at lists.osgeo.org
>> https://lists.osgeo.org/mailman/listinfo/pdal
> 
> --
> Andrew Bell
> andrew.bell.ia at gmail.com


More information about the pdal mailing list