zoukankan      html  css  js  c++  java
  • gdal库集成MrSID库的做法

    作者:朱金灿

    来源:http://blog.csdn.net/clever101

     

          首先从Lizardtech网站:http://www.lizardtech.com/download/developer/下载MrSID的SDK,我下载的版本是:MrSID_DSDK-8.5.0.3422。


           然后在gdal-1.9.1文件夹(gdal源码文件夹)下找到nmake.opt并打开,修改一下两个地方:


    #MRSID_DIR =D:MrSID_DSDK-8.5.0.3422MrSID_DSDK-8.5.0.3422-win32-vc9
    #MRSID_JP2 = YES
    

    改为:

    MRSID_DIR =D:MrSID_DSDK-8.5.0.3422MrSID_DSDK-8.5.0.3422-win32-vc9
    MRSID_JP2 = YES
    

           再找到MRSID_LIB_LINK宏添加需要链接的库:

    !IF DEFINED(MRSID_DIR) || DEFINED(MRSID_RASTER_DIR) || DEFINED(MRSID_LIDAR_DIR)
    !IF "$(MRSID_PLUGIN)" != "YES"
    MRSID_LIB_LINK = D:MrSID_DSDK-8.5.0.3422MrSID_DSDK-8.5.0.3422-win32-vc9Raster_DSDKliblti_dsdk.lib D:MrSID_DSDK-8.5.0.3422MrSID_DSDK-8.5.0.3422-win32-vc9Lidar_DSDKliblti_lidar_dsdk.lib
    !ELSE
    MRSID_LIB_LINK = D:MrSID_DSDK-8.5.0.3422MrSID_DSDK-8.5.0.3422-win32-vc9Raster_DSDKliblti_dsdk.lib D:\MrSID_DSDK-8.5.0.3422MrSID_DSDK-8.5.0.3422-win32-vc9Lidar_DSDKliblti_lidar_dsdk.lib
    !ENDIF
    !ENDIF
    

          然后编译gdal库。

     

    最后测试一下:

    #include <iostream>
    using namespace std;
    #include "gdal_priv.h"
    
    int _tmain(int argc, _TCHAR* argv[])
    {
        GDALAllRegister();
    
        GDALDataset* poDataset = (GDALDataset *) GDALOpen("F:\MyRes\xiangyang\rs[420600][200305][2004].sid", GA_ReadOnly );
    
          if( poDataset != NULL )
    
        {
    
            cout<<"RasterXSize:"<<poDataset->GetRasterXSize()<<endl;
    
                  cout<<"RasterYSize:"<<poDataset->GetRasterYSize()<<endl;
    
                  cout<<"RasterCount:"<<poDataset->GetRasterCount()<<endl;
    
        }
    	getchar();
    	return 0;
    }
    
    
    
    
    



  • 相关阅读:
    Android文件操作说明

    d
    关于<验证码>的实现和执行流程 http://www.cnblogs.com/androidhtml5/archive/2012/05/19/2533650.html
    div 嵌套 图片
    在线FLV播放器实现方法
    转载 android webview js
    d
    d
    消息
  • 原文地址:https://www.cnblogs.com/lanzhi/p/6470481.html
Copyright © 2011-2022 走看看