/** * Adds an epsg crs to the geopackage, registering it in the spatial_ref_sys table. * * <p>This method will look up the <tt>srid</tt> in the local epsg database. Use {@link * #addCRS(CoordinateReferenceSystem, int)} to specify an explicit CRS, authority, code entry. */ public void addCRS(int srid) throws IOException { try { addCRS(CRS.decode("EPSG:" + srid, true), "epsg", srid); } catch (Exception e) { throw new IOException(e); } }
/** * Adds a crs to the geopackage, registering it in the spatial_ref_sys table. * * @param crs The crs to add. * @param auth The authority code, example: epsg * @param srid The spatial reference system id. */ public void addCRS(CoordinateReferenceSystem crs, String auth, int srid) throws IOException { Connection cx; try { cx = connPool.getConnection(); try { GeoPackage.addCRS( cx, srid, auth + ":" + srid, auth, srid, crs.toWKT(), auth + ":" + srid); } finally { cx.close(); } } catch (SQLException e) { throw new RuntimeException(e); } }
addCRS(e.getSrid());
/** * Adds an epsg crs to the geopackage, registering it in the spatial_ref_sys table. * * <p>This method will look up the <tt>srid</tt> in the local epsg database. Use {@link * #addCRS(CoordinateReferenceSystem, int)} to specify an explicit CRS, authority, code entry. */ public void addCRS(int srid) throws IOException { try { addCRS(CRS.decode("EPSG:" + srid, true), "epsg", srid); } catch (Exception e) { throw new IOException(e); } }
/** * Adds a crs to the geopackage, registering it in the spatial_ref_sys table. * * @param crs The crs to add. * @param auth The authority code, example: epsg * @param srid The spatial reference system id. */ public void addCRS(CoordinateReferenceSystem crs, String auth, int srid) throws IOException { Connection cx; try { cx = connPool.getConnection(); try { GeoPackage.addCRS( cx, srid, auth + ":" + srid, auth, srid, crs.toWKT(), auth + ":" + srid); } finally { cx.close(); } } catch (SQLException e) { throw new RuntimeException(e); } }
addCRS(e.getSrid());