I have a binary file "geo.bin" that represents some geometry (OGR WKB I think). The binary file has a list of points that make up a polygon. I'd like to read the binary data and create an array of points in my VBScript script.
Are there solutions that already exist I can leverage? Perhaps a .NET class like DbGeometry? If so how would I instantiate such a class? I have tried the following but get an error "ActiveX component can't create object: 'GetObject'":
Dim fso
Set fso = CreateObject("Scripting.FileSystemObject")
Dim logfile
Set logfile = fso.CreateTextFile("A:\Atoll\geotest.log")
'read binary geometry into byte array
Dim stream, bytes
Set stream = CreateObject("ADODB.Stream")
stream.Open
stream.Type = 1
stream.LoadFromFile("A:\Atoll\geo.bin")
bytes = stream.Read
stream.Close
Dim dbgeo: Set dbgeo = GetObject("C:\Windows\Microsoft.NET\Framework64\v4.0.30319\System.Data.Entity.dll", "DbGeometry")
logfile.Write(TypeName(dbgeo) & vbCrLf)
Dim poly: Set poly = dbgeo.FromBinary(bytes)
I've also tried using:
Dim dbgeo: Set dbgeo = CreateObject("System.Data.Spatial.DbGeometry")
But get a similar error.