GDAL Bindings for Go

844 views
Skip to first unread message

Luke Roth

unread,
Oct 3, 2012, 2:46:10 PM10/3/12
to gdal...@lists.osgeo.org, golan...@googlegroups.com
For any who are interested, I've published a (incomplete, but growing)
set of GDAL bindings for the Go language at
https://github.com/lukeroth/gdal.go .
The bindings cover most of the GDAL C API, the OGR C API is next.
More details are available at the Github page. Let me know if you
find them useful!
Luke

Michael Jones

unread,
Oct 3, 2012, 3:03:58 PM10/3/12
to Luke Roth, gdal...@lists.osgeo.org, golan...@googlegroups.com
Nice! You're speaking my language.

Luke

--





--
Michael T. Jones | Chief Technology Advocate  | m...@google.com |  +1 650-335-5765

Even Rouault

unread,
Oct 3, 2012, 6:02:09 PM10/3/12
to gdal...@lists.osgeo.org, Luke Roth, golan...@googlegroups.com
The majority of GDAL bindings (Perl, Python, Java, C# at least) are generated
by using SWIG bindings ( see swig/include in GDAL source tree ). Looking
quickly at http://www.swig.org/Doc2.0/Go.html , it seems you could possibly
have used it instead of writing from scratch. But I've never used Go, nor the
SWIG Go generator, so just take it as a hint, not an enlightened advice based
on experience.

Anyway, you could create a page to advertise your Go bindings in GDAL Trac (
http://trac.osgeo.org/gdal/wiki/GdalOgrInGo for example ) and make a link to
it from the "GDAL/OGR In Other Languages" section of the main Trac page (
http://trac.osgeo.org/gdal/wiki )

> Luke
> _______________________________________________
> gdal-dev mailing list
> gdal...@lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/gdal-dev

Luke Roth

unread,
Oct 3, 2012, 10:44:20 PM10/3/12
to Even Rouault, gdal...@lists.osgeo.org, golan...@googlegroups.com
A good point. I considered using SWIG to generate the bindings, it
looks like the support is pretty good, but I decided to "roll my own"
for now for a couple of reasons. I thought it would be a good way to
learn by getting my hands dirty with some of the lower-level nuts and
bolts of Go, and it would give me a chance to look closely at the API
and see where there were opportunities to make it more "go-like".
Going forward, I might try seeing how SWIG handles things, it might
make long-term maintenance easier (although the GDAL API is pretty
mature at this point).
I'll take a look at the GDAL Trac pages, although I might wait until
I've had a chance to fill in some of the missing areas and add to the
(currently pretty minimal) documentation.
Luke

minux

unread,
Oct 4, 2012, 12:57:20 AM10/4/12
to Luke Roth, golan...@googlegroups.com, gdal...@lists.osgeo.org


On Oct 4, 2012 2:46 AM, "Luke Roth" <roth...@gmail.com> wrote:
> set of GDAL bindings for the Go language at
> https://github.com/lukeroth/gdal.go .

i suggest you change the project name to avoid ".go" suffix,
or it  will confuse "go get".

Luke Roth

unread,
Oct 4, 2012, 9:50:49 AM10/4/12
to minux, golan...@googlegroups.com, gdal...@lists.osgeo.org
Thanks, I just noticed that when I pulled the code to a new machine.
I've renamed the repository to
https://github.com/lukeroth/gdal_go to avoid the problem.
Luke
Reply all
Reply to author
Forward
0 new messages