LEADTOOLS Support
Imaging
Imaging SDK Questions
how to get the remote-sensing image coordinate system and geo information
This topic and its replies were posted before the current version of LEADTOOLS was released and may no longer be applicable.
#1
Posted
:
Tuesday, August 31, 2010 6:39:45 PM(UTC)
Groups: Registered
Posts: 7
leadstool 15 how to get the remote-sensing image coordinate system and geo information in visual c++?
#2
Posted
:
Wednesday, September 1, 2010 2:23:25 AM(UTC)
Groups: Guests
Posts: 3,022
Was thanked: 2 time(s) in 2 post(s)
If you're referring to the GeoTIFF file format, you can obtain Geo Keys information using:
LFile::SetGeoKey
LFile::GetGeoKey
LFile::WriteGeoKey
LFile::ReadGeoKey
LFile::EnumGeoKeys
LFile::EnumGeoKeysCallBack
#3
Posted
:
Wednesday, September 1, 2010 5:55:34 AM(UTC)
Groups: Registered
Posts: 7
oh,thanks
if the file is ecw format, what can i do?
#4
Posted
:
Thursday, September 2, 2010 2:01:17 AM(UTC)
Groups: Registered
Posts: 7
L_VOID GetGeokeyExample(LFile& file)
{
L_UINT16 L_FAR*pData = NULL;
L_UINT uCount;
L_UINT uType;
L_INT nSize;
nSize = file.GetGeoKey(1024, &uType, &uCount, NULL);
if(nSize <= 0)
MessageBox(NULL, TEXT("The GeoKey was not set, or an error occurred!"), TEXT("FAILURE"), MB_OK);
else
{
// allocate an array large enough to store the GeoKey data
pData = (L_UINT16 L_FAR*)malloc(nSize);
if(pData != NULL)
{
nSize = file.GetGeoKey(1024, &uType, &uCount, pData);
if(nSize <= 0)
MessageBox(NULL, TEXT("Error getting the GeoKey!"), TEXT("FAILURE"), MB_OK);
else
{
// do whatever you want with the GeoKey data
MessageBox(NULL, TEXT("works Fine!"), TEXT("SUCCESS"), MB_OK);
}
free(pData); //// free the pData buffer
}
}
}
i use this code to get the info.
but using 1024-3071 ,i only get the message that is "The GeoKey was not set, or an error occurred"; and my file has the geo info.
why?
#5
Posted
:
Thursday, September 2, 2010 3:04:53 AM(UTC)
Groups: Guests
Posts: 3,022
Was thanked: 2 time(s) in 2 post(s)
I'm afraid we don't have function to retrieve such data from ECW files.
#6
Posted
:
Thursday, September 2, 2010 4:30:44 AM(UTC)
Groups: Registered
Posts: 7
you said the tiff is ok
it's the result that tiff file is tested
#7
Posted
:
Friday, September 3, 2010 12:20:45 PM(UTC)
Groups: Tech Support
Posts: 366
Thanks: 1 times
Was thanked: 4 time(s) in 4 post(s)
Hello,
Could you explain in greater detail what you mean by "it's the result that tiff file is tested"? The noted methods work specifically with reading GeoKeys in GeoTIFF files. The method does not support reading metadata from ECW files.
If you're trying to extract GeoKeys from a TIFF file, could you provide a sample file so that we can test out this issue here as well?
NOTE: If you are attaching a project or file to the forums...
1.) Zip the file(s) up.
2.) Make sure it is less than 5 MB. If it is larger, please send an email to
support@leadtools.com and we'll send you FTP instructions.
3.) Remove ANY AND ALL unlock codes and LEADTOOLS DLLs.
4.) Do not click the preview button, the attachment will not show up when you post it.
If you do not wish to post your file(s) on the forum since they are publically viewable, please send an email to
support@leadtools.com and make sure that you include a link to this forum post.
Walter Bates
Senior Support Engineer
LEAD Technologies, Inc.
#8
Posted
:
Friday, September 3, 2010 5:42:19 PM(UTC)
Groups: Registered
Posts: 7
the file i used to testing is earth-4km.tif
i want to get the geoInfo ,such as the coordinate system, LTx,LTy,RBx,RBy coordiate , the projection system,etc.
and can you get the information of the file which was the ecw format ,
the example files.
#9
Posted
:
Friday, September 3, 2010 5:43:36 PM(UTC)
Groups: Registered
Posts: 7
#10
Posted
:
Friday, September 3, 2010 5:50:57 PM(UTC)
Groups: Registered
Posts: 7
#11
Posted
:
Monday, September 6, 2010 2:45:47 AM(UTC)
Groups: Guests
Posts: 3,022
Was thanked: 2 time(s) in 2 post(s)
The proper method for getting the specified GeoKey data from a TIFF file is the LFile::ReadGeoKey
function. You can also use the LFile::EnumGeoKeys which will enumerates all the GeoKeys in a GeoTIFF file.
For more information about GeoKeys, please refer to the help topic "Implementing GeoKeys (GeoTIFF tags)".
As I said, this will not work with the ECW file and we do not have functions to read such keys from ECW.
LEADTOOLS Support
Imaging
Imaging SDK Questions
how to get the remote-sensing image coordinate system and geo information
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.