Changeset 31746 in osm for applications/editors/josm/plugins/ImportImagePlugin/src/org
- Timestamp:
- 2015-11-15T15:20:17+01:00 (9 years ago)
- Location:
- applications/editors/josm/plugins/ImportImagePlugin/src/org/openstreetmap/josm/plugins/ImportImagePlugin
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
applications/editors/josm/plugins/ImportImagePlugin/src/org/openstreetmap/josm/plugins/ImportImagePlugin/ImageLayer.java
r31114 r31746 111 111 if (val == 3) { 112 112 logger.debug("No projection and user declined un-projected use"); 113 throw new LayerCreationCancledException(); 113 throw new LayerCreationCanceledException(); 114 114 } 115 115 CoordinateReferenceSystem src = null; … … 327 327 layerProps.setVisible(true); 328 328 } 329 330 } 331 332 /** 333 * Exception which represents that the layer creation has been cancled by the 334 * user. 335 * 336 */ 337 class LayerCreationCancledException extends IOException{ 329 } 330 331 /** 332 * Exception which represents that the layer creation has been canceled by the user. 333 */ 334 class LayerCreationCanceledException extends IOException{ 338 335 } 339 336 -
applications/editors/josm/plugins/ImportImagePlugin/src/org/openstreetmap/josm/plugins/ImportImagePlugin/ImportImageFileImporter.java
r31114 r31746 14 14 import org.openstreetmap.josm.io.IllegalDataException; 15 15 import org.openstreetmap.josm.io.FileImporter; 16 import org.openstreetmap.josm.plugins.ImportImagePlugin.ImageLayer.LayerCreationCancledException; 16 import org.openstreetmap.josm.plugins.ImportImagePlugin.ImageLayer.LayerCreationCanceledException; 17 17 18 18 /** … … 47 47 try { 48 48 layer = new ImageLayer(file); 49 } catch (LayerCreationCancledException e) { 49 } catch (LayerCreationCanceledException e) { 50 50 // if user decides that layer should not be created just return. 51 51 continue; -
applications/editors/josm/plugins/ImportImagePlugin/src/org/openstreetmap/josm/plugins/ImportImagePlugin/ImportImagePlugin.java
r30738 r31746 91 91 loadFileAction = new LoadImageAction(); 92 92 loadFileAction.setEnabled(true); 93 MainMenu.add(Main.main.menu.imagerySubMenu, loadFileAction); 94 95 // add menu entries 96 //Main.main.menu.fileMenu.insert(loadFileAction, 8); 97 98 //Main.main.menu.fileMenu.insertSeparator(9); 93 if (Main.main != null) { 94 MainMenu.add(Main.main.menu.imagerySubMenu, loadFileAction); 95 96 // add menu entries 97 //Main.main.menu.fileMenu.insert(loadFileAction, 8); 98 //Main.main.menu.fileMenu.insertSeparator(9); 99 } 99 100 100 101 ExtensionFileFilter.importers.add(new ImportImageFileImporter()); -
applications/editors/josm/plugins/ImportImagePlugin/src/org/openstreetmap/josm/plugins/ImportImagePlugin/LoadImageAction.java
r31114 r31746 12 12 import org.openstreetmap.josm.actions.JosmAction; 13 13 import org.openstreetmap.josm.data.osm.visitor.BoundingXYVisitor; 14 import org.openstreetmap.josm.plugins.ImportImagePlugin.ImageLayer.LayerCreationCancledException; 14 import org.openstreetmap.josm.plugins.ImportImagePlugin.ImageLayer.LayerCreationCanceledException; 15 15 16 16 … … 46 46 try { 47 47 layer = new ImageLayer(fc.getSelectedFile()); 48 } catch (LayerCreationCancledException e) { 48 } catch (LayerCreationCanceledException e) { 49 49 // if user decides that layer should not be created just return. 50 50 return; -
applications/editors/josm/plugins/ImportImagePlugin/src/org/openstreetmap/josm/plugins/ImportImagePlugin/PluginOperations.java
r30738 r31746 154 154 155 155 BufferedImage img = ImageIO.read(file); 156 if (img == null) { 157 throw new IOException("Cannot read image file " + file.getAbsolutePath()); 158 } 156 159 157 160 // create Envelope … … 336 339 { 337 340 GridCoverage2D coverage = null; 338 Hints hints = new Hints(); 341 Hints hints = new Hints(Hints.FORCE_LONGITUDE_FIRST_AXIS_ORDER, true); 339 342 if(refSys != null) 340 343 { 341 344 hints.put(Hints.DEFAULT_COORDINATE_REFERENCE_SYSTEM, refSys); 342 343 } 344 // dont't use the EPSG-Factory because of wrong behaviour 345 hints.put(Hints.CRS_AUTHORITY_FACTORY, CRS.getAuthorityFactory(true)); 345 } 346 // don't use the EPSG-Factory because of wrong behaviour 347 //hints.put(Hints.CRS_AUTHORITY_FACTORY, CRS.getAuthorityFactory(true)); 346 348 347 349 GeoTiffReader reader = new GeoTiffReader(file, hints); … … 352 354 } 353 355 354 355 /** 356 * Loads CRS data from an EPSG database and creates descrptions for each one. 356 /** 357 * Loads CRS data from an EPSG database and creates descriptions for each one. 357 358 * 358 359 * @param pluginProps
Note:
See TracChangeset
for help on using the changeset viewer.