Wednesday, March 16, 2016

Using Stamen Map Tiles in uDig

Since Stamen created wonderful maps out of Openstreetmap data and provides a Tile Map Service the following tutorial shows how to use it in uDig.

Map Tiles from Stamen ( are published under a Creative Commons Attribution (CC BY 3.0) license. The How-to guide at Stamen shows map URL templates for three different types:

Here are images for each in the same order


At the moment of writing toner and watercolor tile sets are available worldwide whereas terrain is only available for USA.

How to use it in uDig

To add a new Layer click on Menu Layer -> Add .. to open Add Data Wizard. Choose Web Map Tiles in the list followed by button Next >.

On the next page uncheck Mapnik first and check Custom Server in the left panel.
Copy one of the map scheme URL's listed above and paste it into URL field on the right. To finally add the layer to the current map push Next > Button again. The layer is named Custom Server. To rename the layer, just right click on the layer in the layers view and choose Rename

Tuesday, December 1, 2015

Tipps and Tricks creating pull requests for uDig

First, we love fixes and improvements for functionality and stability!

Second, we need you to make uDig better!

What is a pull request for?

We are allowed to host our source code at Github. Github introduced pull requests to "[..] review the set of changes, discuss potential modifications, and even push follow-up commits if necessary [..]". It helps us to accept patches and discuss approaches directly with code fragments.

Since uDig moved to LocationTech, which is a Industry Working Group of Eclipse Foundation, the project is following their committer guidelines. Eclipse Administrations set up few checks for pull requests to verify:
  • if the committer have signed a CLA at Eclipse
  • if the commit has valid Signed-off-by footers

What is required?

To create pull requests its required to create an Github account. Its also necessary that you've forked uDig.

You should be familiar with Eclipse IDE and have successfully build uDig on your machine. Great!

How to provide a bugfix?

Following the best practices you should create a branch in your working copy. If you like to create a bugfix for an exiting release, please discuss at the mailing list where to start from. If you fix is for future releases, please create a branch from master, e.g. upd-gt-14:
git checkout -b upd-gt-14
Now you can fix the bug.

Whenever you like to commit something, please use -s option. to sign off on commit:
git commit -s -m "upgrade to GeoTools 14.1"
If you are done, its time to share your improvement. Two steps are required to get it into core codebase.

Push your work 

To get others in position to review and accept changes you necessary to publish your work. We are following the common guidelines, where LocationTech's repository is upstream and your fork is origin repository. Push your local branch to your fork
git push upd-gt-14 origin

Create a pull request

Open the repository URL of your fork in a browser and navigate to recently pushed branch. To create a pull request you can hit the green button or click on the link "pull request"

This leads to the following screen where you can add comments and finally create the pull request against the LocationTech's repository.

What if..?

I've already created a pull request but forgot to sign off on commits

The easiest way is to reset your work and commit again, the example down below just demonstrates how to change the last commit on your branch.

NOTE: this is not recommend for master-branch if a commit pushed to LocationTech's repository already!
git reset HEAD^1
After that you have local changes in your working copy you can commit again. Once committed correctly with -s option again please use push command with the force option -f
git push -f upd-gt-14 origin
 This rewrites history but doesn't break anything.

I have lots of commits and like to get it into one

Thats fine and helps a lot to identify and deal with changes later (merging, cherry-picking, etc). Just use rebase command in interactive mode and mark commits to squash into a single one. Please consult git docs for details. After successfully rewrite use force option for git push like mentioned above. 
git reset -i