Related Downloads
Http://pan.baidu.com/s/1o7OEMc6
Gdal1.rar-Getting Started example
Gdal book codes and data-rar
Gdal1110.zip-Download the source code
Gdal.rar-Content after a successful build
1 Enter the following directory to execute Vcvars32.bat
2 Switch to extract directory Execute command
nmake/f Makefile.vc, compile; time is longer; maybe 10 minutes;
Complete the compilation;
3. Set the output directory
Locate the nmake.opt file in the download directory, for example, the file path in this article is:
D:\gdal-1.11.0\nmake.opt
Open the Modify Gdal_home value for the installation directory. The directories used in this article are as follows:
Gdal_home = "D:\GDAL"
The D:\GDAL directory should be created manually first
4 Build
Switch to the unzip directory and execute it successively
nmake/f MAKEFILE.VC Install
nmake/f MAKEFILE.VC Devinstall
Build a successful content:
5 Introductory examples
Create a new console project, add the Include directory, library directory, additional dependencies, and copy the Gdal111.dll to the project;
Code
#include "stdafx.h" #include <gdal_priv.h> #include <iostream>using namespace std;int _tmain (int argc, _ tchar* argv[]) {Gdaldataset *podataset; Data set object pointer gdalallregister (); Registered driver Podataset = (Gdaldataset *) gdalopen ("Mosaic.tif", ga_readonly); if (podataset! = NULL) {cout << "rasterxsize : "<< Podataset, Getrasterxsize () << endl;cout <<" rasterysize: "<< Podataset and Getraster Ysize () << endl;cout << "Rastercount:" << Podataset, Getrastercount () << Endl; Gdalclose ((Gdaldataseth) podataset); } GetChar (); return 0;}
Operation effect;
Test data such as the TIF file used can be downloaded in the previous link.
RELATED links:
Http://malagis.com/win7-vs2010-gdal.html
Http://www.cnblogs.com/zhangjun1130/archive/2009/11/13/1602340.html
Diagram vc++2012 compiling and installing GDAL1.11.0 and Getting started examples