Changeset 32107 in osm for applications
- Timestamp:
- 2016-03-09T11:38:38+01:00 (9 years ago)
- Location:
- applications/editors/josm/plugins/indoor_sweepline/src/indoor_sweepline
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
applications/editors/josm/plugins/indoor_sweepline/src/indoor_sweepline/CorridorGeography.java
r32103 r32107 17 17 18 18 19 private void setExtraElements(CorridorPart.ReachableSide side, LatLon from, LatLon to, boolean extraWayUp) 19 private static final double MIN_LENGTH = 10.; 20 21 22 private void setExtraElements(CorridorPart.ReachableSide side, LatLon from, LatLon to, 23 boolean extraWayUp, double minLength) 20 24 { 21 25 LatLon middleCoor = new LatLon((from.lat() + to.lat())/2., … … 52 56 53 57 double scale = Math.cos(middleCoor.lat() * (Math.PI/180.)); 54 LatLon detachedCoor = new LatLon(middleCoor.lat() + (start.lon() - middleCoor.lon()) * scale, 55 middleCoor.lon() - (start.lat() - middleCoor.lat()) / scale); 58 double length = Math.sqrt((start.lat() - middleCoor.lat()) * (start.lat() - middleCoor.lat()) + 59 (start.lon() - middleCoor.lon()) * (start.lon() - middleCoor.lon()) * scale * scale) / 180. * 20000000.; 60 double lengthFactor = length < minLength ? minLength / length : 1.; 61 LatLon detachedCoor = new LatLon(middleCoor.lat() + (start.lon() - middleCoor.lon()) * scale * lengthFactor, 62 middleCoor.lon() - (start.lat() - middleCoor.lat()) / scale * lengthFactor); 56 63 if (detachedNode == null) 57 64 { … … 89 96 if (type == CorridorPart.Type.STAIRS_UP || type == CorridorPart.Type.STAIRS_DOWN) 90 97 { 91 setExtraElements(side, from, to, type == CorridorPart.Type.STAIRS_UP );98 setExtraElements(side, from, to, type == CorridorPart.Type.STAIRS_UP, MIN_LENGTH); 92 99 target.appendNode(middleNode); 93 100 … … 109 116 type == CorridorPart.Type.ESCALATOR_UP_LEAVING 110 117 || type == CorridorPart.Type.ESCALATOR_UP_ARRIVING 111 || type == CorridorPart.Type.ESCALATOR_UP_BIDIRECTIONAL );118 || type == CorridorPart.Type.ESCALATOR_UP_BIDIRECTIONAL, MIN_LENGTH); 112 119 target.appendNode(middleNode); 113 120 … … 129 136 else if (type == CorridorPart.Type.ELEVATOR) 130 137 { 131 setExtraElements(side, from, to, true );138 setExtraElements(side, from, to, true, 0.); 132 139 target.appendNode(middleNode); 133 140 -
applications/editors/josm/plugins/indoor_sweepline/src/indoor_sweepline/IndoorSweepline.java
r32103 r32107 24 24 { 25 25 JMenu menu = Main.main.menu.moreToolsMenu; 26 menu.addSeparator(); 26 if (menu.isVisible()) 27 menu.addSeparator(); 28 else 29 menu.setVisible(true); 27 30 menu.add(new JMenuItem(new IndoorSweeplineWizardAction())); 28 31 } -
applications/editors/josm/plugins/indoor_sweepline/src/indoor_sweepline/IndoorSweeplineModel.java
r32103 r32107 8 8 import org.openstreetmap.josm.data.osm.DataSet; 9 9 import org.openstreetmap.josm.gui.layer.OsmDataLayer; 10 11 12 /* TODO: 13 - offset 14 - replicate last stopline 15 - focus to useful table entry after cell edit 16 - keyboard shortcuts 17 */ 10 18 11 19 -
applications/editors/josm/plugins/indoor_sweepline/src/indoor_sweepline/ModelGeography.java
r32103 r32107 227 227 { 228 228 multipolygon = new Relation(); 229 dataSet.addPrimitive(multipolygon); 230 231 multipolygon.removeAll(); 232 multipolygon.put("type", "multipolygon"); 233 addPolygonTags(type, level, multipolygon); 229 dataSet.addPrimitive(multipolygon); 234 230 } 231 232 multipolygon.removeAll(); 233 multipolygon.put("type", "multipolygon"); 234 addPolygonTags(type, level, multipolygon); 235 235 236 multipolygon.setMembers(members); 236 237 }
Note:
See TracChangeset
for help on using the changeset viewer.