Changeset 28314 in osm
- Timestamp:
- 2012-04-18T19:40:13+02:00 (13 years ago)
- Location:
- applications/editors/josm/plugins/opendata/modules/fr.paris/src/org/openstreetmap/josm/plugins/opendata/modules/fr/paris
- Files:
-
- 2 added
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
applications/editors/josm/plugins/opendata/modules/fr.paris/src/org/openstreetmap/josm/plugins/opendata/modules/fr/paris/ParisModule.java
r28152 r28314 19 19 import org.openstreetmap.josm.plugins.opendata.core.modules.ModuleInformation; 20 20 import org.openstreetmap.josm.plugins.opendata.modules.fr.paris.datasets.environnement.ArbresRemarquablesHandler; 21 import org.openstreetmap.josm.plugins.opendata.modules.fr.paris.datasets.environnement.MobilierVoiePubliqueHandler; 21 22 import org.openstreetmap.josm.plugins.opendata.modules.fr.paris.datasets.urbanisme.EclairagePublicHandler; 22 23 import org.openstreetmap.josm.plugins.opendata.modules.fr.paris.datasets.urbanisme.SanisettesHandler; … … 32 33 //handlers.add(ElectriciteHandler.class); // Disabled (useless for OSM) 33 34 handlers.add(EclairagePublicHandler.class); 35 handlers.add(MobilierVoiePubliqueHandler.class); 34 36 } 35 37 } -
applications/editors/josm/plugins/opendata/modules/fr.paris/src/org/openstreetmap/josm/plugins/opendata/modules/fr/paris/datasets/urbanisme/EclairagePublicHandler.java
r28152 r28314 16 16 package org.openstreetmap.josm.plugins.opendata.modules.fr.paris.datasets.urbanisme; 17 17 18 import java.nio.charset.Charset;19 import java.util.ArrayList;20 import java.util.HashMap;21 import java.util.List;22 import java.util.Map;23 18 import java.util.Set; 24 19 25 import org.openstreetmap.josm.data.coor.EastNorth;26 20 import org.openstreetmap.josm.data.osm.DataSet; 27 21 import org.openstreetmap.josm.data.osm.Node; 28 22 import org.openstreetmap.josm.data.osm.OsmPrimitive; 29 import org.openstreetmap.josm.data.osm.Way;30 import org.openstreetmap.josm.plugins.opendata.core.datasets.fr.FrenchShpHandler;31 23 import org.openstreetmap.josm.plugins.opendata.modules.fr.paris.datasets.ParisDataSetHandler; 24 import org.openstreetmap.josm.plugins.opendata.modules.fr.paris.datasets.ParisShpHandler; 32 25 import org.openstreetmap.josm.tools.Geometry; 33 26 … … 52 45 } 53 46 54 private class InternalShpHandler extends FrenchShpHandler {47 private final class InternalShpHandler extends ParisShpHandler { 55 48 56 private final Map<String, Node> nodes = new HashMap<String, Node>();57 58 public InternalShpHandler() {59 setDbfCharset(Charset.forName(CP850));60 }61 62 private Node getNode(EastNorth en, String key) {63 Node n = nodes.get(key);64 /*if (n == null) {65 for (Node node : nodes.values()) {66 if (node.getEastNorth().equalsEpsilon(en, 0.0000001)) {67 return node;68 }69 }70 }*/71 return n;72 }73 74 private Node createOrGetNode(DataSet ds, EastNorth en) {75 String key = en.getX()+"/"+en.getY();76 Node n = getNode(en, key);77 if (n == null) {78 n = new Node(en);79 nodes.put(key, n);80 ds.addPrimitive(n);81 }82 return n;83 }84 85 49 @Override 86 50 public void notifyFeatureParsed(Object feature, DataSet result, Set<OsmPrimitive> featurePrimitives) { 87 OsmPrimitive dataPrimitive = null; 88 Way closedWay = null; 89 List<Way> ways = new ArrayList<Way>(); 90 List<Node> nodes = new ArrayList<Node>(); 91 for (OsmPrimitive p : featurePrimitives) { 92 if (p.hasKeys()) { 93 dataPrimitive = p; 94 } 95 if (p instanceof Way) { 96 Way w = (Way) p; 97 ways.add(w); 98 if (w.isClosed()) { 99 closedWay = w; 100 } 101 } else if (p instanceof Node) { 102 nodes.add((Node) p); 103 } 104 } 51 initFeaturesPrimitives(featurePrimitives); 105 52 if (dataPrimitive == null) { 106 53 System.err.println("Found no primitive with tags"); … … 117 64 System.err.println("Found 2 street lamps at the same position with different types: '"+centroid.get("lamp_model:fr")+"' and '"+dataPrimitive.get("Libelle")+"'."); 118 65 } 119 for (Way w : ways) { 120 w.setNodes(null); 121 result.removePrimitive(w); 122 } 123 for (Node n : nodes) { 124 result.removePrimitive(n); 125 } 66 removePrimitives(result); 126 67 127 68 if (centroid.get("lamp_model:fr") != null) {
Note:
See TracChangeset
for help on using the changeset viewer.