<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=Content-Type content="text/html; charset=us-ascii">
<META content="MSHTML 6.00.2900.2873" name=GENERATOR></HEAD>
<BODY>
<DIV><FONT face=Arial size=2><SPAN class=484453920-26042006>For anyone who is
interested, I've extended the GDAL wrapper written by Simon Perkins to support
part of the OGR library and to extend the GDAL part to also support writing of
rasters.</SPAN></FONT></DIV>
<DIV><FONT face=Arial size=2><SPAN
class=484453920-26042006></SPAN></FONT> </DIV>
<DIV><FONT face=Arial size=2><SPAN class=484453920-26042006>As with the first
version, this is far from complete, but is a very good start on using GDAL and
OGR in .NET.</SPAN></FONT></DIV>
<DIV><FONT face=Arial size=2><SPAN
class=484453920-26042006></SPAN></FONT> </DIV>
<DIV><FONT face=Arial size=2><SPAN class=484453920-26042006>I mentioned in an
earlier email to this list that Visual Studio detects "issues" with the
underlying OGR code and this generally won't work in debug mode. Clearly
something is flakey, but it works for my purposes, which is to write
to MapInfo tab files. At various points, other formats would work or not
work seemingly randomly, so if anyone has insight on these problems, please let
me know.</SPAN></FONT></DIV>
<DIV><FONT face=Arial size=2><SPAN
class=484453920-26042006></SPAN></FONT> </DIV>
<DIV><FONT face=Arial size=2><SPAN class=484453920-26042006>The key thing to
note on usage of the OGR portion is that it always fails the first time you try
to create a data source.</SPAN></FONT></DIV>
<DIV><FONT face=Arial size=2><SPAN
class=484453920-26042006></SPAN></FONT> </DIV>
<DIV><FONT face=Arial size=2><SPAN class=484453920-26042006>To get around this,
I catch the exception and call it again immediately. This is very odd behaviour
and more than a little disconcerting, so any insight into this problem would
also be appreciated!</SPAN></FONT></DIV>
<DIV><FONT face=Arial size=2><SPAN class=484453920-26042006></SPAN></FONT><FONT
face=Arial size=2><SPAN class=484453920-26042006></SPAN></FONT><FONT
face=Arial><SPAN class=484453920-26042006><FONT color=#0000ff><FONT
color=#000000 size=2></FONT> </DIV>
<DIV><FONT face="Courier New" color=#000000 size=2>try</FONT></DIV></FONT>
<DIV><FONT face="Courier New" size=2>{</FONT></DIV>
<DIV><FONT size=2><FONT face="Courier New"><FONT color=#0000ff><SPAN
class=484453920-26042006><FONT
color=#000000> MethodThatWritesVectorFile</FONT></SPAN></FONT>(pathName,
driverName, driverOptions);</FONT></FONT></DIV>
<DIV><FONT face="Courier New" size=2>}</FONT></DIV>
<DIV><FONT size=2><FONT face="Courier New"><FONT color=#0000ff>catch</FONT>
(<FONT color=#008080>Exception</FONT>)</FONT></FONT></DIV>
<DIV><FONT face="Courier New" size=2>{</FONT></DIV>
<DIV><FONT size=2><FONT face="Courier New"><FONT color=#0000ff><SPAN
class=484453920-26042006> </SPAN></FONT>MethodThatWritesVectorFile(pathName,
driverName, driverOptions);</FONT></FONT></DIV>
<DIV><FONT face="Courier New" size=2>}</FONT></DIV>
<DIV><SPAN class=484453920-26042006></SPAN> </DIV><SPAN
class=484453920-26042006>
<DIV><FONT face=Arial size=2><SPAN class=484453920-26042006>Finally, you may
need to change the path to the GDAL dll in the GdalInterOp.cs file to point to
the location of GDAL on your machine. Also note that to write to MapInfo tab
files, you must be using the latest beta version of GDAL.</SPAN></FONT></DIV>
<DIV><FONT face=Arial size=2><SPAN class=484453920-26042006></SPAN></FONT><FONT
face=Arial><SPAN class=484453920-26042006><FONT color=#0000ff><FONT
color=#000000></FONT> </DIV>
<DIV><FONT face="Courier New" color=#000000 size=2>public</FONT></FONT><FONT
size=2><FONT face="Courier New"> const string GdalDllName =
"gdal_fw.dll"</FONT><FONT face="Courier New">;</FONT></FONT></DIV>
<DIV><FONT size=2></FONT> </DIV>
<DIV><SPAN class=484453920-26042006><FONT size=2>Cheers,</FONT></SPAN></DIV>
<DIV><SPAN class=484453920-26042006><FONT
size=2>Richard</FONT></SPAN></SPAN></FONT></DIV></SPAN></SPAN></FONT></BODY></HTML>