Problem reprojecting LiDAR data using liblas

المشرف العام

Administrator
طاقم الإدارة
I have multiple lidar data sets and I am trying to reproject them using liblas. They are missing the coordinate system in the header information so I assign them an SRS using las2las --a_srs:

las2las -v input.las --a_srs EPSG:28992 The result is an updated header:

Spatial Reference: LOCAL_CS["Amersfoort / RD New", GEOGCS["Amersfoort", DATUM["unknown", SPHEROID["unretrievable - using WGS84",6378137,298.257223563], TOWGS84[565.417,50.3319,465.552,-0.398957,0.343988,-1.8774,4.0725]], PRIMEM["Greenwich",0], UNIT["degree",0.0174532925199433]], AUTHORITY["EPSG","28992"], UNIT["metre",1]] I then try and convert them to my preferred projection (WGS84) using t_srs:

las2las -v assigned.las --t_srs EPSG:4326 and I get the following error:

ERROR 1: No PROJ.4 translation for source SRS, coordinate transformation initialization has failed. ERROR 10: Pointer 'hTransform' is NULL in 'OCTTransform'. Normally the error is caused by an incorrect path for GDAL or PROJ4 but I have explicitly defined them (/usr/share/gdal/1.11 and /usr/shar/proj respectively).

Even more strange is if I try and convert between EPSG:3857 and EPSG:4326 that works fine so it is able to convert between some coordinate systems. I also checked the proj folder to see if it contained the correct transformation, it had it in two separate files:

epsg: +proj=sterea +lat_0=52.15616055555555 +lon_0=5.38763888888889 +k=0.9999079 +x_0=155000 +y_0=463000 +ellps=bessel +towgs84=565.417,50.3319,465.552,-0.398957,0.343988,-1.8774,4.0725 +units=m +no_defs esri: +proj=stere +lat_0=52.15616055555555 +lon_0=5.38763888888889 +k=0.999908 +x_0=155000 +y_0=463000 +ellps=bessel +units=m +no_defs no_defs Any idea what might be causing this error?

If you want some of the source data, I took it from the Dutch point cloud website: http://3dsm.bk.tudelft.nl/matahn

I tried manually assigning the projection with the following command to fix the errors that andre pointed out:

las2las -v input.las --a_srs "+proj=sterea +lat_0=52.15616055555555 +lon_0=5.38763888888889 +k=0.9999079 +x_0=155000 +y_0=463000 +ellps=bessel +towgs84=565.417,50.3319,465.552,-0.398957,0.343988,-1.8774,4.0725 +units=m +no_defs " then it allowed me to perform the transformation, but the output had all the points in a single line, so it looks like all the transformations are broken.

I have been reading through the source code trying to find which is being called (gdal or geotiff) but I cannot work it out. I havemanually applied the proj4 and gdal_transform commands and they are working. Any idea where it could be breaking in liblas?

I took the advice of quentonc and tried the exact same command on an OSX set up and it worked perfectly. There must be something wrong with one of the packages. I will try rebuilding the dependencies from source to see if that fixes it.

I have built proj4 and gdal from source and I have exactly the same problem after rebuilding liblas to use the new libraries. I have also tested proj4 and gdal and they are working correctly. So it is not the packages but something liblas is doing incorrectly to communicate to the other libraries that is causing the error.



أكثر...
 
أعلى