MapWindow Developer Team : MapWindow Discussion Forum
Dan, I stumbled across the Geotools.net (http://geotoolsnet.sourceforge.net/Index.html) project yesterday. It is a C# port of the Java Topology Suite (JTS). It has code for reading and writing shape files and writing SVG output. It also has a nice tool for converting a shapefile
Geotools.net
Posted by: kurt_wolfe ()
Date: June 17, 2005 08:47AM

Dan,

I stumbled across the Geotools.net (http://geotoolsnet.sourceforge.net/Index.html) project yesterday. It is a C# port of the Java Topology Suite (JTS). It has code for reading and writing shape files and writing SVG output. It also has a nice tool for converting a shapefile into a datatable. Perform seems pretty good. There is also bunch of other topology related stuff (as the name Java Topology Suite might imply) that may or may not be useful.

It was good to see everyone who made it to the workshop.

Kurt

Options: ReplyQuote
Compiling Java for .Net
Posted by: Mark Gray ()
Date: June 17, 2005 04:42PM

It appears that the Geotools.net folks have tried three different solutions to the problem of using a Java library from .Net. I will list them in increasing order of how easy/successful they sound for us to use if we want to use Geotools or any other Java library within MapWindow.

First they tried translating Java into C# and compiling with a C# compiler. This was easier than most such translations since the two languages are similar, but certainly requires some effort to update as new Java versions are released.

Next they tried using Microsoft's J# product:

[lab.msdn.microsoft.com]

to compile the Java classes into a .Net dll. This involved some small changes to the Java code but was far easier than a language translation to C#.

Finally, they used IKVM:

[www.ikvm.net]

an open source product which directly converts a compiled Java jar file into a .Net dll. I downloaded IKVM and the latest version of the Java Topology Suite, learned that I had to type:

ikvmc.exe jts-1.6.jar -target:library

and I suddenly had a new file: jts-1.6.dll
I opened the BASINS 4 project in Visual Studio .Net, added a reference to this new dll and two support dlls that come with IKVM, and I can now use JTS objects within my .Net project. I have yet to learn what JTS can do and how, but it appears in the development environment exactly as if it had been programmed in C#.

This may not be the end of the Java vs. .Net debate, but it seems like the end of the "but we can't use these wonderful Java libraries if we program in .Net" argument.

--
Mark

P.S. J# also appears to have the ability to compile .jar to .dll, but I have not tested that feature. If IKVM can compile the .jar files we need, I see no reason to use J# for that. If we want to participate in developing the Java libraries, J# could be useful as a more familiar development environment than Eclipse.

Options: ReplyQuote


Sorry, only registered users may post in this forum.





Banner Exchange




GISCP.com




Send us your banner logo (160x120) for the space above, and add this MapWindow banner ad to your site:

Just paste this text in your page: