Skip to content

Commit

Permalink
code simplification
Browse files Browse the repository at this point in the history
  • Loading branch information
don-vip committed Mar 25, 2018
1 parent 2fd6265 commit 4a39b75
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@

import org.openstreetmap.josm.actions.JosmAction;
import org.openstreetmap.josm.data.coor.EastNorth;
import org.openstreetmap.josm.data.osm.DataSet;
import org.openstreetmap.josm.data.osm.Node;
import org.openstreetmap.josm.data.osm.Way;
import org.openstreetmap.josm.data.osm.WaySegment;
Expand Down Expand Up @@ -44,8 +43,7 @@ public BuildingGeneralizationAction() {
@Override
public void actionPerformed(ActionEvent e) {
if (MainApplication.getMap() != null) {
DataSet data = getLayerManager().getEditLayer().data;
Collection<Way> ways = data.getWays();
Collection<Way> ways = getLayerManager().getEditLayer().data.getWays();
generalization(ways);
for (Way way : ways) {
if (way.isClosed()) {
Expand Down Expand Up @@ -142,10 +140,9 @@ public void proceedGeneralization(Way way) {

public WaySegment findSegment(Way closedWay) {

DataSet data = getLayerManager().getEditLayer().data;
int nodeIndex = Integer.MAX_VALUE;
double min = Double.MAX_VALUE;
Collection<Way> ways = data.getWays();
Collection<Way> ways = getLayerManager().getEditLayer().data.getWays();
Collection<Way> roads = new ArrayList<>();
Way minWay = new Way();
for (Way w : ways)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
import java.util.Set;

import org.openstreetmap.josm.data.coor.EastNorth;
import org.openstreetmap.josm.data.osm.DataSet;
import org.openstreetmap.josm.data.osm.Node;
import org.openstreetmap.josm.data.osm.Way;
import org.openstreetmap.josm.data.osm.WaySegment;
Expand Down Expand Up @@ -241,9 +240,7 @@ public static double normalise(double a){
public static void drawCenter() {

OsmDataLayer currentLayer = MainApplication.getLayerManager().getEditLayer();
DataSet data = currentLayer.data;

Collection<Way> selectedWays = data.getSelectedWays();
Collection<Way> selectedWays = currentLayer.data.getSelectedWays();

for (Way way : selectedWays) {
EastNorth center = ShapeMath.getCentroid(way);
Expand Down

0 comments on commit 4a39b75

Please sign in to comment.