Tutorial to use the CartAGen user interface

This tutorial explains how to use the CartAGen application user interface, and its main components.

Starting CartAGen Application

CartAgen is not an executable program yet, you need to clone the Java project into an IDE, such as Eclipse first, before being used. Please refer to the tutorials of your IDE to know how to clone a Github project. Once the project is cloned, there are Java main programs that can be used to run CartAGen:

Both are located in the cartgen-appli project, which contains all the code related to cartagen GUI.

CartAGen plugins: how it works and how to add new ones

Available plugins

Plugin name Code Short description
Least squares LeastSquaresComponent.java triggers least squares based generalisation processes
Evaluation EvaluationComponent.java contains methods to evaluate the results of generalisation
CollaGen CollaGenComponent.java an incomplete implementation of the CollaGen model
Spatial Analysis SpatialAnalysisComponent.java contains spatial analysis tools to characterise data prior to generalisation
Continuous ContinuousGUIComponent.java contains tools for continuous generalisation and morphing
OpenStreetMap OSMCartAGenPlugin.java contains specific processes such as the LoD harmonisation for OpenStreetMap data

How to add new plugins

The example code below shows how to create a new plugin for CartAGen, you just have to extend the java JMenu class in a new class (here called “NewPlugin”) and add items and actions to this new menu.

public class NewPlugin extends JMenu {

  public NewPlugin(String title) {
    super(title);
	...// add menu items and actions to this new menu
    }

	...
}

Then, if you want to add the new plugin in the CartAGen GUI, you have to modify the CartAGenGUIComponents.xml file that can be found in the cartagen-appli/src/main/resources/xml/ folder. The example code below shows how to add the “NewPlugin” plugin into the file. When CartAGen is launched once again, the NewPlugin should appear on the right of the existing menus.

<Config-CartAGen-GUI-Components>
	<Component>
		<name>Utilities</name>
		<path>fr.ign.cogit.geoxygene.appli.plugin.cartagen.util.UtilitiesGUIComponent</path>
	</Component>
		<Component>
		<name>Least Squares</name>
		<path>fr.ign.cogit.cartagen.appli.plugins.process.leastsquares.LeastSquaresComponent</path>
	</Component>
	<Component>
		<name>CollaGen</name>
		<path>fr.ign.cogit.cartagen.appli.plugins.process.CollaGenComponent</path>
	</Component>
	<Component>
		<name>Evaluation</name>
		<path>fr.ign.cogit.cartagen.appli.plugins.evaluation.EvaluationComponent</path>
	</Component>
	<Component>
		<name>Spatial Analysis</name>
		<path>fr.ign.cogit.cartagen.appli.plugins.spatialanalysis.SpatialAnalysisComponent</path>
	</Component>
	<Component>
		<name>Continuous</name>
		<path>fr.ign.cogit.geoxygene.appli.plugin.cartagen.util.ContinuousGUIComponent</path>
	</Component>
	<Component>
		<name>OpenStreetMap</name>
		<path>fr.ign.cogit.cartagen.appli.plugins.vgi.OSMCartAGenPlugin</path>
	</Component>
	<Component>
		<name>NewPlugin</name>
		<path>fr.ign.cogit.cartagen.appli.plugins.NewPlugin</path>
	</Component>
</Config-CartAGen-GUI-Components>

Description of the menus of the application

File Menu

The File menu is the standard File menu of the GeOxygene application that CartAGen extends.

View Menu

The menu first contains items to go to predefined display scales, or to a custom display scale. The “Go To” item allows to go to a point given its coordinates. There is also a toggle to display mouse coordinates.

CartAGen-Config Menu

Generalisation Menu

Dataset Menu

Themes Menu

The themes menu contains sub-menus for the main data themes that can be found in a topographic map. These sub-menus contain enrichment or generalisation algorithms specific for this theme. For instance, the building sub-menu contains the algorithms for building generalisation that are available in CartAGen. The sub-menus are the following:

Utilities Menu

This menu contains several utility tools, such as typical tools found in GIS software.

Agent Menu

The Agent Menu gives predefined set of actions to trigger some agent-based generalisation.

The Agent menu goes along with a toolbar on the right side of the view panel that gives access to the same controls as the menu, but also gives controls on the life cycle of the agents during the generalisation (pause, step-by-step).

Agent toolbar

GeOxygene Plugins

The CartAGen application is just an extension of the GeOxygene application, with new interface components. So, the application can also access to GeOxygene plugins, that work similarly to CartAGen plugins: they usually add a menu with items to access to the geoprocessing algorithms of the GeOxygene platform (data matching, conflation, topological processing, styling, etc.).

The choice of the GeOxygene plugins that are loaded in the CartAGen application is made by filling the geoxygene-configuration.xml file in the cartagen-appli project. The plugins appear in the “Plugins GeOx” menu of the GUI (see image below).

Menu to access to GeOxygene plugins

You can find more information on GeOxygene capabilities on this website. Be aware that a large part of the GeOxygene documentation is in French.

The geometry pool

The rendering of geographic features works with layers of geographic features, following the OGC standards. But sometimes, it is useful to draw additional geometries, such as final or intermediate geometries of a generalisation algorithm. To allow this, CartAGen uses a specific layer, called the Geometry Pool, where any geometry can be rendered with a specific style, on top of the other layers (see image below).

The centroid of each building is displayed in the geometry pool

The geometry pool can be made visible, or can be hidden, by using the “visible” check box, in the CartAGen-Config>Geometry Pool menu (see image below).

Making the geometry pool visible

The CartAGen-Config>Geometry Pool menu also allows the manipulation of the geometry pool (adding the selected features’ geometry, clearing the pool, etc.). The geometry pool can also be handled in the code. The example code below shows how to retrieve the geometry pool associated with a CartAGen database:

GeometryPool pool = CartAGenDoc.getInstance().getCurrentDataset().getGeometryPool();

TIP: some interface components may be labeled in French, even when using an English locale setting. Please report an issue on Github to have it corrected quickly!

See Also