SlideShare a Scribd company logo
1 of 40
Download to read offline
Java Open Source GIS
          Development

From the building blocks to extending
    an existing GIS application.
 Geoinformation Research Group, Department of Geography
                  University of Potsdam
                      August 2011




    Part 5: Integrating with uDig and OMS3
                       Tutor: Andrea Antonello




   ydroloGIS             nvironmental                 ngineering
HydroloGIS S.r.l. - Via Siemens, 19 - 39100 Bolzano   www.hydrologis.com
Integrating with uDig and OMS3
We have learned to develop around raster and vector data, read and write

formats and deal with projections and geometries.


We also viewed the maps we produced in a simple and very limited viewer.

What possibilities do we have to integrate in a professional way our

knowledge up to this point into a real GIS environment?


The solution we will see is the Spatial ToolBox for uDig. The toolbox

generates, through proper description/annotation of the code, graphical user

interfaces for your module. Modules can be loaded at runtime.
Introduction to OMS3

The Object Modeling System (OMS3) is a pure Java, object-oriented

lightweight modeling framework.

OMS    allows   model   construction   and   model   application   based   on

components.


It is a collaborative project active among the U.S. Department of Agriculture

and partner agencies and organizations involved with agro-environmental

modeling.

The lightweight of the framework consists mainly in the use of annotations in

the code.
The 3 steps in modeling

Basically OMS3 supplies a set of annotations to put on the code to describe

it and to mark fields and methods through them.


As in most generic modeling frameworks, the three main steps are:

 • setting model resources and parameters

 • executing the model

 • freeing model resources if necessary

In order to make the framework understand what has to be used as

parameters and what as methods, we just need to annotate them. The

upside is that we can structure our code as we like, using our own way of

naming of variables and names.
The few important things that need to be kept in mind are:

 • input and output fields have to be set public and annotated with @In and

   @Out

 • the method that executes the model, has to have no return value, no
   parameter and be annotated with @Execute

Annotation example of input and output fields:

     @Description("The map of digital elevation model (DEM).")
     @In
     public GridCoverage2D inElev;

     @Description("The vector on which to calculate the profile.")
     @In
     public SimpleFeatureCollection inVector;

     @Description("The profile.")
     @Out
     public double[][] outProfile = null;
Example module execution method:

    @Execute
    public void process(){
        // execute your module here
    }



Example for the resources freeing method:

    @Finalize
    public void free(){
        // free resources before shutting module downw
    }
Introduction to the uDig's Spatial Toolbox

The Spatial Toolbox is a frontend for GIS users, a graphical user interface

that can load any OMS3 annotated module.

Mouse clicks, region settings, raster resolution and all (most) needed GIS

notions are supplied to the widgets automatically. Annotations give hints.


The gui labels and documentations are responsability of the module

developer/maintainer.
User Interface built through the OMS3 annotations

                                 ClassName

The Class name is not an annotation, but anyways important, since it results

in the name of the module. Choose it carefully.
@Label

The Label is a class annotation that is interpreted as a category. It is useful

to group various module in categories and subcategories (separated by

slash: / ).
@In/@Out

In and Out are field annotations that are used to define whether a field

should be handled as input or output. In the gui this can result in separate

tabs:
@Description

The Description annotation can be used for both classes and fields. In the

case of fields it is used as the text for the fields in the gui. In the case of

classes, it is used in the documentation page.
@Units and @Range

The Units and Range annotations are field annotations that add descriptive

text to the gui.
@Documentation

The Documentation annotation contains a link to the file that holds all the

module documentation, which is placed in the gui as a description tab.
@Status, @Name, @Author, @License, @Keywords

Additional annotations, if available, are used in the gui as additional

information for the documentation.
@UI, the annotation that makes the gui smarter

The UI annotation is a field/class annotation that aims to make the gui

smarter. Its content is not standardized, and can be interpreted by the gui

generators to make the widgets more interactive.


                                 @UI("infile")

Identifies a field that will contain an input (has to exist) file. The textfield

should present a button to browse the filesystem in open mode.
@UI("outfile")

Identifies a field that will contain an output (parent folder has to exist) file.

The textfield should present a button to browse the filesystem in save mode.




                                 @UI("infolder")

Identifies a field that will contain an input (has to exist) folder. The textfield

should present a button to browse the filesystem in open mode.
@UI("outfolder")

Identifies a field that will contain an output (parent folder has to exist) folder.

The textfield should present a button to browse the filesystem in save mode.


                                    @UI("crs")

Identifies a fields that contains a CRS definition. The textfield should present

a button to browse available CRS definitions.
@UI("process_XXXXX")

A set of annotations that identify processing region fields. Gui applications

can make use of these to autocompile the properties of a processing region.


Available properties are: process_north, process_south, process_west,

process_east, process_xres, process_yres, process_rows, process_cols
@UI("multilineX")

Identifies a textarea. The X value represents the lines to use. Ex "multiline5"

should create a textarea with 5 lines.
@UI("northing") and @UI("easting")

Identifies a textfield that can autocompile an easting and northing position.

Gui applications might be using this to listen to mouse click positions on a

map.




                                @UI("hide")

Identifies a module that should not be presented in the gui. This might for

example be due to the fact that the module is more than experimental.
How to write an OMS3 GIS module?

Writing (or porting) an OMS3 module is quite easy. Every module has input

and output parameters and once those are set, it needs to be executed.

When writing any module, it is a good manner to keep the handling of

input and output out of the game. Think it as: another module will take

care of that and pass me the read data.


This means that we can assume when writing the module that in most cases

the GIS data will be read and passed over by the Spatial Toolbox and we just

need to implement the algorithm.


With that in mind, we will now create a very simple module, in order to

understand the basics: the reprojection of a vector dataset.
The Vector Data Reprojector

                                   Writing the module

First thing we create a class named SimpleVectorReprojector.


Then we add some descriptive metadata to the class to document it. Mind
that if you don't do documentation while you code, you probably won't be

able to catch up with it.

 @Description("Module for vector reprojection.")
 @Author(name = "Andrea Antonello", contact = "http://www.hydrologis.com")
 @Keywords("CRS, Reprojection, Vector")
 @Label("Potsdam/Raster")
 @Status(Status.EXPERIMENTAL)
 @Name("vectorreproject")
 @License("General Public License Version 3 (GPLv3)")
 public class SimpleVectorReprojector {
Next we define the input and output variables. Our inputs will be the vector

data to reproject, which at that point we know to be a SimpleFeature-

Collection:

     @Description("The vector that has to be reprojected.")
     @In
     public SimpleFeatureCollection inVector;



and a code that will define the projection to apply to the data. For the code,

which will be in the EPSG format, we can use a String:

     @Description("The code defining the target crs (ex. EPSG:4328).")
     @UI("crs")
     @In
     public String pCode;



Note the @UI("crs") annotation, that will tell the gui generator that we

need a widget to choose coordinate reference systems from.
The output will be the reprojected vector data, so again a Simple-

FeatureCollection, simply annotated with the @Out annotation:

     @Description("The output reprojected vector.")
     @Out
     public SimpleFeatureCollection outVector = null;



Once inputs and output are defined, we now need a method that performs

the processing. In the case of the vector reprojection, the GeoTools library

makes things really easy: one line to create the CRS from the EPSG code

and one line to reproject and put the result in the output variable.

     @Execute
     public void process() throws Exception {
         CoordinateReferenceSystem targetCrs = CRS.decode(pCode);
         outVector = new ReprojectingFeatureCollection(inVector, targetCrs);
     }



In this case we do not need to free any resources, so that's it.
Building the library for the spatial toolbox

This is the moment in which we are going to be very happy about the fact

that we use maven for the project.


Building a library that can be loaded into the Spatial Toolbox is as easy as

running from commandline (inside the project folder, were the pom.xml file

resides:

 mvn install



Maven might download some updated jars and take a little while the first

time, but then it should state something like:

 ...
 [INFO]   [surefire:test]
 [INFO]   No tests to run.
 [INFO]   [jar:jar]
 [INFO]   Building jar: /home/moovida/.../jgt-dev-example/target/jgt-dev-example-1.0-SNAPSHOT.jar
 [INFO]   [install:install]
 [INFO]   [install:install]
 ...
The jgt-dev-example-1.0-SNAPSHOT.jar is the library that you

wanted to build. It is the library you will load into the spatial toolbox. You

might even want to rename it to something more in line with its content.

By tweaking the pom file, it is also possible to make maven take care of

changing name and version. This is left as an exercise.
uDig and the Spatial Toolbox

                                Installing uDig

Once the module library is packaged, the developer work is done and we can

enjoy the user part.


To proceed we have to make sure that uDig is installed on your computer.

If that is not the case, you just need to go to uDig's download area and get

the installer (or archive) for your operating system. Depending on what you

downloaded you can follow the installer's instruction or, in the case of the zip

archive, simply unzip it and run uDig.
Loading libraries in the Spatial Toolbox

The next step is to load the library in the uDig Spatial Toolbox.


To do so we fire up uDig:
To open the Spatial Toolbox go under Window -> Show View -> Other:
You will see all available views, from which you select the Spatial Toolbox:
which will show up, empty:
Push the settings button (the last button on the right):




and open the settings dialog:




The dialog allows you to load libraries through the plus button.
We now can load the library containing the vector reprojector.




Mind that uDig will need you to supply all the needed dependencies.

Udig itself supplies all the GeoTools dependencies.


Since we used also some JGrasstools methods, we will need to load also

that library.
Once the Ok button is pushed, uDig will browse the loaded libraries for OMS

annotated modules. To be precise, it searches for modules that have the

@Execute annotation and exatracts from them the information needed for

the toolbox. This leads, depending on the loaded libraries, to:
If you did everything as explained before, you should have the category

entries, but the module should not show up. This is due to the fact that we

defined the module as experimental, so the checkbox to activate

experimental support has to be checked:
Conclusions

In this last part we have seen how small yet powerful modules can be easily

integrated into uDig with a nice graphical user interface without additional

effort.

To summarize the steps:

 • write a module based on GeoTools, JTS, Jaitools, JGrasstools

 • annotate the fields and class properly to help the gui generator

 • bundle the final version of the module in a jar library

 • load it into uDig's Spatial Toolbox
Exercises

                               The line of sight

Needed data


        • DEM (raster map)

        • points of interest (vector map)

        • viewers (vector map)

Task

       Create a module that, finds out how many points of interest every

       viewer is able to see, if placed at the different heights from the

       ground: 1 meter, 10 meters, 100 meters. Create MultiLines for every

       viewer by bundling all the successful lines of sight to a point of

       interest.
The evacuation plan

Needed data


        • the road network (vector map)

        • the addresse along the roads (vector map)

        • an evacuation area (vector map)

Task

       Create a module that, given an evacuation area, subdivides that area

       in circles/annuluses centered in the area's centroid. It then has to

       produce the list of addresses divided by distance section.
Simple zonalstats

Needed data


        • DEM (raster map)

        • basins (vector map)

Task

       Create a module that extracts basics statistics (max, min, avg) from

       the DEM for each basin of the vector map.
This work is released under Creative Commons Attribution Share
Alike (CC-BY-SA)

Much of the knowledge needed to create this training material has
been produced by the sparkling knights of the GeoTools, JTS and
uDig community. Another essential source has been the Wikipedia
community effort.

Particular thanks go to those friends that directly or indirectly helped
out in the creation and review of this developer's handbook: Jody
Garnett from the uDig/GeoTools community and the TANTO team.

This tutorial was written with the support of the Geoinformation
Research Group of the University of Potsdam and HydroloGIS.

More Related Content

What's hot

Introduction to r studio on aws 2020 05_06
Introduction to r studio on aws 2020 05_06Introduction to r studio on aws 2020 05_06
Introduction to r studio on aws 2020 05_06Barry DeCicco
 
Python imaging-library-overview - [cuuduongthancong.com]
Python imaging-library-overview - [cuuduongthancong.com]Python imaging-library-overview - [cuuduongthancong.com]
Python imaging-library-overview - [cuuduongthancong.com]Dinh Sinh Mai
 
Extraction of Buildings from Satellite Images
Extraction of Buildings from Satellite ImagesExtraction of Buildings from Satellite Images
Extraction of Buildings from Satellite ImagesAkanksha Prasad
 
Image processing with matlab
Image processing with matlabImage processing with matlab
Image processing with matlabminhtaispkt
 
STATE SPACE GENERATION FRAMEWORK BASED ON BINARY DECISION DIAGRAM FOR DISTRIB...
STATE SPACE GENERATION FRAMEWORK BASED ON BINARY DECISION DIAGRAM FOR DISTRIB...STATE SPACE GENERATION FRAMEWORK BASED ON BINARY DECISION DIAGRAM FOR DISTRIB...
STATE SPACE GENERATION FRAMEWORK BASED ON BINARY DECISION DIAGRAM FOR DISTRIB...csandit
 
D3 Mapping Visualization
D3 Mapping VisualizationD3 Mapping Visualization
D3 Mapping VisualizationSudhir Chowbina
 
Java3 d 1
Java3 d 1Java3 d 1
Java3 d 1Por Non
 
Vectors data frames
Vectors data framesVectors data frames
Vectors data framesFAO
 
R getting spatial
R getting spatialR getting spatial
R getting spatialFAO
 
Implementation of a stream cipher based on bernoulli's map
Implementation of a stream cipher based on bernoulli's mapImplementation of a stream cipher based on bernoulli's map
Implementation of a stream cipher based on bernoulli's mapijcsit
 
Analyzing On-Chip Interconnect with Modern C++
Analyzing On-Chip Interconnect with Modern C++Analyzing On-Chip Interconnect with Modern C++
Analyzing On-Chip Interconnect with Modern C++Jeff Trull
 
Advanced data structures slide 2 2+
Advanced data structures slide 2 2+Advanced data structures slide 2 2+
Advanced data structures slide 2 2+jomerson remorosa
 
Visual Exploration of Large Data sets with D3, crossfilter and dc.js
Visual Exploration of Large Data sets with D3, crossfilter and dc.jsVisual Exploration of Large Data sets with D3, crossfilter and dc.js
Visual Exploration of Large Data sets with D3, crossfilter and dc.jsFlorian Georg
 
METHOD FOR A SIMPLE ENCRYPTION OF IMAGES BASED ON THE CHAOTIC MAP OF BERNOULLI
METHOD FOR A SIMPLE ENCRYPTION OF IMAGES BASED ON THE CHAOTIC MAP OF BERNOULLIMETHOD FOR A SIMPLE ENCRYPTION OF IMAGES BASED ON THE CHAOTIC MAP OF BERNOULLI
METHOD FOR A SIMPLE ENCRYPTION OF IMAGES BASED ON THE CHAOTIC MAP OF BERNOULLIijcsit
 

What's hot (19)

Introduction to r studio on aws 2020 05_06
Introduction to r studio on aws 2020 05_06Introduction to r studio on aws 2020 05_06
Introduction to r studio on aws 2020 05_06
 
Objects and Graphics
Objects and GraphicsObjects and Graphics
Objects and Graphics
 
Matlab dip
Matlab dipMatlab dip
Matlab dip
 
Python imaging-library-overview - [cuuduongthancong.com]
Python imaging-library-overview - [cuuduongthancong.com]Python imaging-library-overview - [cuuduongthancong.com]
Python imaging-library-overview - [cuuduongthancong.com]
 
Extraction of Buildings from Satellite Images
Extraction of Buildings from Satellite ImagesExtraction of Buildings from Satellite Images
Extraction of Buildings from Satellite Images
 
Image processing with matlab
Image processing with matlabImage processing with matlab
Image processing with matlab
 
STATE SPACE GENERATION FRAMEWORK BASED ON BINARY DECISION DIAGRAM FOR DISTRIB...
STATE SPACE GENERATION FRAMEWORK BASED ON BINARY DECISION DIAGRAM FOR DISTRIB...STATE SPACE GENERATION FRAMEWORK BASED ON BINARY DECISION DIAGRAM FOR DISTRIB...
STATE SPACE GENERATION FRAMEWORK BASED ON BINARY DECISION DIAGRAM FOR DISTRIB...
 
R language introduction
R language introductionR language introduction
R language introduction
 
OpenVX 1.0 Reference Guide
OpenVX 1.0 Reference GuideOpenVX 1.0 Reference Guide
OpenVX 1.0 Reference Guide
 
D3 Mapping Visualization
D3 Mapping VisualizationD3 Mapping Visualization
D3 Mapping Visualization
 
Jfreechart tutorial
Jfreechart tutorialJfreechart tutorial
Jfreechart tutorial
 
Java3 d 1
Java3 d 1Java3 d 1
Java3 d 1
 
Vectors data frames
Vectors data framesVectors data frames
Vectors data frames
 
R getting spatial
R getting spatialR getting spatial
R getting spatial
 
Implementation of a stream cipher based on bernoulli's map
Implementation of a stream cipher based on bernoulli's mapImplementation of a stream cipher based on bernoulli's map
Implementation of a stream cipher based on bernoulli's map
 
Analyzing On-Chip Interconnect with Modern C++
Analyzing On-Chip Interconnect with Modern C++Analyzing On-Chip Interconnect with Modern C++
Analyzing On-Chip Interconnect with Modern C++
 
Advanced data structures slide 2 2+
Advanced data structures slide 2 2+Advanced data structures slide 2 2+
Advanced data structures slide 2 2+
 
Visual Exploration of Large Data sets with D3, crossfilter and dc.js
Visual Exploration of Large Data sets with D3, crossfilter and dc.jsVisual Exploration of Large Data sets with D3, crossfilter and dc.js
Visual Exploration of Large Data sets with D3, crossfilter and dc.js
 
METHOD FOR A SIMPLE ENCRYPTION OF IMAGES BASED ON THE CHAOTIC MAP OF BERNOULLI
METHOD FOR A SIMPLE ENCRYPTION OF IMAGES BASED ON THE CHAOTIC MAP OF BERNOULLIMETHOD FOR A SIMPLE ENCRYPTION OF IMAGES BASED ON THE CHAOTIC MAP OF BERNOULLI
METHOD FOR A SIMPLE ENCRYPTION OF IMAGES BASED ON THE CHAOTIC MAP OF BERNOULLI
 

Similar to Opensource gis development - part 5

Interoduction to c++
Interoduction to c++Interoduction to c++
Interoduction to c++Amresh Raj
 
1 Project 2 Introduction - the SeaPort Project seri.docx
1  Project 2 Introduction - the SeaPort Project seri.docx1  Project 2 Introduction - the SeaPort Project seri.docx
1 Project 2 Introduction - the SeaPort Project seri.docxhoney725342
 
A Hand Book of Visual Basic 6.0.pdf.pdf
A Hand Book of Visual Basic 6.0.pdf.pdfA Hand Book of Visual Basic 6.0.pdf.pdf
A Hand Book of Visual Basic 6.0.pdf.pdfAnn Wera
 
F21SC Industrial Programming CW2 Data Analytics (35) 20192.docx
F21SC Industrial Programming CW2 Data Analytics (35) 20192.docxF21SC Industrial Programming CW2 Data Analytics (35) 20192.docx
F21SC Industrial Programming CW2 Data Analytics (35) 20192.docxlmelaine
 
Principal of objected oriented programming
Principal of objected oriented programming Principal of objected oriented programming
Principal of objected oriented programming Rokonuzzaman Rony
 
PRINCE PRESENTATION(1).pptx
PRINCE PRESENTATION(1).pptxPRINCE PRESENTATION(1).pptx
PRINCE PRESENTATION(1).pptxSajalKesharwani2
 
Cs6301 programming and datastactures
Cs6301 programming and datastacturesCs6301 programming and datastactures
Cs6301 programming and datastacturesK.s. Ramesh
 
Wireless Communication Network Communication
Wireless Communication Network CommunicationWireless Communication Network Communication
Wireless Communication Network CommunicationVrushali Lanjewar
 
Questions On The Code And Core Module
Questions On The Code And Core ModuleQuestions On The Code And Core Module
Questions On The Code And Core ModuleKatie Gulley
 
Programming in c++
Programming in c++Programming in c++
Programming in c++MalarMohana
 
Programming in c++
Programming in c++Programming in c++
Programming in c++sujathavvv
 
QEBU: AN ADVANCED GRAPHICAL EDITOR FOR THE EBUCORE METADATA SET | Paolo PASIN...
QEBU: AN ADVANCED GRAPHICAL EDITOR FOR THE EBUCORE METADATA SET | Paolo PASIN...QEBU: AN ADVANCED GRAPHICAL EDITOR FOR THE EBUCORE METADATA SET | Paolo PASIN...
QEBU: AN ADVANCED GRAPHICAL EDITOR FOR THE EBUCORE METADATA SET | Paolo PASIN...FIAT/IFTA
 

Similar to Opensource gis development - part 5 (20)

Technical Interview
Technical InterviewTechnical Interview
Technical Interview
 
Interoduction to c++
Interoduction to c++Interoduction to c++
Interoduction to c++
 
1 Project 2 Introduction - the SeaPort Project seri.docx
1  Project 2 Introduction - the SeaPort Project seri.docx1  Project 2 Introduction - the SeaPort Project seri.docx
1 Project 2 Introduction - the SeaPort Project seri.docx
 
iOS Application Development
iOS Application DevelopmentiOS Application Development
iOS Application Development
 
A Hand Book of Visual Basic 6.0.pdf.pdf
A Hand Book of Visual Basic 6.0.pdf.pdfA Hand Book of Visual Basic 6.0.pdf.pdf
A Hand Book of Visual Basic 6.0.pdf.pdf
 
F21SC Industrial Programming CW2 Data Analytics (35) 20192.docx
F21SC Industrial Programming CW2 Data Analytics (35) 20192.docxF21SC Industrial Programming CW2 Data Analytics (35) 20192.docx
F21SC Industrial Programming CW2 Data Analytics (35) 20192.docx
 
Principal of objected oriented programming
Principal of objected oriented programming Principal of objected oriented programming
Principal of objected oriented programming
 
Bcsl 031 solve assignment
Bcsl 031 solve assignmentBcsl 031 solve assignment
Bcsl 031 solve assignment
 
PRINCE PRESENTATION(1).pptx
PRINCE PRESENTATION(1).pptxPRINCE PRESENTATION(1).pptx
PRINCE PRESENTATION(1).pptx
 
chapter - 1.ppt
chapter - 1.pptchapter - 1.ppt
chapter - 1.ppt
 
Cs6301 programming and datastactures
Cs6301 programming and datastacturesCs6301 programming and datastactures
Cs6301 programming and datastactures
 
ThesisProposal
ThesisProposalThesisProposal
ThesisProposal
 
Wireless Communication Network Communication
Wireless Communication Network CommunicationWireless Communication Network Communication
Wireless Communication Network Communication
 
Questions On The Code And Core Module
Questions On The Code And Core ModuleQuestions On The Code And Core Module
Questions On The Code And Core Module
 
Unit 1
Unit  1Unit  1
Unit 1
 
Oopp Lab Work
Oopp Lab WorkOopp Lab Work
Oopp Lab Work
 
Programming in c++
Programming in c++Programming in c++
Programming in c++
 
Programming in c++
Programming in c++Programming in c++
Programming in c++
 
QEBU: AN ADVANCED GRAPHICAL EDITOR FOR THE EBUCORE METADATA SET | Paolo PASIN...
QEBU: AN ADVANCED GRAPHICAL EDITOR FOR THE EBUCORE METADATA SET | Paolo PASIN...QEBU: AN ADVANCED GRAPHICAL EDITOR FOR THE EBUCORE METADATA SET | Paolo PASIN...
QEBU: AN ADVANCED GRAPHICAL EDITOR FOR THE EBUCORE METADATA SET | Paolo PASIN...
 
Unit 5.ppt
Unit 5.pptUnit 5.ppt
Unit 5.ppt
 

More from Andrea Antonello

Smash & Geopaparazzi - State of the art 2021
Smash & Geopaparazzi - State of the art 2021Smash & Geopaparazzi - State of the art 2021
Smash & Geopaparazzi - State of the art 2021Andrea Antonello
 
GEOPAPARAZZI: STATE OF THE ART OF THE DIGITAL FIELD MAPPING APPLICATION
GEOPAPARAZZI: STATE OF THE ART OF THE DIGITAL FIELD MAPPING APPLICATIONGEOPAPARAZZI: STATE OF THE ART OF THE DIGITAL FIELD MAPPING APPLICATION
GEOPAPARAZZI: STATE OF THE ART OF THE DIGITAL FIELD MAPPING APPLICATIONAndrea Antonello
 
GEOPAPARAZZI STATE OF THE ART OF THE DIGITAL FIELD MAPPING APPLICATION
GEOPAPARAZZI STATE OF THE ART OF THE DIGITAL FIELD MAPPING APPLICATIONGEOPAPARAZZI STATE OF THE ART OF THE DIGITAL FIELD MAPPING APPLICATION
GEOPAPARAZZI STATE OF THE ART OF THE DIGITAL FIELD MAPPING APPLICATIONAndrea Antonello
 
Geopaparazzi Survey Server workshop
Geopaparazzi Survey Server workshopGeopaparazzi Survey Server workshop
Geopaparazzi Survey Server workshopAndrea Antonello
 
Geopaparazzi Survey Server Installation
Geopaparazzi Survey Server InstallationGeopaparazzi Survey Server Installation
Geopaparazzi Survey Server InstallationAndrea Antonello
 
Modelling natural hazards in gvSIG with the HortonMachine plugins
Modelling natural hazards in gvSIG with the HortonMachine pluginsModelling natural hazards in gvSIG with the HortonMachine plugins
Modelling natural hazards in gvSIG with the HortonMachine pluginsAndrea Antonello
 
GEOPAPARAZZI: STATE OF THE ART
GEOPAPARAZZI: STATE OF THE ARTGEOPAPARAZZI: STATE OF THE ART
GEOPAPARAZZI: STATE OF THE ARTAndrea Antonello
 
Geopaparazzi - NEVER OUT OF DATA IN THE FIELD
Geopaparazzi - NEVER OUT OF DATA IN THE FIELDGeopaparazzi - NEVER OUT OF DATA IN THE FIELD
Geopaparazzi - NEVER OUT OF DATA IN THE FIELDAndrea Antonello
 
The HortonMachine, for data analysis to help scientists... and not only
The HortonMachine, for data analysis to help scientists... and not onlyThe HortonMachine, for data analysis to help scientists... and not only
The HortonMachine, for data analysis to help scientists... and not onlyAndrea Antonello
 
Geopaparazzi & gvSIG Mobile - state of the art
Geopaparazzi & gvSIG Mobile - state of the artGeopaparazzi & gvSIG Mobile - state of the art
Geopaparazzi & gvSIG Mobile - state of the artAndrea Antonello
 
PART 6: FROM GEO INTO YOUR REPORT
PART 6: FROM GEO INTO YOUR REPORTPART 6: FROM GEO INTO YOUR REPORT
PART 6: FROM GEO INTO YOUR REPORTAndrea Antonello
 
PART 4: GEOGRAPHIC SCRIPTING
PART 4: GEOGRAPHIC SCRIPTINGPART 4: GEOGRAPHIC SCRIPTING
PART 4: GEOGRAPHIC SCRIPTINGAndrea Antonello
 
PART 3: THE SCRIPTING COMPOSER AND PYTHON
PART 3: THE SCRIPTING COMPOSER AND PYTHONPART 3: THE SCRIPTING COMPOSER AND PYTHON
PART 3: THE SCRIPTING COMPOSER AND PYTHONAndrea Antonello
 
Foss4g2016 Geopaparazzi Workshop
Foss4g2016 Geopaparazzi WorkshopFoss4g2016 Geopaparazzi Workshop
Foss4g2016 Geopaparazzi WorkshopAndrea Antonello
 
New tools for LiDAR, forestry, river management and hydro-geomorphology in gvSIG
New tools for LiDAR, forestry, river management and hydro-geomorphology in gvSIGNew tools for LiDAR, forestry, river management and hydro-geomorphology in gvSIG
New tools for LiDAR, forestry, river management and hydro-geomorphology in gvSIGAndrea Antonello
 
Digital field mapping with Geopaparazzi and gvSIG
Digital field mapping with Geopaparazzi and gvSIGDigital field mapping with Geopaparazzi and gvSIG
Digital field mapping with Geopaparazzi and gvSIGAndrea Antonello
 
Geopaparazzi, history of a digital mapping kid
Geopaparazzi, history of a digital mapping kidGeopaparazzi, history of a digital mapping kid
Geopaparazzi, history of a digital mapping kidAndrea Antonello
 
Geopaparazzi, state of the art
Geopaparazzi, state of the artGeopaparazzi, state of the art
Geopaparazzi, state of the artAndrea Antonello
 
Geographic scripting in uDig
Geographic scripting in uDigGeographic scripting in uDig
Geographic scripting in uDigAndrea Antonello
 

More from Andrea Antonello (20)

Smash & Geopaparazzi - State of the art 2021
Smash & Geopaparazzi - State of the art 2021Smash & Geopaparazzi - State of the art 2021
Smash & Geopaparazzi - State of the art 2021
 
GEOPAPARAZZI: STATE OF THE ART OF THE DIGITAL FIELD MAPPING APPLICATION
GEOPAPARAZZI: STATE OF THE ART OF THE DIGITAL FIELD MAPPING APPLICATIONGEOPAPARAZZI: STATE OF THE ART OF THE DIGITAL FIELD MAPPING APPLICATION
GEOPAPARAZZI: STATE OF THE ART OF THE DIGITAL FIELD MAPPING APPLICATION
 
GEOPAPARAZZI STATE OF THE ART OF THE DIGITAL FIELD MAPPING APPLICATION
GEOPAPARAZZI STATE OF THE ART OF THE DIGITAL FIELD MAPPING APPLICATIONGEOPAPARAZZI STATE OF THE ART OF THE DIGITAL FIELD MAPPING APPLICATION
GEOPAPARAZZI STATE OF THE ART OF THE DIGITAL FIELD MAPPING APPLICATION
 
Geopaparazzi Survey Server workshop
Geopaparazzi Survey Server workshopGeopaparazzi Survey Server workshop
Geopaparazzi Survey Server workshop
 
Geopaparazzi Survey Server Installation
Geopaparazzi Survey Server InstallationGeopaparazzi Survey Server Installation
Geopaparazzi Survey Server Installation
 
Modelling natural hazards in gvSIG with the HortonMachine plugins
Modelling natural hazards in gvSIG with the HortonMachine pluginsModelling natural hazards in gvSIG with the HortonMachine plugins
Modelling natural hazards in gvSIG with the HortonMachine plugins
 
GEOPAPARAZZI: STATE OF THE ART
GEOPAPARAZZI: STATE OF THE ARTGEOPAPARAZZI: STATE OF THE ART
GEOPAPARAZZI: STATE OF THE ART
 
Geopaparazzi - NEVER OUT OF DATA IN THE FIELD
Geopaparazzi - NEVER OUT OF DATA IN THE FIELDGeopaparazzi - NEVER OUT OF DATA IN THE FIELD
Geopaparazzi - NEVER OUT OF DATA IN THE FIELD
 
The HortonMachine, for data analysis to help scientists... and not only
The HortonMachine, for data analysis to help scientists... and not onlyThe HortonMachine, for data analysis to help scientists... and not only
The HortonMachine, for data analysis to help scientists... and not only
 
Geopaparazzi & gvSIG Mobile - state of the art
Geopaparazzi & gvSIG Mobile - state of the artGeopaparazzi & gvSIG Mobile - state of the art
Geopaparazzi & gvSIG Mobile - state of the art
 
PART 6: FROM GEO INTO YOUR REPORT
PART 6: FROM GEO INTO YOUR REPORTPART 6: FROM GEO INTO YOUR REPORT
PART 6: FROM GEO INTO YOUR REPORT
 
PART 5: RASTER DATA
PART 5: RASTER DATAPART 5: RASTER DATA
PART 5: RASTER DATA
 
PART 4: GEOGRAPHIC SCRIPTING
PART 4: GEOGRAPHIC SCRIPTINGPART 4: GEOGRAPHIC SCRIPTING
PART 4: GEOGRAPHIC SCRIPTING
 
PART 3: THE SCRIPTING COMPOSER AND PYTHON
PART 3: THE SCRIPTING COMPOSER AND PYTHONPART 3: THE SCRIPTING COMPOSER AND PYTHON
PART 3: THE SCRIPTING COMPOSER AND PYTHON
 
Foss4g2016 Geopaparazzi Workshop
Foss4g2016 Geopaparazzi WorkshopFoss4g2016 Geopaparazzi Workshop
Foss4g2016 Geopaparazzi Workshop
 
New tools for LiDAR, forestry, river management and hydro-geomorphology in gvSIG
New tools for LiDAR, forestry, river management and hydro-geomorphology in gvSIGNew tools for LiDAR, forestry, river management and hydro-geomorphology in gvSIG
New tools for LiDAR, forestry, river management and hydro-geomorphology in gvSIG
 
Digital field mapping with Geopaparazzi and gvSIG
Digital field mapping with Geopaparazzi and gvSIGDigital field mapping with Geopaparazzi and gvSIG
Digital field mapping with Geopaparazzi and gvSIG
 
Geopaparazzi, history of a digital mapping kid
Geopaparazzi, history of a digital mapping kidGeopaparazzi, history of a digital mapping kid
Geopaparazzi, history of a digital mapping kid
 
Geopaparazzi, state of the art
Geopaparazzi, state of the artGeopaparazzi, state of the art
Geopaparazzi, state of the art
 
Geographic scripting in uDig
Geographic scripting in uDigGeographic scripting in uDig
Geographic scripting in uDig
 

Recently uploaded

Computed Fields and api Depends in the Odoo 17
Computed Fields and api Depends in the Odoo 17Computed Fields and api Depends in the Odoo 17
Computed Fields and api Depends in the Odoo 17Celine George
 
DATA STRUCTURE AND ALGORITHM for beginners
DATA STRUCTURE AND ALGORITHM for beginnersDATA STRUCTURE AND ALGORITHM for beginners
DATA STRUCTURE AND ALGORITHM for beginnersSabitha Banu
 
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPT
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPTECONOMIC CONTEXT - LONG FORM TV DRAMA - PPT
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPTiammrhaywood
 
ENGLISH 7_Q4_LESSON 2_ Employing a Variety of Strategies for Effective Interp...
ENGLISH 7_Q4_LESSON 2_ Employing a Variety of Strategies for Effective Interp...ENGLISH 7_Q4_LESSON 2_ Employing a Variety of Strategies for Effective Interp...
ENGLISH 7_Q4_LESSON 2_ Employing a Variety of Strategies for Effective Interp...JhezDiaz1
 
Field Attribute Index Feature in Odoo 17
Field Attribute Index Feature in Odoo 17Field Attribute Index Feature in Odoo 17
Field Attribute Index Feature in Odoo 17Celine George
 
Incoming and Outgoing Shipments in 3 STEPS Using Odoo 17
Incoming and Outgoing Shipments in 3 STEPS Using Odoo 17Incoming and Outgoing Shipments in 3 STEPS Using Odoo 17
Incoming and Outgoing Shipments in 3 STEPS Using Odoo 17Celine George
 
Inclusivity Essentials_ Creating Accessible Websites for Nonprofits .pdf
Inclusivity Essentials_ Creating Accessible Websites for Nonprofits .pdfInclusivity Essentials_ Creating Accessible Websites for Nonprofits .pdf
Inclusivity Essentials_ Creating Accessible Websites for Nonprofits .pdfTechSoup
 
INTRODUCTION TO CATHOLIC CHRISTOLOGY.pptx
INTRODUCTION TO CATHOLIC CHRISTOLOGY.pptxINTRODUCTION TO CATHOLIC CHRISTOLOGY.pptx
INTRODUCTION TO CATHOLIC CHRISTOLOGY.pptxHumphrey A Beña
 
AMERICAN LANGUAGE HUB_Level2_Student'sBook_Answerkey.pdf
AMERICAN LANGUAGE HUB_Level2_Student'sBook_Answerkey.pdfAMERICAN LANGUAGE HUB_Level2_Student'sBook_Answerkey.pdf
AMERICAN LANGUAGE HUB_Level2_Student'sBook_Answerkey.pdfphamnguyenenglishnb
 
Gas measurement O2,Co2,& ph) 04/2024.pptx
Gas measurement O2,Co2,& ph) 04/2024.pptxGas measurement O2,Co2,& ph) 04/2024.pptx
Gas measurement O2,Co2,& ph) 04/2024.pptxDr.Ibrahim Hassaan
 
Influencing policy (training slides from Fast Track Impact)
Influencing policy (training slides from Fast Track Impact)Influencing policy (training slides from Fast Track Impact)
Influencing policy (training slides from Fast Track Impact)Mark Reed
 
USPS® Forced Meter Migration - How to Know if Your Postage Meter Will Soon be...
USPS® Forced Meter Migration - How to Know if Your Postage Meter Will Soon be...USPS® Forced Meter Migration - How to Know if Your Postage Meter Will Soon be...
USPS® Forced Meter Migration - How to Know if Your Postage Meter Will Soon be...Postal Advocate Inc.
 
Q4 English4 Week3 PPT Melcnmg-based.pptx
Q4 English4 Week3 PPT Melcnmg-based.pptxQ4 English4 Week3 PPT Melcnmg-based.pptx
Q4 English4 Week3 PPT Melcnmg-based.pptxnelietumpap1
 
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️9953056974 Low Rate Call Girls In Saket, Delhi NCR
 
ISYU TUNGKOL SA SEKSWLADIDA (ISSUE ABOUT SEXUALITY
ISYU TUNGKOL SA SEKSWLADIDA (ISSUE ABOUT SEXUALITYISYU TUNGKOL SA SEKSWLADIDA (ISSUE ABOUT SEXUALITY
ISYU TUNGKOL SA SEKSWLADIDA (ISSUE ABOUT SEXUALITYKayeClaireEstoconing
 
Like-prefer-love -hate+verb+ing & silent letters & citizenship text.pdf
Like-prefer-love -hate+verb+ing & silent letters & citizenship text.pdfLike-prefer-love -hate+verb+ing & silent letters & citizenship text.pdf
Like-prefer-love -hate+verb+ing & silent letters & citizenship text.pdfMr Bounab Samir
 
Roles & Responsibilities in Pharmacovigilance
Roles & Responsibilities in PharmacovigilanceRoles & Responsibilities in Pharmacovigilance
Roles & Responsibilities in PharmacovigilanceSamikshaHamane
 
What is Model Inheritance in Odoo 17 ERP
What is Model Inheritance in Odoo 17 ERPWhat is Model Inheritance in Odoo 17 ERP
What is Model Inheritance in Odoo 17 ERPCeline George
 

Recently uploaded (20)

Computed Fields and api Depends in the Odoo 17
Computed Fields and api Depends in the Odoo 17Computed Fields and api Depends in the Odoo 17
Computed Fields and api Depends in the Odoo 17
 
DATA STRUCTURE AND ALGORITHM for beginners
DATA STRUCTURE AND ALGORITHM for beginnersDATA STRUCTURE AND ALGORITHM for beginners
DATA STRUCTURE AND ALGORITHM for beginners
 
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPT
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPTECONOMIC CONTEXT - LONG FORM TV DRAMA - PPT
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPT
 
ENGLISH 7_Q4_LESSON 2_ Employing a Variety of Strategies for Effective Interp...
ENGLISH 7_Q4_LESSON 2_ Employing a Variety of Strategies for Effective Interp...ENGLISH 7_Q4_LESSON 2_ Employing a Variety of Strategies for Effective Interp...
ENGLISH 7_Q4_LESSON 2_ Employing a Variety of Strategies for Effective Interp...
 
Field Attribute Index Feature in Odoo 17
Field Attribute Index Feature in Odoo 17Field Attribute Index Feature in Odoo 17
Field Attribute Index Feature in Odoo 17
 
TataKelola dan KamSiber Kecerdasan Buatan v022.pdf
TataKelola dan KamSiber Kecerdasan Buatan v022.pdfTataKelola dan KamSiber Kecerdasan Buatan v022.pdf
TataKelola dan KamSiber Kecerdasan Buatan v022.pdf
 
Incoming and Outgoing Shipments in 3 STEPS Using Odoo 17
Incoming and Outgoing Shipments in 3 STEPS Using Odoo 17Incoming and Outgoing Shipments in 3 STEPS Using Odoo 17
Incoming and Outgoing Shipments in 3 STEPS Using Odoo 17
 
Inclusivity Essentials_ Creating Accessible Websites for Nonprofits .pdf
Inclusivity Essentials_ Creating Accessible Websites for Nonprofits .pdfInclusivity Essentials_ Creating Accessible Websites for Nonprofits .pdf
Inclusivity Essentials_ Creating Accessible Websites for Nonprofits .pdf
 
INTRODUCTION TO CATHOLIC CHRISTOLOGY.pptx
INTRODUCTION TO CATHOLIC CHRISTOLOGY.pptxINTRODUCTION TO CATHOLIC CHRISTOLOGY.pptx
INTRODUCTION TO CATHOLIC CHRISTOLOGY.pptx
 
AMERICAN LANGUAGE HUB_Level2_Student'sBook_Answerkey.pdf
AMERICAN LANGUAGE HUB_Level2_Student'sBook_Answerkey.pdfAMERICAN LANGUAGE HUB_Level2_Student'sBook_Answerkey.pdf
AMERICAN LANGUAGE HUB_Level2_Student'sBook_Answerkey.pdf
 
Gas measurement O2,Co2,& ph) 04/2024.pptx
Gas measurement O2,Co2,& ph) 04/2024.pptxGas measurement O2,Co2,& ph) 04/2024.pptx
Gas measurement O2,Co2,& ph) 04/2024.pptx
 
Influencing policy (training slides from Fast Track Impact)
Influencing policy (training slides from Fast Track Impact)Influencing policy (training slides from Fast Track Impact)
Influencing policy (training slides from Fast Track Impact)
 
USPS® Forced Meter Migration - How to Know if Your Postage Meter Will Soon be...
USPS® Forced Meter Migration - How to Know if Your Postage Meter Will Soon be...USPS® Forced Meter Migration - How to Know if Your Postage Meter Will Soon be...
USPS® Forced Meter Migration - How to Know if Your Postage Meter Will Soon be...
 
Q4 English4 Week3 PPT Melcnmg-based.pptx
Q4 English4 Week3 PPT Melcnmg-based.pptxQ4 English4 Week3 PPT Melcnmg-based.pptx
Q4 English4 Week3 PPT Melcnmg-based.pptx
 
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️
 
ISYU TUNGKOL SA SEKSWLADIDA (ISSUE ABOUT SEXUALITY
ISYU TUNGKOL SA SEKSWLADIDA (ISSUE ABOUT SEXUALITYISYU TUNGKOL SA SEKSWLADIDA (ISSUE ABOUT SEXUALITY
ISYU TUNGKOL SA SEKSWLADIDA (ISSUE ABOUT SEXUALITY
 
Like-prefer-love -hate+verb+ing & silent letters & citizenship text.pdf
Like-prefer-love -hate+verb+ing & silent letters & citizenship text.pdfLike-prefer-love -hate+verb+ing & silent letters & citizenship text.pdf
Like-prefer-love -hate+verb+ing & silent letters & citizenship text.pdf
 
Roles & Responsibilities in Pharmacovigilance
Roles & Responsibilities in PharmacovigilanceRoles & Responsibilities in Pharmacovigilance
Roles & Responsibilities in Pharmacovigilance
 
Model Call Girl in Tilak Nagar Delhi reach out to us at 🔝9953056974🔝
Model Call Girl in Tilak Nagar Delhi reach out to us at 🔝9953056974🔝Model Call Girl in Tilak Nagar Delhi reach out to us at 🔝9953056974🔝
Model Call Girl in Tilak Nagar Delhi reach out to us at 🔝9953056974🔝
 
What is Model Inheritance in Odoo 17 ERP
What is Model Inheritance in Odoo 17 ERPWhat is Model Inheritance in Odoo 17 ERP
What is Model Inheritance in Odoo 17 ERP
 

Opensource gis development - part 5

  • 1. Java Open Source GIS Development From the building blocks to extending an existing GIS application. Geoinformation Research Group, Department of Geography University of Potsdam August 2011 Part 5: Integrating with uDig and OMS3 Tutor: Andrea Antonello ydroloGIS nvironmental ngineering HydroloGIS S.r.l. - Via Siemens, 19 - 39100 Bolzano www.hydrologis.com
  • 2. Integrating with uDig and OMS3 We have learned to develop around raster and vector data, read and write formats and deal with projections and geometries. We also viewed the maps we produced in a simple and very limited viewer. What possibilities do we have to integrate in a professional way our knowledge up to this point into a real GIS environment? The solution we will see is the Spatial ToolBox for uDig. The toolbox generates, through proper description/annotation of the code, graphical user interfaces for your module. Modules can be loaded at runtime.
  • 3. Introduction to OMS3 The Object Modeling System (OMS3) is a pure Java, object-oriented lightweight modeling framework. OMS allows model construction and model application based on components. It is a collaborative project active among the U.S. Department of Agriculture and partner agencies and organizations involved with agro-environmental modeling. The lightweight of the framework consists mainly in the use of annotations in the code.
  • 4. The 3 steps in modeling Basically OMS3 supplies a set of annotations to put on the code to describe it and to mark fields and methods through them. As in most generic modeling frameworks, the three main steps are: • setting model resources and parameters • executing the model • freeing model resources if necessary In order to make the framework understand what has to be used as parameters and what as methods, we just need to annotate them. The upside is that we can structure our code as we like, using our own way of naming of variables and names.
  • 5. The few important things that need to be kept in mind are: • input and output fields have to be set public and annotated with @In and @Out • the method that executes the model, has to have no return value, no parameter and be annotated with @Execute Annotation example of input and output fields: @Description("The map of digital elevation model (DEM).") @In public GridCoverage2D inElev; @Description("The vector on which to calculate the profile.") @In public SimpleFeatureCollection inVector; @Description("The profile.") @Out public double[][] outProfile = null;
  • 6. Example module execution method: @Execute public void process(){ // execute your module here } Example for the resources freeing method: @Finalize public void free(){ // free resources before shutting module downw }
  • 7. Introduction to the uDig's Spatial Toolbox The Spatial Toolbox is a frontend for GIS users, a graphical user interface that can load any OMS3 annotated module. Mouse clicks, region settings, raster resolution and all (most) needed GIS notions are supplied to the widgets automatically. Annotations give hints. The gui labels and documentations are responsability of the module developer/maintainer.
  • 8. User Interface built through the OMS3 annotations ClassName The Class name is not an annotation, but anyways important, since it results in the name of the module. Choose it carefully.
  • 9. @Label The Label is a class annotation that is interpreted as a category. It is useful to group various module in categories and subcategories (separated by slash: / ).
  • 10. @In/@Out In and Out are field annotations that are used to define whether a field should be handled as input or output. In the gui this can result in separate tabs:
  • 11. @Description The Description annotation can be used for both classes and fields. In the case of fields it is used as the text for the fields in the gui. In the case of classes, it is used in the documentation page.
  • 12. @Units and @Range The Units and Range annotations are field annotations that add descriptive text to the gui.
  • 13. @Documentation The Documentation annotation contains a link to the file that holds all the module documentation, which is placed in the gui as a description tab.
  • 14. @Status, @Name, @Author, @License, @Keywords Additional annotations, if available, are used in the gui as additional information for the documentation.
  • 15. @UI, the annotation that makes the gui smarter The UI annotation is a field/class annotation that aims to make the gui smarter. Its content is not standardized, and can be interpreted by the gui generators to make the widgets more interactive. @UI("infile") Identifies a field that will contain an input (has to exist) file. The textfield should present a button to browse the filesystem in open mode.
  • 16. @UI("outfile") Identifies a field that will contain an output (parent folder has to exist) file. The textfield should present a button to browse the filesystem in save mode. @UI("infolder") Identifies a field that will contain an input (has to exist) folder. The textfield should present a button to browse the filesystem in open mode.
  • 17. @UI("outfolder") Identifies a field that will contain an output (parent folder has to exist) folder. The textfield should present a button to browse the filesystem in save mode. @UI("crs") Identifies a fields that contains a CRS definition. The textfield should present a button to browse available CRS definitions.
  • 18. @UI("process_XXXXX") A set of annotations that identify processing region fields. Gui applications can make use of these to autocompile the properties of a processing region. Available properties are: process_north, process_south, process_west, process_east, process_xres, process_yres, process_rows, process_cols
  • 19. @UI("multilineX") Identifies a textarea. The X value represents the lines to use. Ex "multiline5" should create a textarea with 5 lines.
  • 20. @UI("northing") and @UI("easting") Identifies a textfield that can autocompile an easting and northing position. Gui applications might be using this to listen to mouse click positions on a map. @UI("hide") Identifies a module that should not be presented in the gui. This might for example be due to the fact that the module is more than experimental.
  • 21. How to write an OMS3 GIS module? Writing (or porting) an OMS3 module is quite easy. Every module has input and output parameters and once those are set, it needs to be executed. When writing any module, it is a good manner to keep the handling of input and output out of the game. Think it as: another module will take care of that and pass me the read data. This means that we can assume when writing the module that in most cases the GIS data will be read and passed over by the Spatial Toolbox and we just need to implement the algorithm. With that in mind, we will now create a very simple module, in order to understand the basics: the reprojection of a vector dataset.
  • 22. The Vector Data Reprojector Writing the module First thing we create a class named SimpleVectorReprojector. Then we add some descriptive metadata to the class to document it. Mind that if you don't do documentation while you code, you probably won't be able to catch up with it. @Description("Module for vector reprojection.") @Author(name = "Andrea Antonello", contact = "http://www.hydrologis.com") @Keywords("CRS, Reprojection, Vector") @Label("Potsdam/Raster") @Status(Status.EXPERIMENTAL) @Name("vectorreproject") @License("General Public License Version 3 (GPLv3)") public class SimpleVectorReprojector {
  • 23. Next we define the input and output variables. Our inputs will be the vector data to reproject, which at that point we know to be a SimpleFeature- Collection: @Description("The vector that has to be reprojected.") @In public SimpleFeatureCollection inVector; and a code that will define the projection to apply to the data. For the code, which will be in the EPSG format, we can use a String: @Description("The code defining the target crs (ex. EPSG:4328).") @UI("crs") @In public String pCode; Note the @UI("crs") annotation, that will tell the gui generator that we need a widget to choose coordinate reference systems from.
  • 24. The output will be the reprojected vector data, so again a Simple- FeatureCollection, simply annotated with the @Out annotation: @Description("The output reprojected vector.") @Out public SimpleFeatureCollection outVector = null; Once inputs and output are defined, we now need a method that performs the processing. In the case of the vector reprojection, the GeoTools library makes things really easy: one line to create the CRS from the EPSG code and one line to reproject and put the result in the output variable. @Execute public void process() throws Exception { CoordinateReferenceSystem targetCrs = CRS.decode(pCode); outVector = new ReprojectingFeatureCollection(inVector, targetCrs); } In this case we do not need to free any resources, so that's it.
  • 25. Building the library for the spatial toolbox This is the moment in which we are going to be very happy about the fact that we use maven for the project. Building a library that can be loaded into the Spatial Toolbox is as easy as running from commandline (inside the project folder, were the pom.xml file resides: mvn install Maven might download some updated jars and take a little while the first time, but then it should state something like: ... [INFO] [surefire:test] [INFO] No tests to run. [INFO] [jar:jar] [INFO] Building jar: /home/moovida/.../jgt-dev-example/target/jgt-dev-example-1.0-SNAPSHOT.jar [INFO] [install:install] [INFO] [install:install] ...
  • 26. The jgt-dev-example-1.0-SNAPSHOT.jar is the library that you wanted to build. It is the library you will load into the spatial toolbox. You might even want to rename it to something more in line with its content. By tweaking the pom file, it is also possible to make maven take care of changing name and version. This is left as an exercise.
  • 27. uDig and the Spatial Toolbox Installing uDig Once the module library is packaged, the developer work is done and we can enjoy the user part. To proceed we have to make sure that uDig is installed on your computer. If that is not the case, you just need to go to uDig's download area and get the installer (or archive) for your operating system. Depending on what you downloaded you can follow the installer's instruction or, in the case of the zip archive, simply unzip it and run uDig.
  • 28. Loading libraries in the Spatial Toolbox The next step is to load the library in the uDig Spatial Toolbox. To do so we fire up uDig:
  • 29. To open the Spatial Toolbox go under Window -> Show View -> Other:
  • 30. You will see all available views, from which you select the Spatial Toolbox:
  • 31. which will show up, empty:
  • 32. Push the settings button (the last button on the right): and open the settings dialog: The dialog allows you to load libraries through the plus button.
  • 33. We now can load the library containing the vector reprojector. Mind that uDig will need you to supply all the needed dependencies. Udig itself supplies all the GeoTools dependencies. Since we used also some JGrasstools methods, we will need to load also that library.
  • 34. Once the Ok button is pushed, uDig will browse the loaded libraries for OMS annotated modules. To be precise, it searches for modules that have the @Execute annotation and exatracts from them the information needed for the toolbox. This leads, depending on the loaded libraries, to:
  • 35. If you did everything as explained before, you should have the category entries, but the module should not show up. This is due to the fact that we defined the module as experimental, so the checkbox to activate experimental support has to be checked:
  • 36. Conclusions In this last part we have seen how small yet powerful modules can be easily integrated into uDig with a nice graphical user interface without additional effort. To summarize the steps: • write a module based on GeoTools, JTS, Jaitools, JGrasstools • annotate the fields and class properly to help the gui generator • bundle the final version of the module in a jar library • load it into uDig's Spatial Toolbox
  • 37. Exercises The line of sight Needed data • DEM (raster map) • points of interest (vector map) • viewers (vector map) Task Create a module that, finds out how many points of interest every viewer is able to see, if placed at the different heights from the ground: 1 meter, 10 meters, 100 meters. Create MultiLines for every viewer by bundling all the successful lines of sight to a point of interest.
  • 38. The evacuation plan Needed data • the road network (vector map) • the addresse along the roads (vector map) • an evacuation area (vector map) Task Create a module that, given an evacuation area, subdivides that area in circles/annuluses centered in the area's centroid. It then has to produce the list of addresses divided by distance section.
  • 39. Simple zonalstats Needed data • DEM (raster map) • basins (vector map) Task Create a module that extracts basics statistics (max, min, avg) from the DEM for each basin of the vector map.
  • 40. This work is released under Creative Commons Attribution Share Alike (CC-BY-SA) Much of the knowledge needed to create this training material has been produced by the sparkling knights of the GeoTools, JTS and uDig community. Another essential source has been the Wikipedia community effort. Particular thanks go to those friends that directly or indirectly helped out in the creation and review of this developer's handbook: Jody Garnett from the uDig/GeoTools community and the TANTO team. This tutorial was written with the support of the Geoinformation Research Group of the University of Potsdam and HydroloGIS.