Ignore:
Timestamp:
2010-12-29T23:18:37+01:00 (15 years ago)
Author:
pieren
Message:

Removed the building shapes recognition

File:
1 edited

Legend:

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

    r23190 r24907  
    5959    public static int currentFormat;
    6060
    61     private static final int cBBoxForBuildings = 50; // hard coded size of grabbed boxes for building layers
    62 
    6361    private ArrayList<EastNorthBound> dividedBbox = new ArrayList<EastNorthBound>();
    6462
     
    7775    private boolean isRaster = false;
    7876    private boolean isAlreadyGeoreferenced = false;
    79     private boolean buildingsOnly = false;
    8077    public double X0, Y0, angle, fX, fY;
    8178
     
    9592
    9693    public WMSLayer(String location, String codeCommune, int lambertZone) {
    97         super(buildName(location, codeCommune, false));
     94        super(buildName(location, codeCommune));
    9895        this.location = location;
    9996        this.codeCommune = codeCommune;
     
    118115    }
    119116
    120     private static String buildName(String location, String codeCommune, boolean buildingOnly) {
     117    private static String buildName(String location, String codeCommune) {
    121118        String ret = location.toUpperCase();
    122119        if (codeCommune != null && !codeCommune.equals(""))
    123120            ret += "(" + codeCommune + ")";
    124         if (buildingOnly)
    125             ret += ".b";
    126121        return  ret;
    127122    }
    128123
    129124    private String rebuildName() {
    130         return buildName(this.location.toUpperCase(), this.codeCommune, this.buildingsOnly);
     125        return buildName(this.location.toUpperCase(), this.codeCommune);
    131126    }
    132127
     
    142137                divideBbox(b, Integer.parseInt(Main.pref.get("cadastrewms.rasterDivider",
    143138                        CadastrePreferenceSetting.DEFAULT_RASTER_DIVIDER)), 0);
    144             } else if (buildingsOnly)
    145                 divideBbox(b, 5, cBBoxForBuildings);
    146             else
     139            } else
    147140                divideBbox(b, Integer.parseInt(Main.pref.get("cadastrewms.scale", Scale.X1.toString())), 0);
    148141        } else
     
    155148            GeorefImage newImage;
    156149            try {
    157                 if (buildingsOnly == false)
    158                     newImage = grabber.grab(this, n.min, n.max);
    159                 else { // TODO
    160                     GeorefImage buildings = grabber.grabBuildings(this, n.min, n.max);
    161                     GeorefImage parcels = grabber.grabParcels(this, n.min, n.max);
    162                     new BuildingsImageModifier(buildings, parcels);
    163                     newImage = buildings;
    164                 }
     150                newImage = grabber.grab(this, n.min, n.max);
    165151            } catch (IOException e) {
    166152                System.out.println("Download action cancelled by user or server did not respond");
     
    189175        }
    190176        if (!cancelled) {
    191             if (buildingsOnly)
    192                 joinBufferedImages();
    193177            for (int i=lastSavedImage; i < images.size(); i++)
    194178                saveToCache(images.get(i));
     
    197181
    198182    /**
    199      *
     183     * Divides the bounding box in smaller polygons.
     184     *
    200185     * @param b      the original bbox, usually the current bbox on screen
    201186     * @param factor 1 = source bbox 1:1
     
    398383    }
    399384
    400     public boolean isBuildingsOnly() {
    401         return buildingsOnly;
    402     }
    403 
    404     public void setBuildingsOnly(boolean buildingsOnly) {
    405         this.buildingsOnly = buildingsOnly;
    406         setName(rebuildName());
    407     }
    408 
    409385    public boolean isRaster() {
    410386        return isRaster;
     
    458434        oos.writeInt(this.lambertZone);
    459435        oos.writeBoolean(this.isRaster);
    460         oos.writeBoolean(this.buildingsOnly);
     436        oos.writeBoolean(false); // previously buildingsOnly
    461437        if (this.isRaster) {
    462438            oos.writeDouble(this.rasterMin.getX());
     
    491467        this.setRaster(ois.readBoolean());
    492468        if (currentFormat >= 4)
    493             this.setBuildingsOnly(ois.readBoolean());
     469            ois.readBoolean();
    494470        if (this.isRaster) {
    495471            double X = ois.readDouble();
Note: See TracChangeset for help on using the changeset viewer.