Changeset 29497 in osm for applications/editors/josm/plugins/opendata
- Timestamp:
- 2013-04-14T16:34:48+02:00 (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
applications/editors/josm/plugins/opendata/src/org/openstreetmap/josm/plugins/opendata/core/io/geographic/ShpReader.java
r28191 r29497 26 26 import java.util.Map; 27 27 import java.util.Set; 28 29 import javax.swing.JOptionPane; 28 30 29 31 import org.geotools.data.DataStore; … … 48 50 import org.openstreetmap.josm.data.osm.Way; 49 51 import org.openstreetmap.josm.gui.progress.ProgressMonitor; 52 import org.openstreetmap.josm.gui.util.GuiHelper; 50 53 import org.openstreetmap.josm.plugins.opendata.core.datasets.AbstractDataSetHandler; 51 54 import org.openstreetmap.josm.plugins.opendata.core.datasets.NationalHandlers; … … 81 84 } 82 85 83 private void parseFeature(Feature feature, Component parent) 86 private void parseFeature(Feature feature, final Component parent) 84 87 throws UserCancelException, GeoMathTransformException, FactoryException, GeoCrsException, MismatchedDimensionException, TransformException { 85 88 featurePrimitives.clear(); … … 89 92 GeometryDescriptor desc = geometry.getDescriptor(); 90 93 91 if (crs == null && desc != null && desc.getCoordinateReferenceSystem() != null) { 92 crs = desc.getCoordinateReferenceSystem(); 93 findMathTransform(parent, true); 94 } else if (crs == null) { 95 throw new GeoCrsException("Unable to detect CRS !"); 94 if (crs == null) { 95 if (desc != null && desc.getCoordinateReferenceSystem() != null) { 96 crs = desc.getCoordinateReferenceSystem(); 97 } else { 98 GuiHelper.runInEDTAndWait(new Runnable() { 99 @Override 100 public void run() { 101 if (0 == JOptionPane.showConfirmDialog( 102 parent, 103 tr("Unable to detect Coordinate Reference System.\nWould you like to fallback to ESPG:4326 (WGS 84) ?"), 104 tr("Warning: CRS not found"), 105 JOptionPane.YES_NO_CANCEL_OPTION 106 )) { 107 crs = wgs84; 108 } 109 } 110 }); 111 } 112 if (crs != null) { 113 findMathTransform(parent, true); 114 } else { 115 throw new GeoCrsException(tr("Unable to detect CRS !")); 116 } 96 117 } 97 118
Note:
See TracChangeset
for help on using the changeset viewer.