Hello Guillaume,
This is an excellent question. What to do with LAS / LAZ files that *cannot* have a Coordinate Reference System.
We would need an agreed-upon mechanism in order to distinguish those LAS / LAZ files that cannot have CRS information from those LAS / LAZ files that the LASvalidator check was designed to "fail": files that are missing the mandatory CRS information altogether, that have incomplete or corrupt GeoTIFF tags, or - someday in the future - have incompatible information between the GeoTIFF tags in the OGC WKT definition.
I think your suggestion of using the GeoTIFF key GTModelTypeGeoKey with value 0 (undefined) is great. We could then turn the "fail" into a "warning" to accomodate doftware such as Trimble Real Works that want to leverage the popularity of the LAS / LAZ format but whose exports would otherwise be damned forever due to the systematic lack of CRS information.
Unless i hear vehement disagreement i will enhance the CRS check of the LASvalidator such that LAS / LAZ files that *explicitely* specify that they do not have CRS information will get only a "warning" instead of a "fail" by the LASvalidator ...
Regards,
Martin @rapidlasso
--
http://rapidlasso.com - fast tools to validate your LiDARs
Some software, like Trimble RealWorks for instance, do not work with Coordinate Reference System. However, LAS specification says "There is one mandatory Variable Length Record, GeoKeyDirectoryTag".--
How should software vendors exporting in LAS format without supporting the go-referencing system handle this? Should a software without CRS leave the field empty (that makes lasvalidate.exe from LAStools complain) or should it fill it with a structure like this:
// Set GeoTiff parameters
laszip_geokey_struct key_entries[1];
// projected coordinates
key_entries[0].key_id = 1024; // GTModelTypeGeoKey
key_entries[0].tiff_tag_location = 0;
key_entries[0].count = 1;
key_entries[0].value_offset = 0; // Undefined
Which, in other words, says explicitly that the GeoTIFF coordinate fields are irrelevant and the file cannot have geo-referencing info. This option also makes lasvalidate.exe from LAStools complain.
It seemed to me that GeoTiff specification mentioned in the ASPRS LAS format document (http://www.remotesensing.org/geotiff/geotiff.html) says that a value of 0 for fields such tiff_tag_location means a value that should not be interpreted.
Is it better to put no information even though it is required by standard or to put information that cannot be exploited?
--
You are subscribed to "The LAS room - a friendly place to discuss the the LAS or LAZ formats" for those who want to see LAS or LAZ succeed as open standards. Go on record with bug reports, suggestions, and concerns about current and proposed specifications.
Visit this group at http://groups.google.com/group/lasroom
Post to this group with an email to las...@googlegroups.com
Unsubscribe by email to lasroom+u...@googlegroups.com
---
You received this message because you are subscribed to the Google Groups "The LAS room - a friendly place to discuss the LAS and LAZ formats" group.
To unsubscribe from this group and stop receiving emails from it, send an email to lasroom+u...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
header->global_encoding |= ( 0x1 << 4 ); // Set bit for WKT
laszip_vlr wkt_vlr;
memset( &wkt_vlr, 0, sizeof( laszip_vlr ) );
strcpy( wkt_vlr.user_id, "LASF_Projection" );
wkt_vlr.record_id = 2112;
strcpy( wkt_vlr.description, "Coordinate System WKT" );
wkt_vlr.data = ( laszip_U8* )"N/A";
wkt_vlr.record_length_after_header = (laszip_U16)strlen( (char*)wkt_vlr.data );
if ( laszip_add_vlr( laszip, &wkt_vlr ) )
{
throw( "DLL ERROR: adding WKT to the header" );
}
If set, the Coordinate Reference System (CRS) is WKT. If not set, the CRS is GeoTIFF. It should not be set if the file writer wishes to ensure legacy compatibility (which means the CRS must be GeoTIFF).
The Coordinate Reference System (CRS) information for the point data is required for all data. The CRS information will be placed in Variable Length Records or Extended Variable Length Records... The CRS is represented by either GeoTIFF or Well Know [sic] Text as indicated by the WKT Global Encoding bit. Point Record Formats 0-5 can use either GeoTIFF or WKT (but not both simultaneously). Point Record Formats 6-10 must use WKT.
Evon,
GeoTIFF tags are very widely supported. Omitting them and storing only WKT in the VLRs only because the specification states it is invalid (does it? i think it does not!) to provide the CRS info in two different ways would seem silly. Because it would mean in practise that more often than needed there is some software does not manage to parse the (otherwise available) projection information from a LAS or LAZ file made to conform to an overly strict spec ...
Martin
--
Download LAStools at
http://lastools.org
http://rapidlasso.com
Be social with LAStools at
http://facebook.com/LAStools
http://twitter.com/LAStools
http://linkedin.com/groups/LAStools-4408378
Manage your settings at
http://groups.google.com/group/lastools/subscribe
--