PDAL / PDAL

PDAL is Point Data Abstraction Library. GDAL for point cloud data.

Home Page:https://pdal.io

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

pdal info cannot read apparently good las file for the Moon

oleg-alexandrov opened this issue · comments

Describe the bug

I have what I believe is a perfectly fine LAS file for the moon. It was made by setting the option a_srs in the writer to a reasonable WKT string (see below). But pdal info cannot read it. It says:

pdal info --all moon.las

pdal info filters.stats Error) GDAL failure (1) PROJ: proj_create_operations: Source and target ellipsoid do not belong to the same celestial body (Moon vs Earth).
(pdal info filters.stats Error) GDAL failure (6) Cannot find coordinate operations from GEOGCRS["Geographic Coordinate System",DATUM["D_MOON",ELLIPSOID["MOON",1737400,0,LENGTHUNIT["metre",1,ID["EPSG",9001]]]],PRIMEM["Reference meridian",0,ANGLEUNIT["degree",0.0174532925199433,ID["EPSG",9122]]],CS[ellipsoidal,2],AXIS["latitude",north,ORDER[1],ANGLEUNIT["degree",0.0174532925199433,ID["EPSG",9122]]],AXIS["longitude",east,ORDER[2],ANGLEUNIT["degree",0.0174532925199433,ID["EPSG",9122]]]]' to EPSG:4326'

zsh: segmentation fault (core dumped) pdal info --all moon.las

Here's the file, if necessary: https://drive.google.com/file/d/1idnuZ2BkaauToMrh28v-8obVD38vkrwc/view?usp=sharing

When I set:

export PROJ_IGNORE_CELESTIAL_BODY=YES

it works, and gives the following very appropriate info, as seen below. So the question is, why is it imagining Earth data anywhere?

{
"boundary":
{
"area": 18898859.03,
"avg_pt_per_sq_unit": 3.767954989e-09,
"avg_pt_spacing": 3.893794659,
"boundary": "POLYGON ((15.37001239 -9.53954786,15.37994986 -9.53899263,15.3796293 -9.52400136,15.38091155 -9.52289089,15.38059099 -9.50789962,15.38187324 -9.50678916,15.38155268 -9.49735021,15.38283493 -9.49623975,15.38283493 -9.49401882,15.38155268 -9.49290835,15.38187324 -9.49013219,15.38059099 -9.48902173,15.35783098 -9.48957696,15.35654873 -9.48846649,15.35206084 -9.48846649,15.35077859 -9.48957696,15.35109915 -9.49679498,15.3498169 -9.49790544,15.35013746 -9.50845486,15.3488552 -9.50956532,15.3488552 -9.5384374,15.36808901 -9.5384374,15.37001239 -9.53954786))",
"boundary_json": { "type": "Polygon", "coordinates": [ [ [ 15.37001239, -9.53954786 ], [ 15.37994986, -9.53899263 ], [ 15.3796293, -9.52400136 ], [ 15.38091155, -9.52289089 ], [ 15.38059099, -9.50789962 ], [ 15.38187324, -9.50678916 ], [ 15.38155268, -9.49735021 ], [ 15.38283493, -9.49623975 ], [ 15.38283493, -9.49401882 ], [ 15.38155268, -9.49290835 ], [ 15.38187324, -9.49013219 ], [ 15.38059099, -9.48902173 ], [ 15.35783098, -9.48957696 ], [ 15.35654873, -9.48846649 ], [ 15.35206084, -9.48846649 ], [ 15.35077859, -9.48957696 ], [ 15.35109915, -9.49679498 ], [ 15.3498169, -9.49790544 ], [ 15.35013746, -9.50845486 ], [ 15.3488552, -9.50956532 ], [ 15.3488552, -9.5384374 ], [ 15.36808901, -9.5384374 ], [ 15.37001239, -9.53954786 ] ] ] },
"density": 0.06595593934,
"edge_length": 0,
"estimated_edge": 0.001110464482,
"hex_offsets": "MULTIPOINT (0 0, -0.000320563 0.000555232, 0 0.00111046, 0.000641127 0.00111046, 0.00096169 0.000555232, 0.000641127 0)",
"sample_size": 5000,
"threshold": 15
},
"file_size": 42381331,
"filename": "moon.las",
"metadata":
{
"comp_spatialreference": "GEOGCS["Geographic Coordinate System",DATUM["D_MOON",SPHEROID["MOON",1737400,0]],PRIMEM["Reference meridian",0],UNIT["degree",0.0174532925199433,AUTHORITY["EPSG","9122"]],AXIS["Latitude",NORTH],AXIS["Longitude",EAST]]",
"compressed": false,
"copc": false,
"count": 1246492,
"creation_doy": 0,
"creation_year": 2024,
"dataformat_id": 3,
"dataoffset": 603,
"filesource_id": 0,
"global_encoding": 0,
"global_encoding_base64": "AAA=",
"gtiff": "Geotiff_Information:\n Version: 1\n Key_Revision: 1.0\n Tagged_Information:\n End_Of_Tags.\n Keyed_Information:\n GTModelTypeGeoKey (Short,1): ModelTypeGeographic\n GTRasterTypeGeoKey (Short,1): RasterPixelIsArea\n GeographicTypeGeoKey (Short,1): User-Defined\n GeogCitationGeoKey (Ascii,101): "GCS Name = Geographic Coordinate System|Datum = D_MOON|Ellipsoid = MOON|Primem = Reference meridian|"\n GeogGeodeticDatumGeoKey (Short,1): User-Defined\n GeogAngularUnitsGeoKey (Short,1): Angular_Degree\n GeogEllipsoidGeoKey (Short,1): User-Defined\n GeogSemiMajorAxisGeoKey (Double,1): 1737400 \n GeogSemiMinorAxisGeoKey (Double,1): 1737400 \n GeogPrimeMeridianLongGeoKey (Double,1): 0 \n End_Of_Keys.\n End_Of_Geotiff.\n",
"header_size": 227,
"major_version": 1,
"maxx": 15.38201715,
"maxy": -9.489471466,
"maxz": 380.2343506,
"minor_version": 2,
"minx": 15.34934733,
"miny": -9.538585783,
"minz": 193.3798,
"offset_x": 15.3656822399525,
"offset_y": -9.51402862427238,
"offset_z": 286.807075305629,
"point_length": 34,
"project_id": "00000000-0000-0000-0000-000000000000",
"scale_x": 8.00687899977922e-12,
"scale_y": 1.20371768173626e-11,
"scale_z": 4.57952266428453e-08,
"software_id": "PDAL 2.6.0 (95728e)",
"spatialreference": "GEOGCS["Geographic Coordinate System",DATUM["D_MOON",SPHEROID["MOON",1737400,0]],PRIMEM["Reference meridian",0],UNIT["degree",0.0174532925199433,AUTHORITY["EPSG","9122"]],AXIS["Latitude",NORTH],AXIS["Longitude",EAST]]",
"srs":
{
"compoundwkt": "GEOGCS["Geographic Coordinate System",DATUM["D_MOON",SPHEROID["MOON",1737400,0]],PRIMEM["Reference meridian",0],UNIT["degree",0.0174532925199433,AUTHORITY["EPSG","9122"]],AXIS["Latitude",NORTH],AXIS["Longitude",EAST]]",
"horizontal": "GEOGCS["Geographic Coordinate System",DATUM["D_MOON",SPHEROID["MOON",1737400,0]],PRIMEM["Reference meridian",0],UNIT["degree",0.0174532925199433,AUTHORITY["EPSG","9122"]],AXIS["Latitude",NORTH],AXIS["Longitude",EAST]]",
"isgeocentric": false,
"isgeographic": true,
"json": {
"type": "GeographicCRS",
"name": "Geographic Coordinate System",
"datum": {
"type": "GeodeticReferenceFrame",
"name": "D_MOON",
"ellipsoid": {
"name": "MOON",
"radius": 1737400
},
"prime_meridian": {
"name": "Reference meridian",
"longitude": 0
}
},
"coordinate_system": {
"subtype": "ellipsoidal",
"axis": [
{
"name": "Latitude",
"abbreviation": "lat",
"direction": "north",
"unit": "degree"
},
{
"name": "Longitude",
"abbreviation": "lon",
"direction": "east",
"unit": "degree"
}
]
}
},
"prettycompoundwkt": "GEOGCS["Geographic Coordinate System",\n DATUM["D_MOON",\n SPHEROID["MOON",1737400,0]],\n PRIMEM["Reference meridian",0],\n UNIT["degree",0.0174532925199433,\n AUTHORITY["EPSG","9122"]],\n AXIS["Latitude",NORTH],\n AXIS["Longitude",EAST]]",
"prettywkt": "GEOGCS["Geographic Coordinate System",\n DATUM["D_MOON",\n SPHEROID["MOON",1737400,0]],\n PRIMEM["Reference meridian",0],\n UNIT["degree",0.0174532925199433,\n AUTHORITY["EPSG","9122"]],\n AXIS["Latitude",NORTH],\n AXIS["Longitude",EAST]]",
"proj4": "+proj=longlat +R=1737400 +no_defs",
"units":
{
"horizontal": "unknown",
"vertical": ""
},
"vertical": "",
"wkt": "GEOGCS["Geographic Coordinate System",DATUM["D_MOON",SPHEROID["MOON",1737400,0]],PRIMEM["Reference meridian",0],UNIT["degree",0.0174532925199433,AUTHORITY["EPSG","9122"]],AXIS["Latitude",NORTH],AXIS["Longitude",EAST]]"
},
"system_id": "PDAL",
"vlr_0":

System/installation information:
Please provide information on your PDAL version (pdal --version) and system (e.g., uname -a or ver).

$ uname -a

Linux 4.15.0-220-generic #231-Ubuntu SMP Fri Nov 10 20:32:58 UTC 2023 x86_64 x86_64 x86_64 GNU/Linux
$ pdal --version

pdal 2.6.0 (git-version: 95728e)

If installed via Conda, you may be asked to paste the output of conda list and conda info as well.

$ conda list

pdal                      2.6.0                h28c8413_1    conda-forge

$ conda info

conda info

            shell level : 2
       user config file : /home/oalexan1/.condarc
 populated config files : /home/oalexan1/.condarc
          conda version : 23.3.1
    conda-build version : 3.27.0
         python version : 3.10.12.final.0
       virtual packages : __archspec=1=x86_64
                          __glibc=2.27=0
                          __linux=4.15.0=0
                          __unix=0=0
       base environment : /home/oalexan1/miniforge3  (writable)
      conda av data dir : /home/oalexan1/miniforge3/etc/conda
  conda av metadata url : None
           channel URLs : https://repo.anaconda.com/pkgs/main/linux-64
                          https://repo.anaconda.com/pkgs/main/noarch
                          https://repo.anaconda.com/pkgs/r/linux-64
                          https://repo.anaconda.com/pkgs/r/noarch
          package cache : /home/oalexan1/miniforge3/pkgs
                          /home/oalexan1/.conda/pkgs
       envs directories : /home/oalexan1/miniconda3/envs
                          /home/oalexan1/miniforge3/envs
                          /home/oalexan1/.conda/envs
               platform : linux-64
             user-agent : conda/23.3.1 requests/2.31.0 CPython/3.10.12 Linux/4.15.0-220-generic ubuntu/18.04.6 glibc/2.27
                UID:GID : 524639:66053
             netrc file : None
           offline mode : False

@oleg-alexandrov I believe that this is actually a PROJ issue. See the last update in the 9.2.0 CHANGELOG. Specifically, createFromUserInput was failing with non-Earth CRSes and the solution was to include the PROJ_IGNORE_CELESTIAL_BODY flag.

When using pdal info I end up always prepending the flag, which is not ideal, but it is what is needed at this time. GDAL also suffers from the same issues with CRSs.

We should at least fix the segfault. We don't want to do that.