<html><head><meta http-equiv="Content-Type" content="text/html charset=windows-1252"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; ">see <a href="http://www.gdal.org/ogr/drv_mitab.html">http://www.gdal.org/ogr/drv_mitab.html</a><div><br></div><div>MapInfo datasets in native (TAB) format and in interchange (MIF/MID) format
are supported for reading and writing. </div><div>Update of existing files is not
currently supported.</div><div><br></div><div><br></div><div> <br><div><div>On Feb 22, 2014, at 7:51 AM, HappyFrasse <<a href="mailto:fdr@cartesia.se">fdr@cartesia.se</a>> wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><br>Hi<br><br>I am trying to use the latest ogr/gdal library in my dotnet projekt. I do<br>ref. to ogr_csharp, gdal_csharp.<br>My problem is that I can read my Mapinfo tab-file but I can’t write (append)<br>features to it and I don’t understand why?<br><br>If I open the mapinfo file with Ogr.Open(_FileName, 0) I got write access<br>error when using “CreateFeature”.<br>If I change the second parameter to 1 (in open) then I won’t get any<br>datasource. Why? Does ogr/gdal not support write /append to some existing<br>mapinfo file?<br><br>My code goes like:<br><br>*****Code start ***<br>Ogr.RegisterAll()<br><br>'Open data source.<br>Dim dsTab As DataSource = Ogr.Open(_FileName, 0)<br>'Dim dsTab As DataSource = Ogr.Open(_FileName, 1)<br>If dsTab Is Nothing Then<br> System.Diagnostics.Debug.WriteLine("Can't open " + _FileName)<br>End If<br><br>'Get driver <br> Dim drvTab As Driver = dsTab.GetDriver()<br>If drvTab Is Nothing Then<br> System.Diagnostics.Debug.WriteLine("Can't get driver.")<br>End If<br>System.Diagnostics.Debug.WriteLine("Using driver " + drvTab.name)<br><br>Dim layerTab As Layer = Nothing<br>Dim i As Integer = 0<br>Dim iLayers As Integer = dsTab.GetLayerCount<br><br>layerTab = dsTab.GetLayerByIndex(0)<br>Dim layerName As String = layerTab.GetName<br>System.Diagnostics.Debug.WriteLine("Layername " + layerName)<br><br>Dim feature As Feature = New Feature(layerTab.GetLayerDefn())<br>feature.SetFID(Ogr.OGRNullFID)<br><br>feature.SetField("TraktId", "Mytest_TraktId")<br><br>Dim geom As Geometry = Geometry.CreateFromWkt("POINT(47.0 19.2)")<br>If feature.SetGeometry(geom) <> 0 Then<br> System.Diagnostics.Debug.WriteLine("Failed add geometry to the<br>feature.")<br>End If<br><br>If layerTab.CreateFeature(feature) <> 0 Then<br> System.Diagnostics.Debug.WriteLine("Failed to create feature in file.")<br>End If<br>*** code end ***<br><br>Is my code wrong or do I missunderstood something?<br><br>Regards/Frasse<br><br><br><br><br>--<br>View this message in context: <a href="http://osgeo-org.1560.x6.nabble.com/Gdal-Mapinfo-driver-write-access-tp5105252.html">http://osgeo-org.1560.x6.nabble.com/Gdal-Mapinfo-driver-write-access-tp5105252.html</a><br>Sent from the GDAL - Dev mailing list archive at <a href="http://Nabble.com">Nabble.com</a>.<br>_______________________________________________<br>gdal-dev mailing list<br><a href="mailto:gdal-dev@lists.osgeo.org">gdal-dev@lists.osgeo.org</a><br>http://lists.osgeo.org/mailman/listinfo/gdal-dev</blockquote></div><br></div></body></html>