Statistics
| Revision:

root / branches / v10 / extensions / extPublish / src-test / org / gvsig / remoteservices / conf / mapserver / test / MapServerTestWCS.java @ 13570

History | View | Annotate | Download (2.63 KB)

1
package org.gvsig.remoteservices.conf.mapserver.test;
2

    
3
import org.gvsig.remoteservices.conf.mapserver.MapServerConfiguration;
4
import org.gvsig.remoteservices.conf.mapserver.MapServerConfiguration.CRS;
5
import org.gvsig.remoteservices.conf.mapserver.MapServerConfiguration.MetadataWeb;
6
import org.gvsig.remoteservices.conf.mapserver.MapServerConfiguration.OutputFormat;
7

    
8
/**
9
 * Testing the capability to generate an OGC WCS service with mapserver.
10
 * @author "Luis W. Sevilla" <sevilla_lui@gva.es>
11
 */
12
public class MapServerTestWCS {
13
        private void test() {
14
                String cgiURL = "http://gruposigp1:81/cgi-bin/mapserv.exe";
15
                //String msHome = "C:/ms4w/test/"; // JP machine
16
                String msHome = "C:/ms4w/mapserver/"; // LWS machine
17
                String msData = msHome+"data/";
18
                String mapFileName = msHome+"mapas/"+"prbwcs.map";
19
                
20
                
21
                String serviceURL = cgiURL+"?map="+mapFileName;
22
                String imagePath = "../tmp/";
23
            String imageURL = "../tmp/";
24

    
25
                MapServerConfiguration.ConfigFile map = new MapServerConfiguration.ConfigFile();
26
                map.mapName= "MAPSERVER_WCS_TEST";
27
                map.mapStatus="ON";
28
                map.mapUnits="METERS";
29
                map.mapShapePath = msData; 
30
                map.mapcrs= new MapServerConfiguration.CRS("EPSG:23030",true);
31
                map.setExtent(765987.140492,4300252.05875,777471.340492,4306158.65875);
32
                
33
                // Espec?fico de WCS
34
                map.add(new OutputFormat(
35
                                "GEOTIFF_INT16", "GDAL/GTiff", "INT16", "tif"));
36
                map.add(new OutputFormat("" +
37
                                "IMG", "GDAL/HFA", "BYTE", "img"));
38
                map.add(new OutputFormat(
39
                                "GEOTIFF", "GDAL/GTiff", "BYTE", "tif"));
40
                
41
                // General
42
                MapServerConfiguration.WebMap web = map.www;
43
                web.imagepath=imagePath;
44
                web.imageurl=imageURL;
45
                MetadataWeb md = web.metadata;
46
                md.onlineresource=serviceURL;
47
                // Espec?fico WCS
48
                md.setServiceAsWCS();
49
                md.label = "wcs test server";        
50
            md.keywordlist = "WCS";
51

    
52

    
53
                MapServerConfiguration.RasterLayer capa = new MapServerConfiguration.RasterLayer();
54
                capa.setDump(true);
55
                capa.setName("orthop25_191204");
56
                capa.data = "orthop25_191204.tif";
57
                capa.type="RASTER";
58
                capa.setExtent(765987.140492,4300252.05875,777471.340492,4306158.65875);
59
                capa.metadata.setServiceAsWCS();
60
                capa.metadata.crs = new CRS("EPSG:23030", false);
61
                capa.metadata.label = capa.metadata.title;
62
                capa.setTitle(null);
63
                capa.metadata.setRangeset("bands");
64

    
65
                capa.metadata.resolution = "0.7 -0.7";
66
                capa.metadata.bandCount = "3";
67
                capa.metadata.nativeFormat = "ecw";
68
                capa.metadata.formats = "GEOTIFF_INT16";
69
                
70
                System.out.println("Generating .map ...");
71
                
72
                map.add(capa);
73
                
74
                map.generate();//mapFileName);
75

    
76
                System.out.println("done.");
77
        }
78
        public MapServerTestWCS() {
79
                test();
80
        }
81
        
82
        public static void main(String args[]) {
83
                new MapServerTestWCS();
84
        }
85

    
86
}