OpenJUMP
Working with Projections

back to Index page


Edgar Soldin’s CTS extension allows the user to assign a coordinate reference system to vector layers and reproject accordingly. The CTS extension is based on the Geotools library and uses the well known text(EPSG WKT) specifications. The database resides within the text file CS.CONF, and the CTS extension comes with a sample CS.CONF file with the german Gauss-Kruger coordinate systems.
The CTS extension does not allow file re-projection of a vector layer on-the-fly, however, if properly configured, it enables the user to define a projection of one or more layers, and re-project these to other reference systems.

To configure the CTS extension:
  1. Install the CTS extension within OpenJump.
  2. Modify, or create a new CS.CONF file for the desired transformation(s)
  3. Use the CTS extension with OpenJUMP

1 – Setup

To use the CTS extension correctly, OpenJUMP has to be installed in a special way.
  1. move your OpenJUMP folder to a root folder (e.g. C:/OpenJUMP) or in a folder which must not have space characters (” “) in the name (e.g., in MS Windows,
    BAD: C:/Program Files/OpenJUMP.
    GOOD: C:/Programs/OpenJUMP or C:/OpenJUMP)
    Note: This is to workaround a bug which leads to a Nullpointerexception in WKTCSLoader, further described under Installing PlugIns.
  1. Download the CTS extension file and unzip it in OpenJUMP/LIB/EXT folder (you must create an EXT folder if it doesn’t exist). In the zip file there is also a small mini manual written by Edgar Soldin where you can find some basic information on the use of the plug-in.
  2. You will see that a CS.CONF file is included in files extracted from the zip file. This files represents the source of the coordinate reference system definitions that can be used with the plug-in. This file has only WGS84 and GAUSS-KRUGER codes (Germany) by default. Additional CTS definitions for your area of interest will need to be added to the file.

2 – How to find EPSG WKT code

Writing a new CS.CONF file is not complicated. It is a simple text file which can be opened and edited with a text editor like Windows Notepad
.
When you open the initial CS.CONF file you will see the EPSG codes are repeated twice(#PROGJ…, PROGJ..). These first lines are commented out and can safely be deleted. (Comments in the file are lines that start with the ”#” character.)

To avoid confusion, clean up all the lines and start to write a new CS.CONF file. (Make a back-up file before any modifications).

Before writing a new file you must know two important things:

The following example shows how to define a correct EPSG WKT code to use with OpenJUMP’s CTS extension.

EXAMPLE
(Adapted from Moovida’s blogpost from JGRASS Tech Tips)

I will write a CS.CONF file with some Italian CRSs. First I write the EPSG WKT code for EPSG 3003, which is a code name attributed by “European Petroleum Survey Group” (EPSG) to the Monte Mario/zone 1 (known in Italy also as Gauss-Boaga zone est). This CRS adopts the International Ellisoid 1924 (Hayford), then I correct the EPSG WKT code with Bursa Wolf parameters. Then I will repeat the same work for other CRS

I) To find EPSG WKT , I go to EPSG database (created by Howard Butler and Christopher Schmidt) and search the CRS with the code 3003 (I write 3003 on Search reference box & click the _Search_tab).

II) The new window will show all the information related to EPSG 3003, the area of usage, on the right, and the different WKT codes below.

Click on OCG WKT format to see the code:

PROJCS[“Monte Mario / Italy zone 1”,GEOGCS[“Monte Mario”,DATUM[“Monte_Mario”,
SPHEROID[“International 1924”,6378388,297, AUTHORITY[“EPSG”,”7022”]],
AUTHORITY[“EPSG”,”6265”]],
PRIMEM[“Greenwich”,0,
AUTHORITY[“EPSG”,”8901”]],
UNIT[“degree”,0.01745329251994328,
AUTHORITY[“EPSG”,”9122”]],
AUTHORITY[“EPSG”,”4265”]],
UNIT[“metre”,1,
AUTHORITY[“EPSG”,”9001”]],
PROJECTION[“Transverse_Mercator”],
PARAMETER[“latitude_of_origin”,0],
PARAMETER[“central_meridian”,9],
PARAMETER[“scale_factor”,0.9996],
PARAMETER[“false_easting”,1500000],
PARAMETER[“false_northing”,0],
AUTHORITY[“EPSG”,”3003”]]

Create te a new TEXT file, called CS.TXT , and Copy the OCG code in it Without any breaks, like the follow:

PROJCS[“Monte Mario / Italy zone 1”,GEOGCS[“Monte Mario”,DATUM[“Monte_Mario”,SPHEROID[“International 1924”,6378388,297, AUTHORITY[“EPSG”,”7022”]],AUTHORITY[“EPSG”,”6265”]],PRIMEM[“Greenwich”,0,AUTHORITY[“EPSG”,”8901”]],UNIT[“degree”,0.01745329251994328,AUTHORITY[“EPSG”,”9122”]],AUTHORITY[“EPSG”,”4265”]],UNIT[“metre”,1,AUTHORITY[“EPSG”,”9001”]],PROJECTION[“Transverse_Mercator”],PARAMETER[“latitude_of_origin”,0],PARAMETER[“central_meridian”,9],PARAMETER[“scale_factor”,0.9996],PARAMETER[“false_easting”,1500000],PARAMETER[“false_northing”,0],AUTHORITY[“EPSG”,”3003”]]

Now we need to modify this code in order to use it. We don’t need to do complicated math operations for that. We simply add a new line which expresses the 3- or 7-parameter modification. (These parameters will be used for the transformation to WGS84).

III) Then open the EPSG Geodetic Parameter Registry.

This registry contains coordinate transformations between different CRSs.

And click on Search tab.

This search gives us 21 possible transformations between CRSs used in Italy. From Monte Mario to WGS84 are 10 transformations available. 1 on the mainland, 3 on the islands and 6 offshore.
Since we might need to do transformation on mainland the EPSG WKT code for this transformation is EPSG 1660 Italy mainland.
Click on the View tab
The new window will give us the desired Bursa Wolf parameters.

This new window contains 7 parameters (Bursa Wolf), because Monte Mario/zone 1 (EPSG 3003) requires 7-parameters to be correctly reprojected to the World Geodetic System 1984 (WGS84).

IV) Copy these parameters in your TEXT file in the EPSG code. This is the 3003 code modified with the 7-parameters modification:

PROJCS[“Monte Mario / Italy zone 1”,GEOGCS[“Monte Mario”,DATUM[“Monte_Mario”,SPHEROID[“International 1924”,6378388,297, AUTHORITY[“EPSG”,”7022”]],TOWGS84[-104.1, -49.1, -9.9, 0.971, -2.917, 0.714, -11.68],AUTHORITY[“EPSG”,”6265”]],PRIMEM[“Greenwich”,0,AUTHORITY[“EPSG”,”8901”]],UNIT[“degree”,0.01745329251994328,
AUTHORITY[“EPSG”,”9122”]],AUTHORITY[“EPSG”,”4265”]],
UNIT[“metre”,1,AUTHORITY[“EPSG”,”9001”]],PROJECTION[“Transverse_Mercator”],PARAMETER[“latitude_of_origin”,0],PARAMETER[“central_meridian”,9],PARAMETER[“scale_factor”,0.9996],PARAMETER[“false_easting”,1500000],PARAMETER[“false_northing”,0],AUTHORITY[“EPSG”,”3003”]]

Note the syntax (TOWGS84…) and the position of the 7 parameters in a WKT format.

V) Repeat the step for all the CRSs you need. Note that in your final TEXT file every CRS has to be a one liner, without any line breaks, like this:

PROJCS[“Monte Mario / Italy zone 1”,GEOGCS…
PROJCS[“Monte Mario / Italy zone 2”,GEOGCS…
PROJCS[“ED50 / UTM zona 32N….
PROJCS[“ED50 / UTM zona 32N…
PROJCS[“WGS 84 / UTM zone 32N…
PROJCS[“WGS 84 / UTM zone 32N…
GEOGCS[“WGS 84…...

(The last one is the CRS of the World Geodetic System that is used e.g. with GPS data)

At the end save the TEXT file with the name CS.CONF on your OpenJUMP/LIB/EXT folder. Congratulations: You just created a new set of CRS definitions that can be used for the reprojection of spatial data in Openjump.

VI) Many transformation defined by EPSG Geodetic Parameter Registry only require simple 3-parameter transformation (X, Y and Z translations. In this case the other 4 values (X,Y,Z rotation and Scale) must be set to 0.0 value on your TOWGS84 code (eg. TOWGS84[ -84.0, -107.0, -120.0, 0.0, 0.0, 0.0, 0.0]

NOTES:


3 – Using the CTS extension with OpenJUMP

The following example explains how to use the CTS extension to do coordinate transformations in OpenJUMP.

I use a modified CS.CONF file for an Italian projection. You can find it at the end of this page with some other useful informations.

I start OpenJUMP and load the layer prov2000.shp showing the administrative borders of Italian Provinces: The CRS of this layer is WGS84 - EPSG4326.

First I need to assign this CRS to this layer. Neither OpenJUMP or the CTS extension are able to detect the CRS of the data that will be transformed.

To do so I right-click on prove2000.shp in the Layer list and choose Set coordinate system from the context menu.

The projection dialog opens. From the drop down list for prov2000 layer I select WGS84 (EPSG 4326) to assign the correct CRS.

Then Click OK. This is the Target Projection.

Note that the checkbox on the right has to be enabled. If you only want to reassign a different CRS (e.g. wrong chosen earlier), simply disable the checkbox and assign another CRS.
The checkbox will enable itself after the assignment.

Now I open the file campaniagb.shp. This file represents the extension of the municipalities in Campania Region (Italy). The original projection of this layer is in Monte Mario /Zone 1 – EPSG 3003 (Called informally Gauss Boaga 1 in Italy). As you can see on next figure, this new layer is not projected on the top of the data of prov2000 layer. You could find it far away if you zoom out, because at this point geometries in two different CRSs are displayed in one viewport.

Now I set the correct CRS for the layer campaniagb.shp by choosing Monte Mario / Italy mainland zone 1 (EPSG 3003)

The next step is to click on Set Coordinate System again for the layer campaniagb.shp to choose the target projection, in this case WGS84 (EPSG 4326) (the projection of the other layer). For the layer campaniagb.shp the transformation on the geometries is started.

As the result of our efforts the layer campaniagb.shp is now correctly projected on the top of layer prove2000.shp.

NOTES


Download some CONF files ready to use


Reference

LINKS

Giuseppe Aruta


back to Index page