Skip to content
Permalink
Browse files

Test that point cloud with rgb attributes defaults to rgb renderer

  • Loading branch information
nyalldawson committed Nov 16, 2020
1 parent d6647b7 commit f2135b37bd5f291f5e42fbb2f0a53376b6358eb8
@@ -208,6 +208,7 @@ ADD_PYTHON_TEST(PyQgsPathResolver test_qgspathresolver.py)
ADD_PYTHON_TEST(PyQgsPoint test_qgspoint.py)
ADD_PYTHON_TEST(PyQgsPointCloudAttributeComboBox test_qgspointcloudattributecombobox.py)
ADD_PYTHON_TEST(PyQgsPointCloudAttributeModel test_qgspointcloudattributemodel.py)
ADD_PYTHON_TEST(PyQgsPointCloudRgbRenderer test_qgspointcloudrgbrenderer.py)
ADD_PYTHON_TEST(PyQgsPointClusterRenderer test_qgspointclusterrenderer.py)
ADD_PYTHON_TEST(PyQgsPointDisplacementRenderer test_qgspointdisplacementrenderer.py)
ADD_PYTHON_TEST(PyQgsProcessExecutable test_qgsprocessexecutable.py)
@@ -0,0 +1,39 @@
# -*- coding: utf-8 -*-
"""QGIS Unit tests for QgsPointCloudRgbRenderer
.. note:: This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
"""
__author__ = 'Nyall Dawson'
__date__ = '09/11/2020'
__copyright__ = 'Copyright 2020, The QGIS Project'

import qgis # NOQA

from qgis.core import (
QgsProviderRegistry,
QgsPointCloudLayer,
QgsPointCloudRgbRenderer
)

from qgis.testing import start_app, unittest
from utilities import unitTestDataPath

start_app()


class TestQgsPointCloudRgbRenderer(unittest.TestCase):

@unittest.skipIf('ept' not in QgsProviderRegistry.instance().providerList(), 'EPT provider not available')
def testSetLayer(self):
layer = QgsPointCloudLayer(unitTestDataPath() + '/point_clouds/ept/rgb/ept.json', 'test', 'ept')
self.assertTrue(layer.isValid())

# test that a point cloud with RGB attributes is automatically assigned the RGB renderer by default
self.assertIsInstance(layer.renderer(), QgsPointCloudRgbRenderer)


if __name__ == '__main__':
unittest.main()
@@ -0,0 +1,6 @@
{
"maxNodeSize": 65536,
"minNodeSize": 16384,
"software": "Entwine",
"version": "2.1.0"
}
Binary file not shown.
@@ -0,0 +1,3 @@
{
"0-0-0-0": 134
}
@@ -0,0 +1,282 @@
{
"bounds": [
497753.69,
7050887.61,
0.98,
497754.4,
7050888.39,
1.25
],
"metadata": {
"readers.las": {
"comp_spatialreference": "PROJCS[\"WGS 84 / UTM zone 56S\",GEOGCS[\"WGS 84\",DATUM[\"WGS_1984\",SPHEROID[\"WGS 84\",6378137,298.257223563,AUTHORITY[\"EPSG\",\"7030\"]],AUTHORITY[\"EPSG\",\"6326\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.0174532925199433,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4326\"]],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER[\"central_meridian\",153],PARAMETER[\"scale_factor\",0.9996],PARAMETER[\"false_easting\",500000],PARAMETER[\"false_northing\",10000000],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],AXIS[\"Easting\",EAST],AXIS[\"Northing\",NORTH],AUTHORITY[\"EPSG\",\"32756\"]]",
"compressed": false,
"count": 134,
"creation_doy": 316,
"creation_year": 2020,
"dataformat_id": 3,
"dataoffset": 429,
"filesource_id": 13745,
"global_encoding": 0,
"global_encoding_base64": "AAA=",
"header_size": 227,
"major_version": 1,
"maxx": 497754.4,
"maxy": 7050888.39,
"maxz": 1.25,
"minor_version": 2,
"minx": 497753.69,
"miny": 7050887.61,
"minz": 0.98,
"offset_x": 0,
"offset_y": 0,
"offset_z": 0,
"point_length": 34,
"project_id": "00000000-0000-0000-0000-000000000000",
"scale_x": 0.01,
"scale_y": 0.01,
"scale_z": 0.01,
"software_id": "PDAL 2.1.0 (Releas)",
"spatialreference": "PROJCS[\"WGS 84 / UTM zone 56S\",GEOGCS[\"WGS 84\",DATUM[\"WGS_1984\",SPHEROID[\"WGS 84\",6378137,298.257223563,AUTHORITY[\"EPSG\",\"7030\"]],AUTHORITY[\"EPSG\",\"6326\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.0174532925199433,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4326\"]],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER[\"central_meridian\",153],PARAMETER[\"scale_factor\",0.9996],PARAMETER[\"false_easting\",500000],PARAMETER[\"false_northing\",10000000],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],AXIS[\"Easting\",EAST],AXIS[\"Northing\",NORTH],AUTHORITY[\"EPSG\",\"32756\"]]",
"srs": {
"compoundwkt": "PROJCS[\"WGS 84 / UTM zone 56S\",GEOGCS[\"WGS 84\",DATUM[\"WGS_1984\",SPHEROID[\"WGS 84\",6378137,298.257223563,AUTHORITY[\"EPSG\",\"7030\"]],AUTHORITY[\"EPSG\",\"6326\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.0174532925199433,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4326\"]],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER[\"central_meridian\",153],PARAMETER[\"scale_factor\",0.9996],PARAMETER[\"false_easting\",500000],PARAMETER[\"false_northing\",10000000],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],AXIS[\"Easting\",EAST],AXIS[\"Northing\",NORTH],AUTHORITY[\"EPSG\",\"32756\"]]",
"horizontal": "PROJCS[\"WGS 84 / UTM zone 56S\",GEOGCS[\"WGS 84\",DATUM[\"WGS_1984\",SPHEROID[\"WGS 84\",6378137,298.257223563,AUTHORITY[\"EPSG\",\"7030\"]],AUTHORITY[\"EPSG\",\"6326\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.0174532925199433,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4326\"]],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER[\"central_meridian\",153],PARAMETER[\"scale_factor\",0.9996],PARAMETER[\"false_easting\",500000],PARAMETER[\"false_northing\",10000000],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],AXIS[\"Easting\",EAST],AXIS[\"Northing\",NORTH],AUTHORITY[\"EPSG\",\"32756\"]]",
"isgeocentric": false,
"isgeographic": false,
"prettycompoundwkt": "PROJCS[\"WGS 84 / UTM zone 56S\",\n GEOGCS[\"WGS 84\",\n DATUM[\"WGS_1984\",\n SPHEROID[\"WGS 84\",6378137,298.257223563,\n AUTHORITY[\"EPSG\",\"7030\"]],\n AUTHORITY[\"EPSG\",\"6326\"]],\n PRIMEM[\"Greenwich\",0,\n AUTHORITY[\"EPSG\",\"8901\"]],\n UNIT[\"degree\",0.0174532925199433,\n AUTHORITY[\"EPSG\",\"9122\"]],\n AUTHORITY[\"EPSG\",\"4326\"]],\n PROJECTION[\"Transverse_Mercator\"],\n PARAMETER[\"latitude_of_origin\",0],\n PARAMETER[\"central_meridian\",153],\n PARAMETER[\"scale_factor\",0.9996],\n PARAMETER[\"false_easting\",500000],\n PARAMETER[\"false_northing\",10000000],\n UNIT[\"metre\",1,\n AUTHORITY[\"EPSG\",\"9001\"]],\n AXIS[\"Easting\",EAST],\n AXIS[\"Northing\",NORTH],\n AUTHORITY[\"EPSG\",\"32756\"]]",
"prettywkt": "PROJCS[\"WGS 84 / UTM zone 56S\",\n GEOGCS[\"WGS 84\",\n DATUM[\"WGS_1984\",\n SPHEROID[\"WGS 84\",6378137,298.257223563,\n AUTHORITY[\"EPSG\",\"7030\"]],\n AUTHORITY[\"EPSG\",\"6326\"]],\n PRIMEM[\"Greenwich\",0,\n AUTHORITY[\"EPSG\",\"8901\"]],\n UNIT[\"degree\",0.0174532925199433,\n AUTHORITY[\"EPSG\",\"9122\"]],\n AUTHORITY[\"EPSG\",\"4326\"]],\n PROJECTION[\"Transverse_Mercator\"],\n PARAMETER[\"latitude_of_origin\",0],\n PARAMETER[\"central_meridian\",153],\n PARAMETER[\"scale_factor\",0.9996],\n PARAMETER[\"false_easting\",500000],\n PARAMETER[\"false_northing\",10000000],\n UNIT[\"metre\",1,\n AUTHORITY[\"EPSG\",\"9001\"]],\n AXIS[\"Easting\",EAST],\n AXIS[\"Northing\",NORTH],\n AUTHORITY[\"EPSG\",\"32756\"]]",
"proj4": "+proj=utm +zone=56 +south +datum=WGS84 +units=m +no_defs",
"units": {
"horizontal": "metre",
"vertical": ""
},
"vertical": "",
"wkt": "PROJCS[\"WGS 84 / UTM zone 56S\",GEOGCS[\"WGS 84\",DATUM[\"WGS_1984\",SPHEROID[\"WGS 84\",6378137,298.257223563,AUTHORITY[\"EPSG\",\"7030\"]],AUTHORITY[\"EPSG\",\"6326\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.0174532925199433,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4326\"]],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER[\"central_meridian\",153],PARAMETER[\"scale_factor\",0.9996],PARAMETER[\"false_easting\",500000],PARAMETER[\"false_northing\",10000000],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],AXIS[\"Easting\",EAST],AXIS[\"Northing\",NORTH],AUTHORITY[\"EPSG\",\"32756\"]]"
},
"system_id": "PDAL",
"vlr_0": {
"data": "AQABAAAABwAABAAAAQABAAEEAAABAAEAAgSxhxYAAAABCLGHBwAWAAYIAAABAI4jAAwAAAEA9H8EDAAAAQApIw==",
"description": "GeoTiff GeoKeyDirectoryTag",
"record_id": 34735,
"user_id": "LASF_Projection"
},
"vlr_1": {
"data": "V0dTIDg0IC8gVVRNIHpvbmUgNTZTfFdHUyA4NHwA",
"description": "GeoTiff GeoAsciiParamsTag",
"record_id": 34737,
"user_id": "LASF_Projection"
},
"vlr_2": {
"data": "AQABAAAABwAABAAAAQABAAEEAAABAAEAAgSxhxYAAAABCLGHBwAWAAYIAAABAI4jAAwAAAEA9H8EDAAAAQApIw==",
"description": "GeoTiff GeoKeyDirectoryTag",
"record_id": 34735,
"user_id": "LASF_Projection"
},
"vlr_3": {
"data": "V0dTIDg0IC8gVVRNIHpvbmUgNTZTfFdHUyA4NHwA",
"description": "GeoTiff GeoAsciiParamsTag",
"record_id": 34737,
"user_id": "LASF_Projection"
}
}
},
"path": "/shared/GIS/Data/Point Clouds/Home/file-cropped.las",
"pipeline": [
{
"filename": "/shared/GIS/Data/Point Clouds/Home/file-cropped.las"
}
],
"points": 134,
"schema": [
{
"count": 134,
"maximum": 497754.4,
"mean": 497754.0174626866,
"minimum": 497753.69,
"name": "X",
"scale": 0.01,
"size": 4,
"stddev": 0.2046390581762844,
"type": "signed",
"variance": 0.04187714413127671
},
{
"count": 134,
"maximum": 7050888.390000001,
"mean": 7050888.096567164,
"minimum": 7050887.61,
"name": "Y",
"scale": 0.01,
"size": 4,
"stddev": 0.1886760805544189,
"type": "signed",
"variance": 0.03559866337337757
},
{
"count": 134,
"maximum": 1.25,
"mean": 1.1024626865671638,
"minimum": 0.98,
"name": "Z",
"scale": 0.01,
"size": 4,
"stddev": 0.04936063703301183,
"type": "signed",
"variance": 0.002436472488304739
},
{
"count": 134,
"maximum": 0,
"mean": 0,
"minimum": 0,
"name": "Intensity",
"size": 2,
"stddev": 0,
"type": "unsigned",
"variance": 0
},
{
"count": 134,
"maximum": 1,
"mean": 1,
"minimum": 1,
"name": "ReturnNumber",
"size": 1,
"stddev": 0,
"type": "unsigned",
"variance": 0
},
{
"count": 134,
"maximum": 1,
"mean": 1,
"minimum": 1,
"name": "NumberOfReturns",
"size": 1,
"stddev": 0,
"type": "unsigned",
"variance": 0
},
{
"count": 134,
"maximum": 0,
"mean": 0,
"minimum": 0,
"name": "ScanDirectionFlag",
"size": 1,
"stddev": 0,
"type": "unsigned",
"variance": 0
},
{
"count": 134,
"maximum": 0,
"mean": 0,
"minimum": 0,
"name": "EdgeOfFlightLine",
"size": 1,
"stddev": 0,
"type": "unsigned",
"variance": 0
},
{
"count": 134,
"counts": [
{
"count": 134,
"value": 2
}
],
"maximum": 2,
"mean": 2,
"minimum": 2,
"name": "Classification",
"size": 1,
"stddev": 0,
"type": "unsigned",
"variance": 0
},
{
"count": 134,
"maximum": 0,
"mean": 0,
"minimum": 0,
"name": "ScanAngleRank",
"size": 4,
"stddev": 0,
"type": "float",
"variance": 0
},
{
"count": 134,
"maximum": 0,
"mean": 0,
"minimum": 0,
"name": "UserData",
"size": 1,
"stddev": 0,
"type": "unsigned",
"variance": 0
},
{
"count": 134,
"maximum": 0,
"mean": 0,
"minimum": 0,
"name": "PointSourceId",
"size": 2,
"stddev": 0,
"type": "unsigned",
"variance": 0
},
{
"count": 134,
"maximum": 0,
"mean": 0,
"minimum": 0,
"name": "GpsTime",
"size": 8,
"stddev": 0,
"type": "float",
"variance": 0
},
{
"count": 134,
"maximum": 181,
"mean": 120.11194029850743,
"minimum": 26,
"name": "Red",
"size": 2,
"stddev": 42.47838088373777,
"type": "unsigned",
"variance": 1804.4128425038982
},
{
"count": 134,
"maximum": 217,
"mean": 154.61194029850748,
"minimum": 34,
"name": "Green",
"size": 2,
"stddev": 52.81407976674758,
"type": "unsigned",
"variance": 2789.327021608376
},
{
"count": 134,
"maximum": 223,
"mean": 147.65671641791042,
"minimum": 32,
"name": "Blue",
"size": 2,
"stddev": 53.70595793369947,
"type": "unsigned",
"variance": 2884.3299175762972
}
],
"srs": {
"authority": "EPSG",
"horizontal": "32756",
"wkt": "PROJCS[\"WGS 84 / UTM zone 56S\",GEOGCS[\"WGS 84\",DATUM[\"WGS_1984\",SPHEROID[\"WGS 84\",6378137,298.257223563,AUTHORITY[\"EPSG\",\"7030\"]],AUTHORITY[\"EPSG\",\"6326\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.0174532925199433,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4326\"]],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER[\"central_meridian\",153],PARAMETER[\"scale_factor\",0.9996],PARAMETER[\"false_easting\",500000],PARAMETER[\"false_northing\",10000000],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],AXIS[\"Easting\",EAST],AXIS[\"Northing\",NORTH],AUTHORITY[\"EPSG\",\"32756\"]]"
}
}
@@ -0,0 +1,16 @@
[
{
"bounds": [
497753.69,
7050887.61,
0.98,
497754.4,
7050888.39,
1.25
],
"inserted": true,
"metadataPath": "file-cropped.json",
"path": "/shared/GIS/Data/Point Clouds/Home/file-cropped.las",
"points": 134
}
]

0 comments on commit f2135b3

Please sign in to comment.
You can’t perform that action at this time.