Changeset 36176 in osm for applications/editors/josm/plugins/geotools/src
- Timestamp:
- 2023-10-19T21:58:56+02:00 (12 months ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
applications/editors/josm/plugins/geotools/src/org/openstreetmap/josm/plugins/geotools/GeoToolsPlugin.java
r36015 r36176 4 4 import java.io.IOException; 5 5 import java.io.InputStream; 6 import java.util.Collection; 6 7 import java.util.Iterator; 7 8 import java.util.ServiceLoader; … … 15 16 import org.geotools.image.ImageWorker; 16 17 import org.geotools.referencing.CRS; 17 import org. opengis.referencing.FactoryException;18 import org. opengis.referencing.NoSuchAuthorityCodeException;18 import org.geotools.api.referencing.FactoryException; 19 import org.geotools.api.referencing.NoSuchAuthorityCodeException; 19 20 import org.openstreetmap.josm.plugins.Plugin; 20 21 import org.openstreetmap.josm.plugins.PluginInformation; … … 102 103 103 104 private static void checkEPSG() { 105 final Collection<String> codes = CRS.getSupportedCodes("EPSG"); 106 if (codes.isEmpty() || !(codes.contains("4326") || codes.contains("EPSG:4326"))) { 104 107 try { 105 CRS.decode("EPSG:4326"); 106 } catch (NoSuchAuthorityCodeException e) { 107 Logging.error("geotools: error in EPSG database initialization. NoSuchAuthorityCodeException: "+e.getMessage()); 108 } catch (FactoryException e) { 109 Logging.error("geotools: error in EPSG database initialization. FactoryException: "+e.getMessage()); 108 CRS.decode("EPSG:4326"); 109 } catch (NoSuchAuthorityCodeException e) { 110 Logging.error("geotools: error in EPSG database initialization. NoSuchAuthorityCodeException: " + e.getMessage()); 111 } catch (FactoryException e) { 112 Logging.error("geotools: error in EPSG database initialization. FactoryException: " + e.getMessage()); 113 } 110 114 } 111 115 }
Note:
See TracChangeset
for help on using the changeset viewer.