Ignore:
Timestamp:
2009-06-17T09:46:26+02:00 (16 years ago)
Author:
stoecker
Message:

fix build issues

File:
1 edited

Legend:

Unmodified
Added
Removed
  • applications/editors/josm/plugins/cadastre-fr/src/cadastre_fr/CadastreGrabber.java

    r13784 r15961  
    1414import org.openstreetmap.josm.Main;
    1515import org.openstreetmap.josm.data.coor.EastNorth;
     16import org.openstreetmap.josm.io.OsmTransferException;
    1617import org.openstreetmap.josm.io.ProgressInputStream;
    1718
    1819public class CadastreGrabber {
    1920
    20         public static final double epsilon = 1e-11;
    21        
    22         private CadastreInterface wmsInterface = new CadastreInterface(this);
     21    public static final double epsilon = 1e-11;
     22
     23    private CadastreInterface wmsInterface = new CadastreInterface(this);
    2324    private String lastWMSLayerName = null;
    24        
    25         CadastreGrabber() {
    26         getWmsInterface().downloadCancelled = false;       
    27         }
    28        
    29     public GeorefImage grab(WMSLayer wmsLayer, EastNorth lambertMin, EastNorth lambertMax) throws IOException {
     25
     26    CadastreGrabber() {
     27        getWmsInterface().downloadCancelled = false;
     28    }
     29
     30    public GeorefImage grab(WMSLayer wmsLayer, EastNorth lambertMin, EastNorth lambertMax) throws IOException, OsmTransferException {
    3031
    3132        try {
     
    5859    private URL getURLVector(EastNorth lambertMin, EastNorth lambertMax) throws MalformedURLException {
    5960        String str = new String(wmsInterface.baseURL+"/scpc/wms?version=1.1&request=GetMap");
    60                 str += "&layers=CDIF:LS3,CDIF:LS2,CDIF:LS1,CDIF:PARCELLE,CDIF:NUMERO";
    61                 str += ",CDIF:PT3,CDIF:PT2,CDIF:PT1,CDIF:LIEUDIT";
    62                 str += ",CDIF:SUBSECTION";
    63                 str += ",CDIF:SECTION";
    64                 str += ",CDIF:COMMUNE";
    65                 str += "&format=image/png";
    66                 //str += "&format=image/jpeg";
    67                 str += "&bbox="+lambertMin.east()+",";
    68                 str += lambertMin.north() + ",";
    69                 str += lambertMax.east() + ",";
    70                 str += lambertMax.north();
    71                 //str += "&width=800&height=600"; // maximum allowed by wms server
     61        str += "&layers=CDIF:LS3,CDIF:LS2,CDIF:LS1,CDIF:PARCELLE,CDIF:NUMERO";
     62        str += ",CDIF:PT3,CDIF:PT2,CDIF:PT1,CDIF:LIEUDIT";
     63        str += ",CDIF:SUBSECTION";
     64        str += ",CDIF:SECTION";
     65        str += ",CDIF:COMMUNE";
     66        str += "&format=image/png";
     67        //str += "&format=image/jpeg";
     68        str += "&bbox="+lambertMin.east()+",";
     69        str += lambertMin.north() + ",";
     70        str += lambertMax.east() + ",";
     71        str += lambertMax.north();
     72        //str += "&width=800&height=600"; // maximum allowed by wms server
    7273        str += "&width=1000&height=800"; // maximum allowed by wms server
    73                 str += "&styles=LS3_90,LS2_90,LS1_90,PARCELLE_90,NUMERO_90,PT3_90,PT2_90,PT1_90,LIEUDIT_90";
    74                 str += ",SUBSECTION_90";
    75                 str += ",SECTION_90";
    76                 str += ",COMMUNE_90";
    77                 System.out.println("URL="+str);
     74        str += "&styles=LS3_90,LS2_90,LS1_90,PARCELLE_90,NUMERO_90,PT3_90,PT2_90,PT1_90,LIEUDIT_90";
     75        str += ",SUBSECTION_90";
     76        str += ",SECTION_90";
     77        str += ",COMMUNE_90";
     78        System.out.println("URL="+str);
    7879        return new URL(str.replace(" ", "%20"));
    79         }
     80    }
    8081
    81         private BufferedImage grab(URL url) throws IOException {
    82             wmsInterface.urlConn = (HttpURLConnection)url.openConnection();
    83             wmsInterface.urlConn.setRequestMethod("GET");
    84             wmsInterface.setCookie();
    85                 InputStream is = new ProgressInputStream(wmsInterface.urlConn, Main.pleaseWaitDlg);
    86                 BufferedImage img = ImageIO.read(is);
     82    private BufferedImage grab(URL url) throws IOException, OsmTransferException {
     83        wmsInterface.urlConn = (HttpURLConnection)url.openConnection();
     84        wmsInterface.urlConn.setRequestMethod("GET");
     85        wmsInterface.setCookie();
     86        InputStream is = new ProgressInputStream(wmsInterface.urlConn, Main.pleaseWaitDlg);
     87        BufferedImage img = ImageIO.read(is);
    8788        is.close();
    8889        return img;
    89         }
     90    }
    9091
    9192    public CadastreInterface getWmsInterface() {
Note: See TracChangeset for help on using the changeset viewer.