Mapserver, Mscross and Grida3: Roberto Demontis - Crs4
Mapserver, Mscross and Grida3: Roberto Demontis - Crs4
15 dicembre 2008
What are
MapServer is an Open Source development environment for building spatially-enabled internet applications. msCross is a AJAX (WEB 2.0) WEB GIS client ( Mapserver, Web Gis Services ...)
Standard configuration - Apache web server and mapserver cgi-bin interface [server] - msCross JavaScript library (Ajax) [client] Typical data - Shapefiles ( shp + dbf ), - GRASS ( raster ), - Postgis (database table)
Problems
The data to be shown is located in the spooler dir: $EF_SPOOLER owned by the user + The data access depends on the apache user's privileges = Lack of security
http://grd3wk01.crs4.it/cgi-bin/mapserv
Solution (minimal)
The data to be shown is located in the spooler dir: $EF_SPOOLER owned by the user + Use of the CGI Interface inside a script shell executed by the user = An enginframe service in the new portal (The portal is not accesible outside Crs4)
/enginframe/agisgrid/agisgrid.xml?_uri=//agisgrid/ landsuit_mapserver_NEW
Solution (minimal)
Interface:
Single map layer (GRASS raster) Interactive with Multiple layer (Shapefiles and Grass raster)
Map files:
Single map layer (GRASS raster) Interactive with Multiple layer (Shapefiles and Grass raster)
Solution (minimal)
Solution (minimal)
myMap1 = new msMap( document.getElementById('dc_map') , 'standardCornerRight'); if ( window.location.host == 'grd3port.crs4.it:18080') myMap1.setCgi('/enginframe/agisgrid/agisgrid.xml? _uri=//agisgrid/landsuit_mapserver_NEW' ); else myMap1.setCgi('http://grd3wk01.crs4.it/cgi-bin/mapserv?' ); myMap1.setFullExtent( 1521000, 1560000, 4358000 ); myMap1.setMapFile( '..../data/mscross.map'); myMap2 = new msMap( document.getElementById('dc_ref') ); ................... myMap1.setReferenceMap(myMap2); myMap1.redraw(); myMap2.redraw();
Solution (minimal)
this.get_map_url = function() { var my_url; if (_protocol == 'mapservercgi') { ............ my_url = _cgi + '?mode=' + _mode + '&' + _map_file + '&' + ext + '&' + size + '&layers=' + _layers; ...............
replaced with:
my_url = _cgi + '&mode=' + _mode + '&' + _map_file + '&' + ext + '&' + size + '&layers=' + _layers;
AGISGRID
- postgis table --> psql2shp --> shp+dbf files - gzipped ascii file --> GRASS --> GRASS raster