centro de referência em informação ambiental, cria sidnei de souza abril 2006 mapcria web service

10
Centro de Referência em Informação Ambiental, CRIA Sidnei de Souza Abril 2006 mapcria web service

Upload: hallie-coxon

Post on 31-Mar-2015

215 views

Category:

Documents


1 download

TRANSCRIPT

Page 1: Centro de Referência em Informação Ambiental, CRIA Sidnei de Souza Abril 2006 mapcria web service

Centro de Referência em Informação Ambiental, CRIA

Sidnei de Souza

Abril 2006

mapcria web service

Page 2: Centro de Referência em Informação Ambiental, CRIA Sidnei de Souza Abril 2006 mapcria web service

it is a web service developed by CRIA to facilitate the implementation of web applications that require the dynamic production of maps

It uses the University of Minnesota MapServer C library, MapScript wrap for Perl, v4.2.0[ http://mapserver.gis.umn.edu ]

Developed in Perl v5.8.0

Available as a SOAP server

Allows multiple simultaneous jobs

Map initial characteristics are specified on an XML document at once

Accepts local layers files as well as available via WMS

Provides several functions to maintain interaction

mapcria web service

Page 3: Centro de Referência em Informação Ambiental, CRIA Sidnei de Souza Abril 2006 mapcria web service

mapcriamapcria

files

mapfile

wms

CGIapplication

CGIapplication

drawpolygons

drawpoints

drawlines

dbqueries

draw()

User clicks on a web page link that calls a CGI application

The CGI creates an XML file that describes the map to be

produced.

The XML file is sent to the mapcria web service using a SOAP connection

Loads the layers according to the definitions on an specific mapfile.

Returns a ticket to the caller application

get_image(ticket)

The application requests the newly created map image.

The server delivers the requested image

Draws the requested elements on the map.

mapcria web service basic use

Page 4: Centro de Referência em Informação Ambiental, CRIA Sidnei de Souza Abril 2006 mapcria web service

mapcriamapcria

CGIapplication

CGIapplication

The service performs the required zoom on the map

zoom_rectangle(ticket)

get_image(ticket)

The application requests a zoom and the resulting image.

The server delivers the requested zoomed image

The user selects an area to zoom in

mapcria web service basic use

Page 5: Centro de Referência em Informação Ambiental, CRIA Sidnei de Souza Abril 2006 mapcria web service

is a set of general purpose CGI Perl scripts that implement the basic functionalities required for the visualization of (and interaction with) maps produced by the mapcria web service.

Once a map is initialized on the server, the mapcria viewer takes control of the job of providing the user with tools to continue the interaction with the server.

The basic tools provided by the viewer are:

Zoom In and Out

Panning

Reference map window

Layers on / off panel

Active layers window

Plug-in to search a database based on selected coordinates *

Plug-in to search a database to find points to be plotted on the map *

User help information window

Standard page generation for printing

Multi-language interface

* requires special applications according to the system

mapcria viewer

Page 6: Centro de Referência em Informação Ambiental, CRIA Sidnei de Souza Abril 2006 mapcria web service

mapcriamapcria

CGIapplication

CGIapplication

The application starts the mapcria viewer passing the ticket as a parameter.

mapcria web service use with the mapcria viewer

The CGI creates an XML file that describes the map to be

produced.

The XML file is sent to the mapcria web service

Returns a ticket

mapcriaviewer

mapcriaviewer

The mapcria viewer takes control of the job and provides an interface with the commonly used functions.

Map viewer window

Layers control window

Reference map window

Active layers window

Database search window *Symbols select window *

User help window

Printable page

Page 7: Centro de Referência em Informação Ambiental, CRIA Sidnei de Souza Abril 2006 mapcria web service

mapcria web service initial XML schema detail (draw)

Page 8: Centro de Referência em Informação Ambiental, CRIA Sidnei de Souza Abril 2006 mapcria web service

mapcria web service methods

draw

get_active_layers

get_image_width

get_image_height

get_image

get_scalebar

get_reference

get_extent

zoom_point

zoom_rectangle

zoom_coords

zoom_all

set_visibility

toogle_layer

get_field_value_by_coord

set_image_scale

click2map

del_object

finish

Page 9: Centro de Referência em Informação Ambiental, CRIA Sidnei de Souza Abril 2006 mapcria web service

mapcria web service example

#!/usr/local/bin/perl$|=1;use strict;use SOAP::Lite; my ($long,$lat) = @ARGV; print “Content-type: image/png\n\n”;

my $soap = SOAP::Lite -> uri("http://saruman.cria.org.br/manager") -> proxy(“tcp://saruman.cria.org.br:5900/", timeout => 15) -> on_fault( sub { return undef } );

my $xml =<<EOM;<?xml version="1.0" encoding="UTF-8"?><mapcria xmlns:xsi=http://www.w3.org/2001/XMLSchema-instancexsi:noNamespaceSchemaLocation="http://www.cria.org.br/schema/mapcria3.0.xsd"> <user>CRIA demo Manager</user> <map id="MAPA"> <set_defaults>SP</set_defaults> <set_extent>-53.11,-19.78,-42.69,-25.30</set_extent> <set_extent_text>false</set_extent_text> <set_image_transparent>false</set_image_transparent> <set_image_width>160</set_image_width> <set_image_height>120</set_image_height> <layer id="BRASIL_UF"> <set_visibility>true</set_visibility> <set_fill_color>255,255,255</set_fill_color> </layer> <layer id="BRASIL_MUN"> <set_visibility>false</set_visibility> </layer> <query_by_coord id="municipio"> <set_layer>BRASIL_MUN</set_layer> <set_outline_color>255,0,0</set_outline_color> <set_symbol_color>255,0,0</set_symbol_color> <set_symbol>point</set_symbol> <set_symbol_size>8</set_symbol_size> <set_coords>$long,$lat</set_coords> </query_by_coord>

</map></mapcria>EOM

my $ticket = $soap->draw($xml)->result();print $soap->get_image($ticket)->result();$soap->finish($ticket);

Page 10: Centro de Referência em Informação Ambiental, CRIA Sidnei de Souza Abril 2006 mapcria web service

current version documentation is available at

http://www.cria.org.br/mapcria/doc/

Questions?

On-line demonstration?

Thank you!

LAST SLIDE…