Changeset 17365 in osm
- Timestamp:
- 2009-08-30T18:02:20+02:00 (15 years ago)
- Location:
- applications/editors/josm/plugins/cadastre-fr
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
applications/editors/josm/plugins/cadastre-fr/build.xml
r17198 r17365 26 26 <attribute name="Plugin-Description" value="A special handler for the French land registry WMS server."/> 27 27 <attribute name="Plugin-Link" value="http://wiki.openstreetmap.org/wiki/FR:JOSM/Fr:Plugin/Cadastre"/> 28 <attribute name="Plugin-Mainversion" value=" 1981"/>28 <attribute name="Plugin-Mainversion" value="2012"/> 29 29 <attribute name="Plugin-Stage" value="60"/> 30 30 <attribute name="Plugin-Version" value="${version.entry.commit.revision}"/> -
applications/editors/josm/plugins/cadastre-fr/src/cadastre_fr/CheckSourceUploadHook.java
r15961 r17365 41 41 for (OsmPrimitive osm : add) { 42 42 if ((osm instanceof Node || osm instanceof Way) 43 && (osm. keys== null || !tagSourceExist(osm))) {43 && (osm.getKeys() == null || !tagSourceExist(osm))) { 44 44 sel.add(osm); 45 45 } … … 58 58 */ 59 59 private boolean tagSourceExist(OsmPrimitive osm) { 60 for (String key : osm.key s.keySet()) {60 for (String key : osm.keySet()) { 61 61 if (key.equals("source") ) { 62 62 return true; -
applications/editors/josm/plugins/cadastre-fr/src/cadastre_fr/DownloadSVGBuilding.java
r17089 r17365 43 43 44 44 public DownloadSVGBuilding(WMSLayer wmsLayer) { 45 super(tr("Downloading {0}", wmsLayer. name));45 super(tr("Downloading {0}", wmsLayer.getName())); 46 46 47 47 this.wmsLayer = wmsLayer; … … 113 113 if (nearestNewNode == nodeToAdd) 114 114 svgDataSet.addPrimitive(nearestNewNode); 115 wayToAdd. nodes.add(nearestNewNode); // either a new node or an existing one116 } 117 wayToAdd. nodes.add(wayToAdd.nodes.get(0)); // close the way115 wayToAdd.addNode(nearestNewNode); // either a new node or an existing one 116 } 117 wayToAdd.addNode(wayToAdd.getNode(0)); // close the way 118 118 svgDataSet.addPrimitive(wayToAdd); 119 119 } … … 137 137 for (Way w : svgDataSet.ways) { 138 138 int replaced = 0; 139 for (Node node : w. nodes)139 for (Node node : w.getNodes()) 140 140 if (node == n) { 141 141 node = nearestNewNode; 142 142 replaced++; 143 143 } 144 if (w. nodes.size() == replaced)144 if (w.getNodesCount() == replaced) 145 145 w.delete(true); 146 146 } -
applications/editors/josm/plugins/cadastre-fr/src/cadastre_fr/DownloadSVGTask.java
r17089 r17365 117 117 for (Node node : nodeList) { 118 118 cmds.add(new AddCommand(node)); 119 wayToAdd. nodes.add(node);120 } 121 wayToAdd. nodes.add(wayToAdd.nodes.get(0)); // close the circle119 wayToAdd.addNode(node); 120 } 121 wayToAdd.addNode(wayToAdd.getNode(0)); // close the circle 122 122 123 123 // simplify the way -
applications/editors/josm/plugins/cadastre-fr/src/cadastre_fr/SimplifyWay.java
r16160 r17365 2 2 3 3 import java.util.ArrayList; 4 4 5 import java.util.Collection; 5 6 import java.util.Collections; 6 7 import java.util.HashSet; 7 8 import java.util.LinkedList; 9 import java.util.List; 8 10 9 11 import org.openstreetmap.josm.Main; … … 18 20 import static org.openstreetmap.josm.tools.I18n.trn; 19 21 22 23 20 24 /** 21 25 * Imported from plugin UtilsPlugin … … 27 31 Way wnew = new Way(w); 28 32 29 int toI = wnew. nodes.size() - 1;30 for (int i = wnew. nodes.size() - 1; i >= 0; i--) {33 int toI = wnew.getNodesCount() - 1; 34 for (int i = wnew.getNodesCount() - 1; i >= 0; i--) { 31 35 CollectBackReferencesVisitor backRefsV = new CollectBackReferencesVisitor(dataSet, false); 32 backRefsV.visit(wnew. nodes.get(i));36 backRefsV.visit(wnew.getNode(i)); 33 37 boolean used = false; 34 38 if (backRefsV.data.size() == 1) { 35 used = Collections.frequency(w. nodes, wnew.nodes.get(i)) > 1;39 used = Collections.frequency(w.getNodes(), wnew.getNode(i)) > 1; 36 40 } else { 37 41 backRefsV.data.remove(w); … … 39 43 } 40 44 if (!used) 41 used = wnew. nodes.get(i).isTagged();45 used = wnew.getNode(i).isTagged(); 42 46 43 47 if (used) { … … 49 53 50 54 HashSet<Node> delNodes = new HashSet<Node>(); 51 delNodes.addAll(w. nodes);52 delNodes.removeAll(wnew. nodes);55 delNodes.addAll(w.getNodes()); 56 delNodes.removeAll(wnew.getNodes()); 53 57 54 if (wnew. nodes.size() != w.nodes.size()) {58 if (wnew.getNodesCount() != w.getNodesCount()) { 55 59 Collection<Command> cmds = new LinkedList<Command>(); 56 60 cmds.add(new ChangeCommand(w, wnew)); … … 65 69 ArrayList<Node> ns = new ArrayList<Node>(); 66 70 simplifyWayRange(wnew, from, to, ns, thr); 71 List<Node> nodes = wnew.getNodes(); 67 72 for (int j = to - 1; j > from; j--) 68 wnew.nodes.remove(j); 69 wnew.nodes.addAll(from + 1, ns); 73 nodes.remove(j); 74 nodes.addAll(from+1, ns); 75 wnew.setNodes(nodes); 70 76 } 71 77 } … … 76 82 */ 77 83 public void simplifyWayRange(Way wnew, int from, int to, ArrayList<Node> ns, double thr) { 78 Node fromN = wnew. nodes.get(from), toN = wnew.nodes.get(to);84 Node fromN = wnew.getNode(from), toN = wnew.getNode(to); 79 85 80 86 int imax = -1; 81 87 double xtemax = 0; 82 88 for (int i = from + 1; i < to; i++) { 83 Node n = wnew. nodes.get(i);89 Node n = wnew.getNode(i); 84 90 double xte = Math.abs(EARTH_RAD 85 91 * xtd(fromN.getCoor().lat() * Math.PI / 180, fromN.getCoor().lon() * Math.PI / 180, toN.getCoor().lat() * Math.PI … … 94 100 if (imax != -1 && xtemax >= thr) { 95 101 simplifyWayRange(wnew, from, imax, ns, thr); 96 ns.add(wnew. nodes.get(imax));102 ns.add(wnew.getNode(imax)); 97 103 simplifyWayRange(wnew, imax, to, ns, thr); 98 104 }
Note:
See TracChangeset
for help on using the changeset viewer.