hshutao's picture


is it possible to use OpenTK for GIS development?



Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
the Fiddler's picture

OpenTK is, at its core, a C# binding to OpenGL. The question then is, is C# & OpenGL suitable for GIS development?

While I do not know of any such programs written in C#, I believe this is a valid combination as long as you are aware of the possible performance implications and how to overcome these. There are two things to keep in mind:
a) all OpenGL calls travel through a translation layer, which incurs a small overhead (currently about 20ns per OpenGL call), and
b) .Net is a garbage collected environment, and the garbage collector plays an important role in performance considerations.

Both of these hold, of course, true for almost all other OpenGL bindings, including ones written for Python, Java and C#. Performance considerations are a well covered topic (check for example Rico Mariani's blog), and in the future we will be adding relevant information to the OpenTK manual.

OpenTK's main advantage is that it allows you to write more elegant OpenGL code, minimizing the risk of mistakes. It also contains font, math and input handling utilities, making it suitable for rapid development. On the other hand, it is under heavy development and there will be breaking changes from version to version. Staying on the bleeding edge means taking more risk - you'll have to decide which is more important to you ;)

If you have an IRC client, you can visit the "#opentk" channel on "de.quakenet.org" (port 6669) where fellow developers meet.

Inertia's picture

Actually it might be a big advantage using C# in this case over unmanaged C++.
There is a topic in this forum regarding managed OpenGL resources (basically the garbage collector is used to clean up unused Textures) which should be a big advantage getting a project like yours bugfree, assuming that you're loading already 100s of Textures at startup and additionally load more Textures on-the-fly while the program is running.

Edit: If Fiddler includes the .dds loader in OpenTK 3.14, you could also use compressed DXT1 Textures, lowering the memory requirements and load times of your application. If you want to implement pan/zoom features, that should give a serious performance boost.