Changeset 17528 in osm for applications/editors/josm/plugins/cadastre-fr
- Timestamp:
- 2009-09-08T23:14:16+02:00 (15 years ago)
- Location:
- applications/editors/josm/plugins/cadastre-fr
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
applications/editors/josm/plugins/cadastre-fr/build.xml
r17365 r17528 27 27 <attribute name="Plugin-Link" value="http://wiki.openstreetmap.org/wiki/FR:JOSM/Fr:Plugin/Cadastre"/> 28 28 <attribute name="Plugin-Mainversion" value="2012"/> 29 <attribute name="Plugin-Stage" value=" 60"/>29 <attribute name="Plugin-Stage" value="2082"/> 30 30 <attribute name="Plugin-Version" value="${version.entry.commit.revision}"/> 31 31 </manifest> -
applications/editors/josm/plugins/cadastre-fr/src/cadastre_fr/CadastrePlugin.java
r17215 r17528 124 124 refreshMenu(); 125 125 126 // add a hook at uploading to insert/verify the source=cadastre tag 127 LinkedList<UploadHook> hooks = ((UploadAction) Main.main.menu.upload).uploadHooks; 128 hooks.add(0, new CheckSourceUploadHook()); 126 UploadAction.registerUploadHook(new CheckSourceUploadHook()); 129 127 } 130 128 -
applications/editors/josm/plugins/cadastre-fr/src/cadastre_fr/CheckSourceUploadHook.java
r17365 r17528 16 16 import org.openstreetmap.josm.actions.UploadAction.UploadHook; 17 17 import org.openstreetmap.josm.command.ChangePropertyCommand; 18 import org.openstreetmap.josm.data.APIDataSet; 18 19 import org.openstreetmap.josm.data.osm.Node; 19 20 import org.openstreetmap.josm.data.osm.OsmPrimitive; … … 35 36 * Add the tag "source" if it doesn't exist for all new Nodes and Ways before uploading 36 37 */ 37 public boolean checkUpload( Collection<OsmPrimitive> add, Collection<OsmPrimitive> update, Collection<OsmPrimitive> delete)38 public boolean checkUpload(APIDataSet apiDataSet) 38 39 { 39 if (CadastrePlugin.autoSourcing && CadastrePlugin.pluginUsed && !a dd.isEmpty()) {40 if (CadastrePlugin.autoSourcing && CadastrePlugin.pluginUsed && !apiDataSet.getPrimitivesToAdd().isEmpty()) { 40 41 Collection<OsmPrimitive> sel = new HashSet<OsmPrimitive>(); 41 for (OsmPrimitive osm : a dd) {42 for (OsmPrimitive osm : apiDataSet.getPrimitivesToAdd()) { 42 43 if ((osm instanceof Node || osm instanceof Way) 43 44 && (osm.getKeys() == null || !tagSourceExist(osm))) { -
applications/editors/josm/plugins/cadastre-fr/src/cadastre_fr/DownloadSVGBuilding.java
r17365 r17528 143 143 } 144 144 if (w.getNodesCount() == replaced) 145 w. delete(true);145 w.setDeleted(true); 146 146 } 147 n. delete(true);147 n.setDeleted(true); 148 148 } 149 149 … … 152 152 Collection<Command> cmds = new LinkedList<Command>(); 153 153 for (Node node : svgDataSet.nodes) 154 if (!node. deleted)154 if (!node.isDeleted()) 155 155 cmds.add(new AddCommand(node)); 156 156 for (Way way : svgDataSet.ways) 157 if (!way. deleted)157 if (!way.isDeleted()) 158 158 cmds.add(new AddCommand(way)); 159 159 Main.main.undoRedo.add(new SequenceCommand(tr("Create buildings"), cmds)); … … 191 191 double epsilon = 0.05; // smallest distance considering duplicate node 192 192 for (Node n : nodes) { 193 if (!n. deleted&& !n.incomplete) {193 if (!n.isDeleted() && !n.incomplete) { 194 194 double dist = n.getEastNorth().distance(nodeToAdd.getEastNorth()); 195 195 if (dist < epsilon) {
Note:
See TracChangeset
for help on using the changeset viewer.