Monday, February 21, 2011

Geotools SWT/JFace module and its RCP integration

After some discussion in the geotools mailinglist about the possibility of a SWT port of the geotools swing module, Ian Mayo from the Debrief project funded the port. He also wanted the resulting port and documentation to be Open Sourced (thanks!).

The result looks like:


A tutorial adn the source code about how to get there are here.

Wednesday, February 16, 2011

Copy Maven Dependency Tree jars

Well, it is the second time I need to get the jar on which a maven project depends on and copy them into a non-maven application. Sure mvn dependency:tree is your friend to see which jars you need to copy. And there are also maven tasks that can do the copy. But what if I want to copy them over without polluting the pom? I couldn't find a quick way (I am sure someone will tell me :)), so I created a groovy script that would do that for me.

Here it is, change the path to the repo, change the path into which to copy to, and run the thing.




// copy also source jars?
def alsoSources = false;
// copy also javadoc jars?
def alsojavaDocs = false;
// your maven repo path
def repo = "/home/moovida/.m2/repository/"
// path to which to copy them
def copyPath = "/home/moovida/development/gt-swt-port-hg/rcp-gt-swt/libs/"


def mvnCommand = "mvn dependency:tree";
def proc = mvnCommand.execute();
proc.waitFor();

def output = proc.in.text;
// clean out what we need
def lista=[];
def lines = output.split("\n");
def depsList = [];
def startIndex = -1;
def endIndex = -1;
for (int i = 0; i < lines.size(); i++){
def line = lines[i];
if(line.startsWith("[INFO] [dependency:tree]")){
startIndex = i + 1;
continue;
}
if(startIndex != -1 && line.startsWith("[INFO] ----------")){
endIndex = i - 1
break;
}
if(startIndex == -1){
continue;
}

lista << line;
}

println "Search for:"
lista.each{
println it
}

println "---------------------------------------"
println "---------------------------------------"

// find jars
def basedir = new File(repo)
def files = [];
basedir.eachDirRecurse () { dir ->
dir.eachFileMatch(~/.*.jar/) { file ->
files << file
}
}

// extract name pattern and version
def fileBeginList = []
def versionList = []
lista.each{
def split = it.split(":");
fileBeginList << split[1]
versionList << split[3]
println "${split[1]} --- ${split[3]}"
}

def finalList = [];
// extract right jars paths from list
for (it in files){
def name = it.getName()
def path = it.getAbsolutePath()

if(!alsoSources && name.matches(".*sources.*")){
continue;
}
if(!alsojavaDocs && name.matches(".*javadoc.*")){
continue;
}

for (int i = 0; i < fileBeginList.size(); i++){
def fBegin = fileBeginList.get(i);
def version = versionList.get(i);
if(name.startsWith(fBegin)){
if(name.matches(".*"+version+".*")){
finalList << it;
break;
}
}
}
}

println "---------------------------------------"
println "---------------------------------------"
println "Found:"
finalList.each{
println it
}


println "---------------------------------------"
println "---------------------------------------"
if(copyPath){
println "Copy deps jars to: ${copyPath}"
finalList.each{
def name = it.getName();
def path = it.getAbsolutePath();
def newPath = new File(copyPath, name).getAbsolutePath();
new AntBuilder().copy ( file : path , tofile : newPath )
}
}





Worked well for me.

Thursday, February 3, 2011

uDig 1.2.1 is out

Copied over from the official uDig blog:

We have recently released uDig 1.2.1. This is an incremental update with mainly bug fixes but there are a few notable features added as well.

  • Additional style editor pages; thanks to the JGrass project and Hydrologis
  • Access to the latest GeoTools renderer with support for hatch patterns
  • Access to world+image "bmp" files
  • Experimental - WMS 1.3.0 support
  • Updated "submit log" in the help menu
Additional documentation:

  • Updated online help capturing the new style pages style pages
  • Updated intro documentation for users and developers

For developers:

  • We have migrated to a new git repository http://gitorious.org/udig
  • Access to the latest GeoTools 2.7 Release Candidate

The new release can be accessed and downloaded from http://udig.refractions.net/download/


Monday, January 31, 2011

My latex friend Texclipse

I think I tried it once already and it wasn't mature at that time, but now I am really glad to say that the project is really nice and usable: Texlipse.

Finally a way to write my latex documentation from within my favourite IDE. While under linux setting up latex is quite easy, in windows it needs a bit more love.

Antways the configuration instructions on the texlipse site are great, so not much more to say.

The only thing I found nasty, is the fact that I need the output pdf to be built in a different folder than my source files are in. For me this is due to the fact that otherwise every time I save and it builds, the pdf is uploaded on my dropbox.



As you can see in the screen, there is a setting that tells: "bin directory of tex distribution", which should give me the possibility to change the output folder. Well, in my install, that one is not only ignored, the textfield of the folder gets blanked out after I press APPLY or OK.

An easy workaround is to add the small option to the command -output-directory=:



Good stuff from the Texlipse guys, goooood stuff!


Oh yeah, and wait, a screenshot:

Monday, January 24, 2011

Geopaparazzi 2.1 released



Geopaparazzi 2.1.0 has been released to the android market.

Release notes for version 2.1.0

New features:

  • zoom bar on map view to choose the zoomlevel

  • compass view now links to the Gps Status Application





Fixes:

  • lots of enhancements on the data decimating and rendering performance, fixing crashes and freezes

  • .nomedia file in the maps cache folder to stop scanner from browsing it




As usual the updated docs are here.

Wednesday, January 19, 2011

The last two steps of JGrass towards uDig

It is since the joining of the uDig community that we wanted to slowly migrate all of JGrass as smooth as possible into uDig. This process has been slow and effort consuming, but is now at a good point, as some of the previous posts here document.

I will now the most important proposal to the uDig community, hoping that it will be accepted. If you are interested in reading through the thing, just go for it.


Need a candy? Here you are:

Tuesday, January 18, 2011

JGrass all-in-one bundle

We got requests from users to put the an all-in-one bundle of JGrass/BeeGIS downloadable on the net.

In 2010 we used one version for several courses. It is the one some of you know because it had working support for netcdfs in uDig.

Well, while waiting for the next version of uDig with much of JGrass integrated directly and while waiting for a complete merge of JGrass into uDig, we put the bundles at this page.

There are several presentations on slideshare of the courses that can be used both to get started with JGrass and also to do advanced hydrology with JGrass. Some of them can be found here, which is also the place were stuff will slowly appear as it is produced.

Enjoy.