Changeset 34727 in osm
- Timestamp:
- 2018-11-19T00:31:05+01:00 (6 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
applications/editors/josm/plugins/Create_grid_of_ways/src/CreateGridOfWaysPlugin/CreateGridOfWaysAction.java
r34499 r34727 22 22 import org.openstreetmap.josm.data.osm.Way; 23 23 import org.openstreetmap.josm.gui.MainApplication; 24 import org.openstreetmap.josm.tools.Logging; 24 25 import org.openstreetmap.josm.tools.Shortcut; 25 26 … … 69 70 nodeCommon = n; 70 71 } 72 if (nodeCommon == null) { 73 Logging.error("Cannot find common node"); 74 return; 75 } 71 76 Way w2[] = new Way[nodesWay2.size()-1]; 72 77 for (int c=0;c<w2.length;c++) … … 78 83 int c1=0,c2; 79 84 double latDif,lonDif; 85 LatLon llc = nodeCommon.getCoor(); 80 86 for (Node n1 : nodesWay1) { 81 latDif = n1.getCoor().lat()-nodeCommon.getCoor().lat(); 82 lonDif = n1.getCoor().lon()-nodeCommon.getCoor().lon(); 87 LatLon ll1 = n1.getCoor(); 88 if (ll1 == null || llc == null) { 89 Logging.warn("Null coordinates: {0} / {1}", n1, nodeCommon); 90 continue; 91 } 92 latDif = ll1.lat()-llc.lat(); 93 lonDif = ll1.lon()-llc.lon(); 83 94 c2=0; 84 95 for (Node n2 : nodesWay2) { … … 93 104 continue; 94 105 } 95 Node nodeOfGrid = new Node(new LatLon(n2.getCoor().lat()+latDif,n2.getCoor().lon()+lonDif)); 106 LatLon ll2 = n2.getCoor(); 107 Node nodeOfGrid = new Node(new LatLon(ll2.lat()+latDif, ll2.lon()+lonDif)); 96 108 cmds.add(new AddCommand(ds, nodeOfGrid)); 97 109 w1[c1].addNode(nodeOfGrid);
Note:
See TracChangeset
for help on using the changeset viewer.