This is an automated email from the ASF dual-hosted git repository. desruisseaux pushed a commit to branch main in repository https://gitbox.apache.org/repos/asf/sis-site.git
commit 6e77393fc3f18c6d564673ff2a8503bc034e89a4 Author: Martin Desruisseaux <[email protected]> AuthorDate: Thu Jan 22 17:27:49 2026 +0100 Add instructions about how to ask user's permission for downloading EPSG data. --- content/epsg.md | 48 +++++++++++++++++++++++++++++++++++++++++++++++- content/howto/_index.md | 6 +++++- 2 files changed, 52 insertions(+), 2 deletions(-) diff --git a/content/epsg.md b/content/epsg.md index 8257c2dd..a9a9cbd5 100644 --- a/content/epsg.md +++ b/content/epsg.md @@ -2,7 +2,7 @@ title: How to use EPSG geodetic dataset --- -The [EPSG geodetic dataset][EPSG] is a de-facto standard providing +The [EPSG geodetic dataset][EPSG] is a widely-used database providing [thousands of Coordinate Reference System (CRS) definitions](tables/CoordinateReferenceSystems.html) together with information about how to perform coordinate operations, their accuracies and their domains of validity. The EPSG dataset is owned and maintained by the [International Association of Oil & Gas producers][IOGP]. @@ -29,6 +29,9 @@ In order to use the EPSG geodetic dataset with Apache {{% SIS %}}, apply *one* o {{< toc >}} + + + # Install a local copy with command-line tool {#command-line} The installation process described in this section makes clear that EPSG dataset @@ -75,6 +78,9 @@ java -Dderby.system.home=apache-sis-{{% version %}}/data/Databases \ The `SIS_DATA` environment variable or `derby.system.home` Java property can be set to the path of any other directory which contain the same files. + + + # Add a Maven dependency {#maven} Maven projects can get the EPSG geodetic dataset automatically, _without any prompt for EPSG Terms of Use agreement_, @@ -140,6 +146,46 @@ with the Derby dependency replaced by another database driver if desired: Note that `sis-epsg` and `sis-embedded-data` artifacts should not be specified in the same project. Only one is needed. + + + +# Ask user's permission then download {#ask-user} + +If an application does not want to bundle EPSG data by default, +either for licensing reasons or for saving space, the application can ask user's permission the first time +that EPSG data are needed, then (if agreed) download and install the data automatically. +It can be done with a Java code similar to the following: + +```java +import org.apache.sis.setup.OptionalInstallations; + +public class OptionalInstallDialog extends OptionalInstallations { + public OptionalInstallDialog() { + super("text/plain"); // Desired format for the `license` argument below. + } + + @Override + protected boolean askUserAgreement(String authority, String license) { + if ("EPSG".equals(authority)) { + return false; // If not interested in data other than EPSG. + } else if (license == null) { + // Ask here to user if she wants to download the EPSG data. + } else { + // Ask here to user if she accepts the EPSG terms of use. + } + } +} +``` + +The above class needs to be declared as an implementation of the `InstallationResources` service in `module-info.java` +or, if the application does not use Java modules, in the `META-INF/services/org.apache.sis.setup.InstallationResources` file. +In addition, the `SIS_DATA` environment variable needs to be set to the destination directory where to write data on the user's machine. +With this configuration, Apache SIS will automatically asks for user agreement and, if agreed, download EPSG data when first needed. +This approach can be combined with the next section for writing the EPSG data in a custom database. + + + + # Use an existing EPSG database {#existing} Applications can use their own EPSG database. diff --git a/content/howto/_index.md b/content/howto/_index.md index 46a54835..c36578fe 100644 --- a/content/howto/_index.md +++ b/content/howto/_index.md @@ -29,13 +29,17 @@ The examples are grouped in the following sections: * [Add vertical and temporal axes to an horizontal CRS](howto/compound_crs.html) * [Transform points between two reference systems](howto/transform_coordinates.html) * [Transform envelopes between two reference systems](howto/transform_envelopes.html) -* [Parse and format MGRS codes](howto/parse_and_format_mgrs_codes.html) * [Union or intersection of envelopes in different reference systems](howto/envelopes_in_different_crs.html) * [Determine if two reference systems are functionally equal](howto/crs_equality.html) * [Compute geodetic distances and paths](howto/geodetic_paths.html) * [Extend with custom Coordinate Reference Systems](howto/custom_crs.html) +# Referencing by identifiers {#referencing-by-identifiers} + +* [Parse and format MGRS codes](howto/parse_and_format_mgrs_codes.html) + + # Metadata {#metadata} * [Get the geographic bounding box of a data file](howto/geographic_bounding_box.html)
