Ignore:
Timestamp:
2017-09-25T01:44:09+02:00 (7 years ago)
Author:
donvip
Message:

Edigeo: better support of PCI objects

Location:
applications/editors/josm/plugins/cadastre-fr/src/org/openstreetmap/josm/plugins/fr/cadastre/edigeo
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • applications/editors/josm/plugins/cadastre-fr/src/org/openstreetmap/josm/plugins/fr/cadastre/edigeo/EdigeoFileVEC.java

    r33664 r33665  
    564564    private static <T extends OsmPrimitive> T addPrimitiveAndTags(DataSet ds, ObjectBlock obj, T osm) {
    565565        if (osm != null) {
     566            osm.put("cadastre_scd", obj.scdRef.identifier);
    566567            for (int i = 0; i < obj.nAttributes; i++) {
    567568                osm.put(obj.attributeDefs.get(i).identifier, obj.attributeValues.get(i));
  • applications/editors/josm/plugins/cadastre-fr/src/org/openstreetmap/josm/plugins/fr/cadastre/edigeo/pci/EdigeoPciReader.java

    r33664 r33665  
    3333        highways.put("residential", Arrays.asList("Chemin", "Impasse", "Place", "Rue", "Quai", "Voie", "Grand Rue"));
    3434
     35        // Ignored objects
     36        EdigeoFileVEC.addIgnoredObject("PTCANV_id");  // Canvas point
     37        EdigeoFileVEC.addIgnoredObject("BORNE_id");   // Property boundary marker
     38        EdigeoFileVEC.addIgnoredObject("BOULON_id");  // Property boundary marker for Alsace and Moselle
     39        EdigeoFileVEC.addIgnoredObject("CROIX_id");   // Property boundary marker for Alsace and Moselle
     40        EdigeoFileVEC.addIgnoredObject("SYMBLIM_id"); // Common wall symbol
    3541        EdigeoFileVEC.addIgnoredObject("SYM_id",
     42                "30", // Water stream arrow
    3643                "31", // Connecting arrows between parcelles and numbers
    3744                "62", // "Sports ground, small streams". What the fuck France?
     
    3946        );
    4047
     48        // SYM_id mapping
     49        EdigeoFileVEC.addObjectPostProcessor("12", "historic=wayside_cross"); // Calvaire
     50        EdigeoFileVEC.addObjectPostProcessor("14", "amenity=place_of_worship;religion=christian"); // Church
     51        EdigeoFileVEC.addObjectPostProcessor("15", "amenity=place_of_worship;religion=muslim"); // Mosque
     52        EdigeoFileVEC.addObjectPostProcessor("16", "amenity=place_of_worship;religion=jewish"); // Synagogue
     53        EdigeoFileVEC.addObjectPostProcessor("17", "boundary=administrative;admin_level=2"); // State limit
     54        EdigeoFileVEC.addObjectPostProcessor("18", "boundary=administrative;admin_level=6"); // Department limit
    4155        EdigeoFileVEC.addObjectPostProcessor("19", "boundary=administrative;admin_level=8"); // Municipality limit trigger
    42         EdigeoFileVEC.addObjectPostProcessor("21", "highway=road"); // Path
    43         EdigeoFileVEC.addObjectPostProcessor("33", "barrier=wall;bridge=yes"); // bridge parapet
     56        EdigeoFileVEC.addObjectPostProcessor("21", "highway=road"); // Way
     57        EdigeoFileVEC.addObjectPostProcessor("22", "highway=road"); // Road trigger
     58        EdigeoFileVEC.addObjectPostProcessor("23", "highway=path"); // Path
     59        EdigeoFileVEC.addObjectPostProcessor("24", "man_made=pipeline"); // Pipeline
     60        EdigeoFileVEC.addObjectPostProcessor("25", "man_made=pipeline"); // Aqueduct
     61        EdigeoFileVEC.addObjectPostProcessor("26", "aerialway=cable_car"); // Aerialway
     62        EdigeoFileVEC.addObjectPostProcessor("27", "power=line"); // Force transport line
     63        EdigeoFileVEC.addObjectPostProcessor("29", "railway=rail"); // Railway
     64        EdigeoFileVEC.addObjectPostProcessor("33", "bridge=yes"); // Bridge
    4465        EdigeoFileVEC.addObjectPostProcessor("34", "landuse=reservoir;natural=water;water=reservoir"); // reservoir, lake
    45         EdigeoFileVEC.addObjectPostProcessor("39", "barrier=wall"); // Common wall
    46         EdigeoFileVEC.addObjectPostProcessor("40", "barrier=wall"); // Non-adjacent wall
    47         EdigeoFileVEC.addObjectPostProcessor("45", "barrier=hedge"); // Common hedge
    48         EdigeoFileVEC.addObjectPostProcessor("46", "barrier=hedge"); // Non-adjacent hedge
     66        EdigeoFileVEC.addObjectPostProcessor("37", "tunnel=yes"); // Tunnel
     67        EdigeoFileVEC.addObjectPostProcessor("47", "railway=halt"); // Halt
     68        EdigeoFileVEC.addObjectPostProcessor("48", "railway=stop"); // Stop
     69        EdigeoFileVEC.addObjectPostProcessor("49", "railway=station"); // Station
     70        EdigeoFileVEC.addObjectPostProcessor("50", "man_made=mast"); // Pylon
     71        EdigeoFileVEC.addObjectPostProcessor("51", "landuse=cemetery;religion=christian"); // Christian cemetery
     72        EdigeoFileVEC.addObjectPostProcessor("52", "landuse=cemetery;religion=muslim"); // Muslim cemetery
     73        EdigeoFileVEC.addObjectPostProcessor("53", "landuse=cemetery;religion=jewish"); // Jewish cemetery
     74        EdigeoFileVEC.addObjectPostProcessor("63", "man_made=water_well"); // Well
    4975        EdigeoFileVEC.addObjectPostProcessor("65", "leisure=swimming_pool;access=private"); // Swimming pool
    5076
     77        // Mapping TEX*_id => name
    5178        EdigeoFileVEC.addObjectPostProcessor((o, p) -> {
    5279            StringBuffer sb = new StringBuffer(p.get("TEX_id").trim());
     
    6390        }, "TEX_id");
    6491
     92        // Objects mapping
    6593        EdigeoFileVEC.addObjectPostProcessor((o, p) -> {
    6694            p.put("highway", "road");
     
    93121            p.put("ref", p.get("IDU_id"));
    94122            p.remove("IDU_id");
    95         }, o -> o.hasScdIdentifier("SECTION_id") || o.hasScdIdentifier("SUBDSECT_id") || o.hasScdIdentifier("PARCELLE_id"));
     123        }, o -> o.hasScdIdentifier("SECTION_id") || o.hasScdIdentifier("SUBDSECT_id")
     124             || o.hasScdIdentifier("PARCELLE_id") || o.hasScdIdentifier("SUBDFISC_id") || o.hasScdIdentifier("CHARGE_id"));
    96125
    97126        EdigeoFileVEC.addObjectPostProcessor((o, p) -> p.put("wall", "no"), "DUR_id", "02");
     
    100129            p.remove("DUR_id");
    101130        }, o -> o.hasScdIdentifier("BATIMENT_id"));
     131
     132        EdigeoFileVEC.addObjectPostProcessor((o, p) -> {
     133            p.put("addr:housenumber", p.get("name"));
     134            p.remove("name");
     135        }, o -> o.hasScdIdentifier("NUMVOIE_id"));
     136
     137        EdigeoFileVEC.addObjectPostProcessor((o, p) -> {
     138            p.put("place", "isolated_dwelling");
     139        }, o -> o.hasScdIdentifier("LIEUDIT_id"));
     140
     141        EdigeoFileVEC.addObjectPostProcessor((o, p) -> {
     142            p.put("highway", "road");
     143            p.put("area", "yes");
     144        }, o -> o.hasScdIdentifier("TRONROUTE_id"));
     145
     146        EdigeoFileVEC.addObjectPostProcessor((o, p) -> {
     147            p.put("waterway", "riverbank");
     148        }, o -> o.hasScdIdentifier("TRONFLUV_id"));
    102149    }
    103150
Note: See TracChangeset for help on using the changeset viewer.