Getting started with C# and GDAL
http://vipassanaandenvironmentalinformatics.blogspot.jp/2013/03/getting-started-with-c-and-gdal.html
转自。
http://www.gisremotesensing.com/2017/01/code-snippet-create-new-field-in-shape.html
http://www.gisremotesensing.com/2015/10/read-esri-file-gdodatabase-filegdb.html
http://www.gisremotesensing.com/2015/09/read-raster-block-by-block-using-gdal.html
http://www.gisremotesensing.com/2015/09/read-raster-file-into-array-using-c-and.html
http://www.gisremotesensing.com/2016/12/esri-featureclass-vs-feature-layer.html
http://www.gisremotesensing.com/2015/10/enable-esri-arcgis-extension-licence.html
http://www.gisremotesensing.com/2015/09/feature-to-raster-conversion-using-c.html
http://www.gisremotesensing.com/2015/09/vector-to-raster-conversion-using-gdal-c.html
http://www.gisremotesensing.com/2015/07/building-arcmaps-add-in-using-command.html
http://www.gisremotesensing.com/2015/09/vector-to-raster-conversion-using-gdal-c.html
- Download the latest version of the precompiled GDAL binaries from here. Choose the ones that suit your system (32bit or 64bit). Extract the contents from the zip file to a location on your hard disk e.g. C:Program FilesGDAL (I ran into a number of AccessViolationExceptions when I used the binaries from FWTools 2.4.7).
- Include both the path to C:Program FilesGDALingdalcsharp as well as C:Program FilesGDALin in your PATH system variable.
- On http://svn.osgeo.org/gdal/trunk/gdal/swig/csharp/apps/ you will find sample C#-classes that use the GDAL-bindings. In the following I will use GDALInfo.cs as an example. Create a C# Console Application project that uses the file GDALInfo.cs.
Creating a Console Application (VS 2010) |
- Add four of.the dll-files that can can be found at C:Program FilesGDALingdalcsharp (or wherever your installation path of the current binaries is) to your project references: gdal_csharp.dll, gdalconst_csharp.dll,ogr_csharp.dll and osr_csharp.
- Build the solution. If you are on a 64bit system and you are using the 64bit GDAL binaries you have to make sure you actually build for 64bit (you will get errors otherwise when you try to run the program).
Setting of the platform target for 64bit (VS 2012) |
- Now you can run the program with some data. Include a reference to one of the raster files in the Command line arguments field of your Debug options (in the properties of your GDALInfo project; don't forget to put the path inside double quotes of it includes blanks).
- Run the program (Ctrl-F5). It should show you something similar to the following:
Output of GDALInfo |