Changeset 4126 in josm for trunk/src/org/openstreetmap/josm/data
- Timestamp:
- 2011-06-07T19:05:14+02:00 (13 years ago)
- Location:
- trunk/src/org/openstreetmap/josm/data
- Files:
-
- 1 added
- 11 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/data/coor/CachedLatLon.java
r3253 r4126 5 5 import org.openstreetmap.josm.data.projection.Projection; 6 6 7 /** 8 * LatLon class that maintains a cache of projected EastNorth coordinates. 9 * 10 * This class is convenient to use, but has relatively high memory costs. 11 * It keeps a pointer to the last known projection in order to detect projection 12 * changes. 13 * 14 * Node and WayPoint have another, optimized, cache for projected coordinates. 15 */ 7 16 public class CachedLatLon extends LatLon { 8 17 private EastNorth eastNorth; … … 19 28 20 29 public CachedLatLon(EastNorth eastNorth) { 21 super(Main. proj.eastNorth2latlon(eastNorth));22 proj = Main. proj;30 super(Main.getProjection().eastNorth2latlon(eastNorth)); 31 proj = Main.getProjection(); 23 32 this.eastNorth = eastNorth; 24 33 } … … 30 39 31 40 public final void setEastNorth(EastNorth eastNorth) { 32 proj = Main. proj;41 proj = Main.getProjection(); 33 42 this.eastNorth = eastNorth; 34 43 LatLon l = proj.eastNorth2latlon(eastNorth); … … 36 45 } 37 46 47 /** 48 * Replies the projected east/north coordinates. 49 * 50 * @return the internally cached east/north coordinates. null, if the globally defined projection is null 51 */ 38 52 public final EastNorth getEastNorth() { 39 if(proj != Main. proj)53 if(proj != Main.getProjection()) 40 54 { 41 proj = Main. proj;55 proj = Main.getProjection(); 42 56 eastNorth = proj.latlon2eastNorth(this); 43 57 } -
trunk/src/org/openstreetmap/josm/data/coor/LatLon.java
r3656 r4126 106 106 case DEGREES_MINUTES_SECONDS: return dms(y) + ((y < 0) ? SOUTH : NORTH); 107 107 case NAUTICAL: return dm(y) + ((y < 0) ? SOUTH : NORTH); 108 case EAST_NORTH: return cDdFormatter.format(Main. proj.latlon2eastNorth(this).north());108 case EAST_NORTH: return cDdFormatter.format(Main.getProjection().latlon2eastNorth(this).north()); 109 109 default: return "ERR"; 110 110 } … … 122 122 case DEGREES_MINUTES_SECONDS: return dms(x) + ((x < 0) ? WEST : EAST); 123 123 case NAUTICAL: return dm(x) + ((x < 0) ? WEST : EAST); 124 case EAST_NORTH: return cDdFormatter.format(Main. proj.latlon2eastNorth(this).east());124 case EAST_NORTH: return cDdFormatter.format(Main.getProjection().latlon2eastNorth(this).east()); 125 125 default: return "ERR"; 126 126 } … … 142 142 */ 143 143 public boolean isOutSideWorld() { 144 Bounds b = Main. proj.getWorldBoundsLatLon();144 Bounds b = Main.getProjection().getWorldBoundsLatLon(); 145 145 return lat() < b.getMin().lat() || lat() > b.getMax().lat() || 146 146 lon() < b.getMin().lon() || lon() > b.getMax().lon(); -
trunk/src/org/openstreetmap/josm/data/gpx/WayPoint.java
r3321 r4126 7 7 import java.util.Date; 8 8 9 import org.openstreetmap.josm. data.coor.CachedLatLon;9 import org.openstreetmap.josm.Main; 10 10 import org.openstreetmap.josm.data.coor.EastNorth; 11 11 import org.openstreetmap.josm.data.coor.LatLon; 12 import org.openstreetmap.josm.data.projection.Projections; 12 13 import org.openstreetmap.josm.tools.PrimaryDateParser; 13 14 … … 26 27 27 28 public WayPoint(LatLon ll) { 28 coor = new CachedLatLon(ll); 29 lat = ll.lat(); 30 lon = ll.lon(); 29 31 } 30 32 31 private final CachedLatLon coor; 33 /* 34 * We "inline" lat/lon, rather than usinga LatLon internally => reduces memory overhead. Relevant 35 * because a lot of GPX waypoints are created when GPS tracks are downloaded from the OSM server. 36 */ 37 private double lat = 0; 38 private double lon = 0; 39 40 /* 41 * internal cache of projected coordinates 42 */ 43 private double east = Double.NaN; 44 private double north = Double.NaN; 45 46 /** 47 * Invalidate the internal cache of east/north coordinates. 48 */ 49 public void invalidateEastNorthCache() { 50 this.east = Double.NaN; 51 this.north = Double.NaN; 52 } 32 53 33 54 public final LatLon getCoor() { 34 return coor;55 return new LatLon(lat,lon); 35 56 } 36 57 58 /** 59 * <p>Replies the projected east/north coordinates.</p> 60 * 61 * <p>Uses the {@link Main#getProjection() global projection} to project the lan/lon-coordinates. 62 * Internally caches the projected coordinates.</p> 63 * 64 * <p><strong>Caveat:</strong> doesn't listen to projection changes. Clients must 65 * {@link #reproject() trigger a reprojection} or {@link #invalidateEastNorthCache() invalidate the internal cache}.</p> 66 * 67 * @return the east north coordinates or {@code null} 68 * @see #invalidateEastNorthCache() 69 * 70 */ 37 71 public final EastNorth getEastNorth() { 38 return coor.getEastNorth(); 72 if (Double.isNaN(east) || Double.isNaN(north)) { 73 // projected coordinates haven't been calculated yet, 74 // so fill the cache of the projected waypoint coordinates 75 EastNorth en = Projections.project(new LatLon(lat, lon)); 76 this.east = en.east(); 77 this.north = en.north(); 78 } 79 return new EastNorth(east, north); 39 80 } 40 81 41 82 @Override 42 83 public String toString() { 43 return "WayPoint (" + (attr.containsKey("name") ? attr.get("name") + ", " :"") + coor.toString() + ", " + attr + ")";84 return "WayPoint (" + (attr.containsKey("name") ? attr.get("name") + ", " :"") + getCoor().toString() + ", " + attr + ")"; 44 85 } 45 86 … … 57 98 } 58 99 59 public int compareTo(WayPoint w) 60 { 100 public int compareTo(WayPoint w) { 61 101 return Double.compare(time, w.time); 62 102 } -
trunk/src/org/openstreetmap/josm/data/imagery/OffsetBookmark.java
r3966 r4126 30 30 public boolean isUsable(ImageryLayer layer) { 31 31 if (proj == null) return false; 32 if (!Main. proj.toCode().equals(proj.toCode())) return false;32 if (!Main.getProjection().toCode().equals(proj.toCode())) return false; 33 33 return layer.getInfo().getName().equals(layerName); 34 34 } … … 122 122 LatLon center; 123 123 if (Main.map != null && Main.map.mapView != null) { 124 center = Main. proj.eastNorth2latlon(Main.map.mapView.getCenter());124 center = Main.getProjection().eastNorth2latlon(Main.map.mapView.getCenter()); 125 125 } else { 126 126 center = new LatLon(0,0); 127 127 } 128 128 OffsetBookmark nb = new OffsetBookmark( 129 Main. proj, layer.getInfo().getName(),129 Main.getProjection(), layer.getInfo().getName(), 130 130 name, layer.getDx(), layer.getDy(), center.lon(), center.lat()); 131 131 for (ListIterator<OffsetBookmark> it = allBookmarks.listIterator();it.hasNext();) { -
trunk/src/org/openstreetmap/josm/data/osm/DataSet.java
r4087 r4126 20 20 import java.util.concurrent.locks.ReentrantReadWriteLock; 21 21 22 import org.openstreetmap.josm.Main; 22 23 import org.openstreetmap.josm.data.Bounds; 23 24 import org.openstreetmap.josm.data.SelectionChangedListener; … … 34 35 import org.openstreetmap.josm.data.osm.event.TagsChangedEvent; 35 36 import org.openstreetmap.josm.data.osm.event.WayNodesChangedEvent; 37 import org.openstreetmap.josm.data.projection.Projection; 38 import org.openstreetmap.josm.data.projection.ProjectionChangeListener; 36 39 import org.openstreetmap.josm.gui.tagging.ac.AutoCompletionManager; 37 40 import org.openstreetmap.josm.tools.FilteredCollection; 38 41 import org.openstreetmap.josm.tools.Predicate; 39 42 import org.openstreetmap.josm.tools.SubclassFilteredCollection; 43 import org.openstreetmap.josm.tools.Utils; 40 44 41 45 /** … … 83 87 * @author imi 84 88 */ 85 public class DataSet implements Cloneable {89 public class DataSet implements Cloneable, ProjectionChangeListener { 86 90 87 91 /** … … 120 124 private final ReadWriteLock lock = new ReentrantReadWriteLock(); 121 125 private final Object selectionLock = new Object(); 126 127 public DataSet() { 128 /* 129 * Transparently register as projection change lister. No need to explicitly remove the 130 * the listener, projection change listeners are managed as WeakReferences. 131 */ 132 Main.addProjectionChangeListener(this); 133 } 122 134 123 135 public Lock getReadLock() { … … 975 987 } 976 988 989 /** 990 * Invalidates the internal cache of projected east/north coordinates. 991 * 992 * This method can be invoked after the globally configured projection method 993 * changed. In contrast to {@link DataSet#reproject()} it only invalidates the 994 * cache and doesn't reproject the coordinates. 995 */ 996 public void invalidateEastNorthCache() { 997 if (Main.getProjection() == null) return; // sanity check 998 try { 999 beginUpdate(); 1000 for (Node n: Utils.filteredCollection(allPrimitives, Node.class)) { 1001 n.invalidateEastNorthCache(); 1002 } 1003 } finally { 1004 endUpdate(); 1005 } 1006 } 1007 977 1008 public void cleanupDeletedPrimitives() { 978 1009 beginUpdate(); … … 1064 1095 return ret; 1065 1096 } 1097 1098 /* --------------------------------------------------------------------------------- */ 1099 /* interface ProjectionChangeListner */ 1100 /* --------------------------------------------------------------------------------- */ 1101 @Override 1102 public void projectionChanged(Projection oldValue, Projection newValue) { 1103 invalidateEastNorthCache(); 1104 } 1066 1105 } -
trunk/src/org/openstreetmap/josm/data/osm/INode.java
r4098 r4126 6 6 7 7 public interface INode extends IPrimitive { 8 8 9 9 LatLon getCoor(); 10 10 void setCoor(LatLon coor); 11 11 EastNorth getEastNorth(); 12 12 void setEastNorth(EastNorth eastNorth); 13 14 13 } -
trunk/src/org/openstreetmap/josm/data/osm/Node.java
r4100 r4126 2 2 package org.openstreetmap.josm.data.osm; 3 3 4 import org.openstreetmap.josm. data.coor.CachedLatLon;4 import org.openstreetmap.josm.Main; 5 5 import org.openstreetmap.josm.data.coor.EastNorth; 6 6 import org.openstreetmap.josm.data.coor.LatLon; 7 7 import org.openstreetmap.josm.data.osm.visitor.PrimitiveVisitor; 8 8 import org.openstreetmap.josm.data.osm.visitor.Visitor; 9 import org.openstreetmap.josm.data.projection.Projections; 9 10 10 11 /** … … 15 16 public final class Node extends OsmPrimitive implements INode { 16 17 17 private CachedLatLon coor; 18 /* 19 * We "inline" lat/lon rather than using a LatLon-object => reduces memory footprint 20 */ 21 static private final double COORDINATE_NOT_DEFINED = Double.NaN; 22 private double lat = COORDINATE_NOT_DEFINED; 23 private double lon = COORDINATE_NOT_DEFINED; 24 25 /* 26 * the cached projected coordinates 27 */ 28 private double east = Double.NaN; 29 private double north = Double.NaN; 30 31 private boolean isLatLonKnown() { 32 return lat != COORDINATE_NOT_DEFINED && lon != COORDINATE_NOT_DEFINED; 33 } 18 34 19 35 @Override … … 46 62 @Override 47 63 public final LatLon getCoor() { 48 return coor; 49 } 50 64 if (!isLatLonKnown()) return null; 65 return new LatLon(lat,lon); 66 } 67 68 /** 69 * <p>Replies the projected east/north coordinates.</p> 70 * 71 * <p>Uses the {@link Main#getProjection() global projection} to project the lan/lon-coordinates. 72 * Internally caches the projected coordinates.</p> 73 * 74 * <p><strong>Caveat:</strong> doesn't listen to projection changes. Clients must 75 * {@link #invalidateEastNorthCache() invalidate the internal cache}.</p> 76 * 77 * <p>Replies {@code null} if this node doesn't know lat/lon-coordinates, i.e. because it is an incomplete node. 78 * 79 * @return the east north coordinates or {@code null} 80 * @see #invalidateEastNorthCache() 81 * 82 */ 51 83 @Override 52 84 public final EastNorth getEastNorth() { 53 return coor != null ? coor.getEastNorth() : null; 85 if (!isLatLonKnown()) return null; 86 87 if (getDataSet() == null) 88 // there is no dataset that listens for projection changes 89 // and invalidates the cache, so we don't use the cache at all 90 return Projections.project(new LatLon(lat, lon)); 91 92 if (Double.isNaN(east) || Double.isNaN(north)) { 93 // projected coordinates haven't been calculated yet, 94 // so fill the cache of the projected node coordinates 95 EastNorth en = Projections.project(new LatLon(lat, lon)); 96 this.east = en.east(); 97 this.north = en.north(); 98 } 99 return new EastNorth(east, north); 54 100 } 55 101 … … 58 104 */ 59 105 protected void setCoorInternal(LatLon coor, EastNorth eastNorth) { 60 if(this.coor == null) { 61 if (eastNorth == null) { 62 this.coor = new CachedLatLon(coor); 63 } else { 64 this.coor = new CachedLatLon(eastNorth); 65 } 66 } else { 67 if (eastNorth == null) { 68 this.coor.setCoor(coor); 69 } else { 70 this.coor.setEastNorth(eastNorth); 71 } 72 } 106 if (coor != null) { 107 this.lat = coor.lat(); 108 this.lon = coor.lon(); 109 invalidateEastNorthCache(); 110 } else if (eastNorth != null) { 111 LatLon ll = Projections.inverseProject(eastNorth); 112 this.lat = ll.lat(); 113 this.lon = ll.lon(); 114 this.east = eastNorth.east(); 115 this.north = eastNorth.north(); 116 } else 117 throw new IllegalArgumentException(); 73 118 } 74 119 … … 150 195 try { 151 196 super.cloneFrom(osm); 152 setCoor(((Node)osm). coor);197 setCoor(((Node)osm).getCoor()); 153 198 } finally { 154 199 writeUnlock(locked); … … 173 218 super.mergeFrom(other); 174 219 if (!other.isIncomplete()) { 175 setCoor( new LatLon(((Node)other).coor));220 setCoor(((Node)other).getCoor()); 176 221 } 177 222 } finally { … … 200 245 201 246 @Override public String toString() { 202 String coorDesc = coor == null?"":"lat="+coor.lat()+",lon="+coor.lon();247 String coorDesc = isLatLonKnown() ? "lat="+lat+",lon="+lon : ""; 203 248 return "{Node id=" + getUniqueId() + " version=" + getVersion() + " " + getFlagsAsString() + " " + coorDesc+"}"; 204 249 } … … 211 256 return false; 212 257 Node n = (Node)other; 213 if (coor == null && n.coor == null) 258 LatLon coor = getCoor(); 259 LatLon otherCoor = n.getCoor(); 260 if (coor == null && otherCoor == null) 214 261 return true; 215 else if (coor != null && n.coor != null)216 return coor.equalsEpsilon( n.coor);262 else if (coor != null && otherCoor != null) 263 return coor.equalsEpsilon(otherCoor); 217 264 else 218 265 return false; … … 241 288 @Override 242 289 public void updatePosition() { 243 // TODO: replace CachedLatLon with simple doubles and update precalculated EastNorth value here244 290 } 245 291 … … 253 299 builder.append(toString()); 254 300 builder.append("\n"); 255 if ( coor == null) {301 if (isLatLonKnown()) { 256 302 builder.append("Coor is null\n"); 257 303 } else { 258 builder.append(String.format("EastNorth: %s\n", coor.getEastNorth()));259 builder.append( coor.getProjection());304 builder.append(String.format("EastNorth: %s\n", getEastNorth())); 305 builder.append(Main.getProjection()); 260 306 builder.append("\n"); 261 307 } … … 263 309 return builder.toString(); 264 310 } 311 312 /** 313 * Invoke to invalidate the internal cache of projected east/north coordinates. 314 * Coordinates are reprojected on demand when the {@link #getEastNorth()} is invoked 315 * next time. 316 */ 317 public void invalidateEastNorthCache() { 318 this.east = Double.NaN; 319 this.north = Double.NaN; 320 } 265 321 } -
trunk/src/org/openstreetmap/josm/data/osm/NodeData.java
r4100 r4126 2 2 package org.openstreetmap.josm.data.osm; 3 3 4 import org.openstreetmap.josm.data.coor.CachedLatLon;5 4 import org.openstreetmap.josm.data.coor.EastNorth; 6 5 import org.openstreetmap.josm.data.coor.LatLon; 7 6 import org.openstreetmap.josm.data.osm.visitor.PrimitiveVisitor; 7 import org.openstreetmap.josm.data.projection.Projections; 8 8 9 9 public class NodeData extends PrimitiveData implements INode { 10 10 11 private final CachedLatLon coor = new CachedLatLon(0, 0); 11 /* 12 * we "inline" lat/lon coordinates instead of using a LatLon => reduces memory footprint 13 */ 14 private double lat = Double.NaN; 15 private double lon = Double.NaN; 12 16 13 public NodeData() { 14 15 } 17 public NodeData() {} 16 18 17 19 public NodeData(NodeData data) { … … 20 22 } 21 23 24 private boolean isLatLonKnown() { 25 return lat != Double.NaN && lon != Double.NaN; 26 } 27 22 28 @Override 23 29 public LatLon getCoor() { 24 return coor;30 return isLatLonKnown() ? new LatLon(lat,lon) : null; 25 31 } 26 32 27 33 @Override 28 34 public void setCoor(LatLon coor) { 29 this.coor.setCoor(coor); 35 if (coor == null) { 36 this.lat = Double.NaN; 37 this.lon = Double.NaN; 38 } else { 39 this.lat = coor.lat(); 40 this.lon = coor.lon(); 41 } 30 42 } 31 43 32 44 @Override 33 45 public EastNorth getEastNorth() { 34 return this.coor.getEastNorth(); 46 /* 47 * No internal caching of projected coordinates needed. In contrast to getEastNorth() 48 * on Node, this method is rarely used. Caching would be overkill. 49 */ 50 return Projections.project(getCoor()); 35 51 } 36 52 37 53 @Override 38 54 public void setEastNorth(EastNorth eastNorth) { 39 this.coor.setEastNorth(eastNorth); 55 LatLon ll = Projections.inverseProject(eastNorth); 56 setCoor(ll); 40 57 } 41 58 … … 47 64 @Override 48 65 public String toString() { 49 return super.toString() + " NODE " + coor;66 return super.toString() + " NODE " + getCoor(); 50 67 } 51 68 … … 54 71 return OsmPrimitiveType.NODE; 55 72 } 56 57 @Override 73 74 @Override 58 75 public void visit(PrimitiveVisitor visitor) { 59 76 visitor.visit(this); … … 64 81 return formatter.format(this); 65 82 } 66 67 83 } -
trunk/src/org/openstreetmap/josm/data/osm/visitor/BoundingXYVisitor.java
r4065 r4126 113 113 if (bounds == null) 114 114 return; 115 LatLon minLatlon = Main. proj.eastNorth2latlon(bounds.getMin());116 LatLon maxLatlon = Main. proj.eastNorth2latlon(bounds.getMax());115 LatLon minLatlon = Main.getProjection().eastNorth2latlon(bounds.getMin()); 116 LatLon maxLatlon = Main.getProjection().eastNorth2latlon(bounds.getMax()); 117 117 bounds = new ProjectionBounds( 118 Main. proj.latlon2eastNorth(new LatLon(minLatlon.lat() - enlargeDegree, minLatlon.lon() - enlargeDegree)),119 Main. proj.latlon2eastNorth(new LatLon(maxLatlon.lat() + enlargeDegree, maxLatlon.lon() + enlargeDegree)));118 Main.getProjection().latlon2eastNorth(new LatLon(minLatlon.lat() - enlargeDegree, minLatlon.lon() - enlargeDegree)), 119 Main.getProjection().latlon2eastNorth(new LatLon(maxLatlon.lat() + enlargeDegree, maxLatlon.lon() + enlargeDegree))); 120 120 } 121 121 -
trunk/src/org/openstreetmap/josm/data/projection/Projections.java
r3874 r4126 2 2 package org.openstreetmap.josm.data.projection; 3 3 4 import java.util.ArrayList; 4 5 import java.util.Arrays; 5 import java.util.ArrayList; 6 7 import org.openstreetmap.josm.Main; 8 import org.openstreetmap.josm.data.coor.EastNorth; 9 import org.openstreetmap.josm.data.coor.LatLon; 6 10 7 11 /** … … 14 18 */ 15 19 private static ArrayList<Projection> allProjections = 16 new ArrayList<Projection>(Arrays.asList(new Projection[] {17 // global projections18 new Epsg4326(),19 new Mercator(),20 new UTM(),21 // regional - alphabetical order by country name22 new LambertEST(), // Still needs proper default zoom23 new Lambert(), // Still needs proper default zoom24 new LambertCC9Zones(), // Still needs proper default zoom25 new UTM_France_DOM(),26 new TransverseMercatorLV(),27 new Puwg(),28 new Epsg3008(), // SWEREF99 13 3029 new SwissGrid(),30 }));20 new ArrayList<Projection>(Arrays.asList(new Projection[] { 21 // global projections 22 new Epsg4326(), 23 new Mercator(), 24 new UTM(), 25 // regional - alphabetical order by country name 26 new LambertEST(), // Still needs proper default zoom 27 new Lambert(), // Still needs proper default zoom 28 new LambertCC9Zones(), // Still needs proper default zoom 29 new UTM_France_DOM(), 30 new TransverseMercatorLV(), 31 new Puwg(), 32 new Epsg3008(), // SWEREF99 13 30 33 new SwissGrid(), 34 })); 31 35 32 36 public static ArrayList<Projection> getProjections() { … … 43 47 allProjections.add(proj); 44 48 } 49 50 static public EastNorth project(LatLon ll) { 51 if (ll == null) return null; 52 return Main.getProjection().latlon2eastNorth(ll); 53 } 54 55 static public LatLon inverseProject(EastNorth en) { 56 if (en == null) return null; 57 return Main.getProjection().eastNorth2latlon(en); 58 } 45 59 } -
trunk/src/org/openstreetmap/josm/data/validation/OsmValidator.java
r4051 r4126 23 23 import org.openstreetmap.josm.Main; 24 24 import org.openstreetmap.josm.actions.ValidateAction; 25 import org.openstreetmap.josm.actions.upload.ValidateUploadHook;26 25 import org.openstreetmap.josm.data.projection.Epsg4326; 27 26 import org.openstreetmap.josm.data.projection.Lambert; … … 30 29 import org.openstreetmap.josm.data.validation.tests.CrossingWays; 31 30 import org.openstreetmap.josm.data.validation.tests.DuplicateNode; 31 import org.openstreetmap.josm.data.validation.tests.DuplicateRelation; 32 32 import org.openstreetmap.josm.data.validation.tests.DuplicateWay; 33 import org.openstreetmap.josm.data.validation.tests.DuplicateRelation;34 33 import org.openstreetmap.josm.data.validation.tests.DuplicatedWayNodes; 35 34 import org.openstreetmap.josm.data.validation.tests.MultipolygonTest; … … 48 47 import org.openstreetmap.josm.data.validation.tests.WronglyOrderedWays; 49 48 import org.openstreetmap.josm.gui.MapView.LayerChangeListener; 50 import org.openstreetmap.josm.gui.layer.ValidatorLayer;51 49 import org.openstreetmap.josm.gui.layer.Layer; 52 50 import org.openstreetmap.josm.gui.layer.OsmDataLayer; 51 import org.openstreetmap.josm.gui.layer.ValidatorLayer; 53 52 import org.openstreetmap.josm.gui.preferences.ValidatorPreference; 54 53 … … 77 76 @SuppressWarnings("unchecked") 78 77 public static Class<Test>[] allAvailableTests = new Class[] { 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 78 DuplicateNode.class, // ID 1 .. 99 79 OverlappingWays.class, // ID 101 .. 199 80 UntaggedNode.class, // ID 201 .. 299 81 UntaggedWay.class, // ID 301 .. 399 82 SelfIntersectingWay.class, // ID 401 .. 499 83 DuplicatedWayNodes.class, // ID 501 .. 599 84 CrossingWays.class, // ID 601 .. 699 85 SimilarNamedWays.class, // ID 701 .. 799 86 NodesWithSameName.class, // ID 801 .. 899 87 Coastlines.class, // ID 901 .. 999 88 WronglyOrderedWays.class, // ID 1001 .. 1099 89 UnclosedWays.class, // ID 1101 .. 1199 90 TagChecker.class, // ID 1201 .. 1299 91 UnconnectedWays.class, // ID 1301 .. 1399 92 DuplicateWay.class, // ID 1401 .. 1499 93 NameMismatch.class, // ID 1501 .. 1599 94 MultipolygonTest.class, // ID 1601 .. 1699 95 RelationChecker.class, // ID 1701 .. 1799 96 TurnrestrictionTest.class, // ID 1801 .. 1899 97 DuplicateRelation.class, // ID 1901 .. 1999 99 98 }; 100 99 … … 242 241 */ 243 242 public void initializeGridDetail() { 244 if (Main. proj.toString().equals(new Epsg4326().toString())) {243 if (Main.getProjection().toString().equals(new Epsg4326().toString())) { 245 244 OsmValidator.griddetail = 10000; 246 } else if (Main. proj.toString().equals(new Mercator().toString())) {245 } else if (Main.getProjection().toString().equals(new Mercator().toString())) { 247 246 OsmValidator.griddetail = 0.01; 248 } else if (Main. proj.toString().equals(new Lambert().toString())) {247 } else if (Main.getProjection().toString().equals(new Lambert().toString())) { 249 248 OsmValidator.griddetail = 0.1; 250 249 } … … 265 264 JOptionPane.showMessageDialog(Main.parent, 266 265 tr("Error initializing test {0}:\n {1}", test.getClass() 267 .getSimpleName(), e),268 tr("Error"),269 JOptionPane.ERROR_MESSAGE);266 .getSimpleName(), e), 267 tr("Error"), 268 JOptionPane.ERROR_MESSAGE); 270 269 } 271 270 }
Note:
See TracChangeset
for help on using the changeset viewer.