source: subversion/applications/editors/josm/plugins/czechaddress/conscriptionnumber.patch @ 16617

Last change on this file since 16617 was 16617, checked in by rcernoch, 10 years ago

New patch for the forthcoming CZ address change

File size: 2.8 KB
  • src/org/openstreetmap/josm/plugins/czechaddress/PrimUtils.java

     
    1313    public static final String KEY_HIGHWAY      = "highway";
    1414    public static final String KEY_PLACE        = "place";
    1515
    16     public static final String KEY_ADDR_CP      = "addr:alternatenumber";
    17     public static final String KEY_ADDR_CO      = "addr:housenumber";
     16    public static final String KEY_ADDR_CP      = "addr:conscriptionnumber";
     17    public static final String KEY_ADDR_CO      = "addr:streetnumber";
     18    public static final String KEY_ADDR_HOUSE_N = "addr:housenumber";
    1819    public static final String KEY_ADDR_STREET  = "addr:street";
    1920    public static final String KEY_ADDR_CITY    = "addr:city";
    2021    public static final String KEY_ADDR_COUNTRY = "addr:country";
  • src/org/openstreetmap/josm/plugins/czechaddress/addressdatabase/House.java

     
    9292     */
    9393    public static String generateName(String cp, String co) {
    9494
    95         if ((cp != null) && (co != null))
    96             return cp + "/" + co;
    97 
    98         if (co != null) return co;
    99         if (cp != null) return cp;
    100 
    101         assert false;
    102         return ""; // <-- just to make compiler happy.
     95        if (co == null)
     96            return cp;
     97        else {
     98            if (cp == null)
     99                return "?/"+co;
     100            else
     101                return cp+"/"+co;
     102        }
    103103    }
    104104
    105105    /**
     
    152152     */
    153153    @Override
    154154    protected int[] getFieldMatchList(OsmPrimitive prim) {
    155         int[] result = {0, 0};
     155        int[] result = {0, 0, 0};
    156156        if (!isMatchable(prim)) return result;
    157157
    158158        // First field is the AlternateNubmer
    159159        result[0] = matchField(this.cp, prim.get(PrimUtils.KEY_ADDR_CP));
     160        result[2] = matchField(name,    prim.get(PrimUtils.KEY_ADDR_HOUSE_N));
    160161       
    161162        // Second field is the Housenumber
    162163        if (parent instanceof Street)
     
    190191        List<Proposal> props = new NotNullList<Proposal>();
    191192        ParentResolver resolver = new ParentResolver(this);
    192193
     194        props.add(getStringFieldDiff(PrimUtils.KEY_ADDR_HOUSE_N, prim.get(PrimUtils.KEY_ADDR_HOUSE_N), name));
     195
    193196        props.add(getStringFieldDiff(PrimUtils.KEY_ADDR_CP, prim.get(PrimUtils.KEY_ADDR_CP), getCP()));
    194197        props.add(getStringFieldDiff(PrimUtils.KEY_ADDR_CO, prim.get(PrimUtils.KEY_ADDR_CO), getCO()));
    195198
Note: See TracBrowser for help on using the repository browser.