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.7K All Categories
- 5.6K Features Discussion
- 342 Downloading Imagery
- 1.3K Elevation Data
- 380 Georeferencing Imagery Discussion
- 628 GM Script Language
- 53 User Scripts
- 113 GPS Features
- 414 Projection Questions
- 819 Raster Data
- 1.3K Vector Data
- 6.6K Support
- 177 Announcement and News
- 908 Bug Report
- 558 SDK
- 1.2K Suggestion Box
- 3.7K Technical Support
- 562 Other Discussion
- 129 GIS Data Sources
- 27 Global Mapper Showcase
- 233 How I use Global Mapper
- 107 Global Mapper Forum Website