Changeset 32139 in osm for applications/editors/josm/plugins/opendata/src/org
- Timestamp:
- 2016-04-02T15:00:31+02:00 (9 years ago)
- Location:
- applications/editors/josm/plugins/opendata/src/org/openstreetmap/josm/plugins/opendata/core
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
applications/editors/josm/plugins/opendata/src/org/openstreetmap/josm/plugins/opendata/core/io/geographic/GeographicReader.java
r31655 r32139 101 101 102 102 protected Node createOrGetNode(Point p, String ele) throws MismatchedDimensionException, TransformException { 103 if (!p.isValid()) { 104 throw new IllegalArgumentException("Invalid point: " + p); 105 } 103 106 Point p2 = (Point) JTS.transform(p, transform); 104 107 LatLon key = new LatLon(p2.getY(), p2.getX()); … … 157 160 try { 158 161 tempWay.addNode(createOrGetNode(ls.getPointN(i))); 159 } catch ( Exception e) {160 Main.error( e.getMessage());162 } catch (TransformException | IllegalArgumentException e) { 163 Main.error("Exception for " + ls + ": " + e.getClass().getName() + ": " + e.getMessage()); 161 164 } 162 165 } -
applications/editors/josm/plugins/opendata/src/org/openstreetmap/josm/plugins/opendata/core/io/geographic/ShpReader.java
r31655 r32139 241 241 } 242 242 } 243 } catch (Throwable e) {244 e.printStackTrace();245 243 } finally { 246 244 iterator.close(); … … 254 252 e.printStackTrace(); 255 253 throw e; 256 } catch ( Throwable t) {257 t.printStackTrace();258 throw new IOException( t);254 } catch (Exception e) { 255 e.printStackTrace(); 256 throw new IOException(e); 259 257 } 260 258 return ds; -
applications/editors/josm/plugins/opendata/src/org/openstreetmap/josm/plugins/opendata/core/layers/OdDataLayer.java
r31116 r32139 10 10 11 11 import javax.swing.Action; 12 import javax.swing.Icon;13 12 14 13 import org.openstreetmap.josm.Main; 15 14 import org.openstreetmap.josm.data.Bounds; 15 import org.openstreetmap.josm.data.coor.LatLon; 16 16 import org.openstreetmap.josm.data.osm.DataSet; 17 17 import org.openstreetmap.josm.data.osm.Node; … … 20 20 import org.openstreetmap.josm.gui.layer.Layer; 21 21 import org.openstreetmap.josm.gui.layer.OsmDataLayer; 22 import org.openstreetmap.josm.tools.ImageProvider;23 22 import org.openstreetmap.josm.plugins.opendata.core.OdConstants; 24 23 import org.openstreetmap.josm.plugins.opendata.core.actions.OpenLinkAction; … … 28 27 import org.openstreetmap.josm.plugins.opendata.core.licenses.License; 29 28 import org.openstreetmap.josm.plugins.opendata.core.util.OdUtils; 29 import org.openstreetmap.josm.tools.ImageProvider; 30 30 31 31 public class OdDataLayer extends OsmDataLayer implements OdLayer, LayerChangeListener { … … 43 43 this.handler = handler; 44 44 for (Node node : data.getNodes()) { 45 if (this.bounds == null) { 46 this.bounds = new Bounds(node.getCoor()); 47 } else { 48 this.bounds.extend(node.getCoor()); 45 LatLon ll = node.getCoor(); 46 if (ll != null) { 47 if (this.bounds == null) { 48 this.bounds = new Bounds(ll); 49 } else { 50 this.bounds.extend(ll); 51 } 49 52 } 50 53 }
Note:
See TracChangeset
for help on using the changeset viewer.