how to change the projection in GeoTiff
Hi
how to change the projection in GeoTiff
I am making the prj file from GlobalMapper. and
Prj file is read using the GM_LoadProjectionFile().
but Value will appear incorrectly.
What's wrong?
the have of source for Example?
Sample source is attached.
GM_Error_t32 theErr = GM_Error_None;
// Load the file
GM_LayerHandle_t32* theLayerHandleList = NULL;
uint32 theNumLayersLoaded = 0;
GM_LoadFlags_t32 aLoadFlags = GM_LoadFlags_HideProgress | GM_LoadFlags_UseDefaultProj;
theErr = GM_LoadLayerList (
mFile, &theLayerHandleList, &theNumLayersLoaded, aLoadFlags
);
if ( theErr != GM_Error_None )
{
AfxMessageBox("GM_LoadLayerList Error!!!");
return;
}
GM_LayerHandle_t32 theLayerHandle = theLayerHandleList[0];
const GM_LayerInfo_t* theLayerInfo = GM_GetLayerInfo( theLayerHandle );
GM_Projection_t m_ProjFile;
::memset( &m_ProjFile, 0, sizeof m_ProjFile );
char* prj = "C:\\Bessel50_Center.prj";
GM_LoadProjectionFile( prj , &m_ProjFile);
Prj Files
Bessel50_Center.prjGRS80_50_Center.prj
how to change the projection in GeoTiff
I am making the prj file from GlobalMapper. and
Prj file is read using the GM_LoadProjectionFile().
but Value will appear incorrectly.
What's wrong?
the have of source for Example?
Sample source is attached.
GM_Error_t32 theErr = GM_Error_None;
// Load the file
GM_LayerHandle_t32* theLayerHandleList = NULL;
uint32 theNumLayersLoaded = 0;
GM_LoadFlags_t32 aLoadFlags = GM_LoadFlags_HideProgress | GM_LoadFlags_UseDefaultProj;
theErr = GM_LoadLayerList (
mFile, &theLayerHandleList, &theNumLayersLoaded, aLoadFlags
);
if ( theErr != GM_Error_None )
{
AfxMessageBox("GM_LoadLayerList Error!!!");
return;
}
GM_LayerHandle_t32 theLayerHandle = theLayerHandleList[0];
const GM_LayerInfo_t* theLayerInfo = GM_GetLayerInfo( theLayerHandle );
GM_Projection_t m_ProjFile;
::memset( &m_ProjFile, 0, sizeof m_ProjFile );
char* prj = "C:\\Bessel50_Center.prj";
GM_LoadProjectionFile( prj , &m_ProjFile);
Prj Files
Bessel50_Center.prjGRS80_50_Center.prj
Comments
-
I'm guessing that you want to provide the projection for the layer as one of those PRJ files? If so you can either use GM_SetQueryProjectionCallback to provide a callback function to be used when asking the user for the projection and load it there, or just call GM_LoadRectifierLayer and pass in the projection structure (use NULL for the control point list to use the built-in position) to use that as the projection.
Thanks,
Mike
Global Mapper Guru
gmsupport@bluemarblegeo.com
http://www.globalmapper.com -
Thanks Mike.
Another question
How to replace the projection to "Bessel50_Center.prj and "GRS80_50_Center.prj" ? -
What exactly do you mean by 'replace'? If you want to set the view/export projection to one of those use GM_LoadProjectionFile to load the projection into a GM_Projection_t definition structure, then use GM_SetProjection to set the projection to what was loaded from the .prj file.
Thanks,
Mike
Global Mapper Guru
gmsupport@bluemarblegeo.com
http://www.globalmapper.com
Categories
- 12.8K All Categories
- 5.7K Features Discussion
- 345 Downloading Imagery
- 1.3K Elevation Data
- 385 Georeferencing Imagery Discussion
- 636 GM Script Language
- 54 User Scripts
- 114 GPS Features
- 417 Projection Questions
- 826 Raster Data
- 1.3K Vector Data
- 6.6K Support
- 178 Announcement and News
- 913 Bug Report
- 558 SDK
- 1.2K Suggestion Box
- 3.7K Technical Support
- 569 Other Discussion
- 131 GIS Data Sources
- 27 Global Mapper Showcase
- 238 How I use Global Mapper
- 107 Global Mapper Forum Website