资源简介
1.gdal c# 开发环境配置
2.Gdal.AllRegister() 产生的"OSGeo.GDAL.GdalPINVOKE"异常解决方法及相关代码和数据。
代码片段和文件信息
/******************************************************************************
*
* Name: GdalConfiguration.cs.pp
* Project: GDAL CSharp Interface
* Purpose: A static configuration utility class to enable GDAL/OGR.
* Author: Felix Obermaier
*
******************************************************************************
* Copyright (c) 2012 Felix Obermaier
*
* Permission is hereby granted free of charge to any person obtaining a
* copy of this software and associated documentation files (the “Software“)
* to deal in the Software without restriction including without limitation
* the rights to use copy modify merge publish distribute sublicense
* and/or sell copies of the Software and to permit persons to whom the
* Software is furnished to do so subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included
* in all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED “AS IS“ WITHOUT WARRANTY OF ANY KIND EXPRESS
* OR IMPLIED INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM DAMAGES OR OTHER
* LIABILITY WHETHER IN AN ACTION OF CONTRACT TORT OR OTHERWISE ARISING
* FROM OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
* DEALINGS IN THE SOFTWARE.
*****************************************************************************/
using System;
using System.IO;
using System.Reflection;
using Gdal = OSGeo.GDAL.Gdal;
using Ogr = OSGeo.OGR.Ogr;
namespace SharpMap
{
public static partial class GdalConfiguration
{
private static bool _configuredOgr;
private static bool _configuredGdal;
///
/// Function to determine which platform we‘re on
///
private static string GetPlatform()
{
return IntPtr.Size == 4 ? “x86“ : “x64“;
}
///
/// Construction of Gdal/Ogr
///
static GdalConfiguration()
{
var executingAssemblyFile = new Uri(Assembly.GetExecutingAssembly().GetName().Codebase).LocalPath;
var executingDirectory = Path.GetDirectoryName(executingAssemblyFile);
if (string.IsNullOrEmpty(executingDirectory))
throw new InvalidOperationException(“cannot get executing directory“);
var gdalPath = Path.Combine(executingDirectory “gdal“);
var nativePath = Path.Combine(gdalPath GetPlatform());
// Prepend native path to environment path to ensure the
// right libs are being used.
var path = Environment.GetEnvironmentVariable(“PATH“);
path = nativePath + “;“ + Path.Combine(nativePath “plugins“) + “;“ + path;
Environme
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
文件 505168 2014-03-29 15:50 GDAL_CSharp环境配置.docx
文件 16341514 2014-03-29 14:03 gdal_data_config.rar
文件 5488 2014-03-29 13:55 GdalConfiguration.cs
----------- --------- ---------- ----- ----
16852170 3
相关资源
- c#高级编程(第10版) 非扫描 中文 高
- Asp.net C#生成pdf文件
- 深入理解C# 高清 pdf
- FIRFilter(C# FIR滤波器——含低通、高
- 中控cm50消费机SDK,C#源码
- C#强大的反编译工具 dnSpy
- C#MyKTV完整项目
- 仓库管理系统源程序(C#+sql)
- 人脸识别摄像头抓拍C#源码
- 深入理解C#(第3版)
- C#超市管理系统
- C# 进销存管理系统,自己根据需求写
- C# excel处理源码
- C#项目开发案例全程实录(第2版).
- 精通C#游戏编程.pdf
- 包含了halcon,C#编程,联合开发,机器
- 在线教育 asp.net源码
- 《C#面向对象设计模式纵横谈》全套视
- Learning hard C#学习笔记pdf及源码
- 狼奔C#MVC代码生成器V6.6
- C#年会抽奖软件
- 自己搜集的多达20个C#项目实战开发及
- asp.net(c#) 与 highcharts 数据库交互
- RabbitMQ-分布式消息队列C#、文档、工具
- C#利用Emgu人脸识别Demo可直接运行
- C#编成Modbus TCP连接PLC寄存器读取、写
-
基于winform的xm
l菜单编辑器c#源码) - c#简单的选课系统用 数据库的造作完
- C#编写、自动温度报警器
- 深入理解c# 第三版 高清
评论
共有 条评论