<div dir="ltr">That said ...<div><br></div><div>I managed to create a working version of the bindings that provide a method on Feature :</div><div><br></div><div>byte[] GetFieldAsBinary(int id)</div><div><br></div><div>You can see this in this fork <a href="https://github.com/runette/gdal/tree/binary">https://github.com/runette/gdal/tree/binary</a></div><div><br></div><div>Of course this is not even ready to be a PR, let alone being submitted, reviewed, merged etc etc. <br><br>But if you did want to play with it you could build out of that fork (the fork is set up to build version 3.2.2). Or, if you want I could send you the Windows binaries - with of course no promises, guarantees or even recommendations etc etc.<br><br>Using this, the following console app :<br><br><font face="monospace">using System;<br>using System.Text;<br>using OSGeo.OGR;<br><br>namespace swig_test<br>{<br> class Program<br> {<br> static void Main(string[] args)<br> {<br> Console.WriteLine("Hello World!");<br><br><br> Ogr.RegisterAll();<br> DataSource ds = Ogr.Open("/Users/paulharwood/ViRGIS-Backend/test_data/bradwell_moor_ecology.geojson", 0);<br> int layerc = ds.GetLayerCount();<br><br> Console.WriteLine($"Number of Layers : {layerc}");<br><br> Layer layer = ds.GetLayerByIndex(0);<br><br> Console.WriteLine($"Number of Features : {layer.GetFeatureCount(0)}");<br><br> layer.ResetReading();<br> Feature feature = layer.GetNextFeature();<br> while (feature != null)<br> {<br> int fieldc = feature.GetFieldCount();<br><br> for (int i = 0; i < fieldc; i++)<br> {<br> FieldDefn fd = feature.GetFieldDefnRef(i);<br> String name = fd.GetName();<br> int length = fd.GetWidth();<br><br> byte[] contents = feature.GetFieldAsBinary(i);<br><br> Console.WriteLine($" Field {name} :{Encoding.ASCII.GetString(contents)}");<br><br> }<br> feature = layer.GetNextFeature();<br> }<br> }<br> }<br>}<br></font></div><div><br></div><div>Produces this result :<br><br><br><font face="monospace">Number of Layers : 1<br>Number of Features : 6<br> Field id : <br> Field Name : TN6<br> Field Details : Concrete lined pond<br> Field id : <br> Field Name : TN5<br> Field Details : Unimproved Grassland<br> Field id : Length 0 : <br> Field Name : TN4<br> Field Details : Dry dwarf shrub heath<br> Field id : <br> Field Name : TN3<br> Field Details : 2 no. areas of botanical interest<br> Field id : <br> Field Name : TN2<br> Field Details : Fenced off rake/shaft<br> Field id : <br> Field Name : TN1<br> Field Details : Pond 1</font><br></div><div><br></div><div><br></div><div>Yes - I know I am ready a text field as a binary and then converting it to text .. That is ONLY because I don't have any handy binary data to test with.</div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Fri, 30 Apr 2021 at 16:18, Paul Harwood <<a href="mailto:runette@gmail.com">runette@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr">I am going to go out on a couple of limbs here :<br><br>- About 3041 - it is what it is!<div><br>As it happens I have been thinking about learning more about the SWIG side of things and I had a quick look. Not a trivial issue - that method was excluded for a reason. There is some complicated marshalling to do.<br><br>Even if it was easy - especially with 3.3.0 in the launch tubes it would be months before anything would come out in a release.<div><br></div><div>- About 3040 - looks like a bug. But you have the same problem with launch timetables even once someone fixes it (unless you fix it and then create your own temp build).<br><br>So - the best suggestion I can think of is probably facile (so don't take it the wrong way ) - but is there no way that you could do it in Python?</div></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Fri, 30 Apr 2021 at 06:14, srweal <<a href="mailto:steve_wealands@essolutions.com.au" target="_blank">steve_wealands@essolutions.com.au</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">Hi,<br>
<br>
I'm after advice. I need to read a BLOB field from various features within a<br>
FileGDB. I need to work with this data either in C# code (via the GDAL C#<br>
bindings), or else have it directly read into a SQL database (e.g. via<br>
ogr2ogr). <br>
<br>
I've hit up against a couple of problems doing this that I don't know how to<br>
fix in the GDAL source which I've documented here but had no feedback on:<br>
<a href="https://github.com/OSGeo/gdal/issues/3040" rel="noreferrer" target="_blank">https://github.com/OSGeo/gdal/issues/3040</a><br>
<a href="https://github.com/OSGeo/gdal/issues/3041" rel="noreferrer" target="_blank">https://github.com/OSGeo/gdal/issues/3041</a><br>
<br>
Am wondering if anyone on the list can suggest a better approach that would<br>
work? <br>
<br>
Thanks. Have been stuck on this for a while now with no real way forward.<br>
<br>
Steve<br>
<br>
<br>
<br>
<br>
--<br>
Sent from: <a href="http://osgeo-org.1560.x6.nabble.com/GDAL-Dev-f3742093.html" rel="noreferrer" target="_blank">http://osgeo-org.1560.x6.nabble.com/GDAL-Dev-f3742093.html</a><br>
_______________________________________________<br>
gdal-dev mailing list<br>
<a href="mailto:gdal-dev@lists.osgeo.org" target="_blank">gdal-dev@lists.osgeo.org</a><br>
<a href="https://lists.osgeo.org/mailman/listinfo/gdal-dev" rel="noreferrer" target="_blank">https://lists.osgeo.org/mailman/listinfo/gdal-dev</a><br>
</blockquote></div>
</blockquote></div>