Howard, So I see the Geotiff spec describe the GeoKeyDirectoryTag Record tag at:
http://remotesensing.org/geotiff/spec/geotiff2.4.html as GeoKeyDirectoryTag=( 1, 1, 2, 6, 1024, 0, 1, 2, 1026, 34737,12, 0, 2048, 0, 1, 32767, 2049, 34737,14, 12, 2050, 0, 1, 6, 2051, 34736, 1, 0 ) GeoDoubleParamsTag(34736)=(1.5) GeoAsciiParamsTag(34737)=("Custom File|My Geographic|") I am writing: (1, 1, 0, 4) (1025, 0, 1, 2) (1024, 0, 1, 2) (2048, 0, 1, 4326) (4097, 0, 1, 9001) In code this translates to: final ByteBuffer wrap = ByteBuffer.allocate(40); wrap.putShort((short) 1); wrap.putShort((short) 1); wrap.putShort((short) 0); wrap.putShort((short) 4); wrap.putShort((short) GeoTiffConstants.GTRasterTypeGeoKey); wrap.putShort((short) 0); wrap.putShort((short) 1); wrap.putShort((short) GeoTiffConstants.RasterPixelIsPoint); wrap.putShort((short) GeoTiffConstants.GTModelTypeGeoKey); wrap.putShort((short) 0); wrap.putShort((short) 1); wrap.putShort((short) GeoTiffGCSCodes.ModelTypeGeographic); wrap.putShort((short) GeoTiffGCSCodes.GeographicTypeGeoKey); wrap.putShort((short) 0); wrap.putShort((short) 1); wrap.putShort((short) GeoTiffGCSCodes.GCS_WGS_84); wrap.putShort((short) GeoTiffVCSCodes.VerticalCitationGeoKey); wrap.putShort((short) 0); wrap.putShort((short) 1); wrap.putShort((short) GeoTiffUoMCodes.Linear_Meter); Does this make sense? It does according to page 14 of the LAS 1.2 spec.... If so, why does lasinfo.exe say that it can't read this tag? -----Original Message----- From: Howard Butler [mailto:[email protected]] Sent: Thursday, July 23, 2009 1:30 PM To: Patel, Ronak Avinash (US SSA) Cc: [email protected] Subject: Re: [Liblas-devel] LAS file Coordinate Systems Are you by chance confusing LAStools with libLAS? LAStools has a partial implementation of some geotiff key reading/ writing. libLAS, which implements the command line utilities of LAStools, uses libgeotiff for geotiff key reading/writing and provides a much more complete implementation. Your results will differ depending on which one (LAStools or libLAS) you are using. Howard On Jul 23, 2009, at 3:00 PM, Patel, Ronak Avinash (US SSA) wrote: > I am using lasinfo.exe to display the fields. I downloaded lastools > separately for Windows. > > > -----Original Message----- > From: [email protected] > [mailto:[email protected]] On Behalf Of Howard > Butler > Sent: Thursday, July 23, 2009 12:55 PM > To: [email protected] > Subject: Re: [Liblas-devel] LAS file Coordinate Systems > > > On Jul 23, 2009, at 1:39 PM, Patel, Ronak Avinash (US SSA) wrote: > >> Howard and Mateusz, >> >> Thanks for the help...really appreciate it. Haven't really found many >> people out there that know the low levels as much as you guys do. >> >> I was looking at the LAS 1.2 spec and it says the Georeferencing >> information requires the GeoKeyDirectoryTag Record. >> >> I am able to write that tag out but I see that lasinfo always shows >> the >> version to be 0.0.0 regardless of what I put in those fields. >> >> According to the spec, the data should be arranged: >> >> wKeyDirectoryVersion = 1 (2 bytes) >> wKeyRevision = 1 (2 bytes) >> wMinorRevision = 0 (2 bytes) >> wNumberOfKeys = the number of sets of 4 unsigned shorts to follow >> >> I write out the above shorts and 0 out the rest of the data byte >> array >> but lasinfo always shows 0.0.0 as the version. >> >> Is the spec wrong? Or is something else going on here that lasinfo >> and >> libLAS are doing?? > > Are you linking libLAS with libgeotiff when you compile? libLAS > completely ignores georeferencing if libgeotiff is not linked at > compile time. > > Howard > _______________________________________________ > Liblas-devel mailing list > [email protected] > http://lists.osgeo.org/mailman/listinfo/liblas-devel > > _______________________________________________ Liblas-devel mailing list [email protected] http://lists.osgeo.org/mailman/listinfo/liblas-devel
