NAME

Gtk2::Ex::Geo::Glue - Some of the pieces of a GIS

SYNOPSIS

Look at the test code for an example.

GUI

The GUI is rather simple but hopefully usable and extendable.

METHODS

new

no parameters (todo: treestore columns should be parameters)

creates toolbar, entry, model, tree_view and overlay widgets

add_history(\@history)

@history is a history for the entry

@history = get_history()

@history is the history from the entry

set_event_handler($event_handler,$user_param);

$event_handler is a user subroutine for handling events happening in the overlay widget, it is called with parameters ($user_param, $event, @xy);

set_draw_on($draw_on,$user_param);

$draw_on is a user subroutine for drawing on the overlay widget once the overlay widget has created it, it is called with parameters ($user_param, $pixmap);

toolbar

returns a Gtk2::Toolbar, which is tied to attribute {toolbar} when a new Gtk2::Ex::Geo::Glue object is created, a subroutine is connected to each toolbar button

add

calls Gtk2::FileChooserDialog and if a file of known type is selected, opens it and adds it by calling add_layer

p($something,%options)

an extended print, tries to print the contents of a hash or array nicely

plot($something,%options)

an interface to gnuplot, tries to plot the contents of a hash or array nicely

clip_selected

returns the visible piece of a selected raster

todo: same for vector layers

set_iter($iter,$layer,$name)

calls {model}->set for the given $iter use $name and data from $layer

probably private

add_layermy($layer,$name,$do_not_zoom_to);

adds $layer with $name to overlay and model

the default behavior is to zoom to the new layer

get($name)

returns a layer by its name

get_focal($name)

returns a clipped part of a raster layer by its name

todo: same for vector layers

update($index_or_name)

$index_or_name is optional

updates the tree_view (by calling set_iter) for the given layer

move_down

moves the selected layer down in the overlay

move_up

moves the selected layer up in the overlay

delete_selected

removes the selected layer from the overlay

selected_layer

returns the selected layer

top_layer

returns the top layer

toggle

hides/shows the selected layer

eval_entry and shell

eval_entry is called when something happens in the entry, arrow up and down retrieve entries from the history

the entry is given to Perl eval function after

1) the variable names are inspected and found layer names are replaced with pointers to real layers

2) keyword "focal:" in the beginning of an entry is removed and all references to layers are replaced with clipped versions

shell suspends the main Gtk2 window and gives the focus to the text-based terminal with a plain Perl eval loop