You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@sis.apache.org by Martin Desruisseaux <ma...@geomatys.com> on 2016/02/06 23:56:46 UTC

Legal issue: where to put EPSG's SQL scripts?

Hello all

The code that automatically create the EPSG database when first needed
has been ported (tested on Derby and PostgreSQL). Now, the main missing
thing is the EPSG data themselves. We are not yet allowed to bundle
those data with Apache SIS [1], so we need to find some other procedure.


    Alternative 1: users download themselves

A first procedure could be to let users download the data themselves
from http://www.epsg.org/ and unzip them in some directory. I'm
currently doing that for the tests, which look for the SQL scripts in
the "$SIS_DATA/DataBases/ExternalSources" directory show below:

    $SIS_DATA
    ├──DataBases
    │  ├──SpatialMetadata
    │  └──ExternalSources
    └──DatumChanges

However "ExternalSources" is currently checked only for the tests. For
production code, I do not know yet if it would be a good approach.
Another issue is that I do not use the SQL scripts exactly as published
by EPSG. I rather use a modified form of those scripts with index added
and some constraints (e.g. foreigner keys) made stricter for enforcing
more data integrity. While Apache SIS should work with the scripts as
published by EPSG, they are not optimal for SIS. EPSG scripts are also
not guaranteed to work with SIS if the user download a more recent
version than the one that we tested.


    Alternative 2: command-line tool download automatically

The Apache SIS command-line tool could download automatically our
modified scripts when first needed. It would first display the EPSG Term
or Use on the console and ask user if (s)he accepts. Then it would
download the scripts not directly from EPSG, but from another server
were we put the scripts ourselves. Advantages are:

  * We publish the scripts with the modifications that help SIS
    (indexes, grants, etc.).
  * We nail down the EPSG version for each SIS version.

Inconvenient are:

  * Which server? I presume that it would need to be outside Apache?
  * Would it be legally safe? EPSG terms of uses allow commercial use if
    there is added value (in our case, Apache SIS) on top of the EPSG
    data. But if we put the EPSG data on a server, they would be alone
    without the added value.


    Alternative 3: Maven bundle provided by a non-Apache project

We can provide our modified EPSG scripts in a separated Maven project,
for example "org.geotoolkit:geotk-epsg". The users would just need to
add a Maven dependency to that project and SIS would use it automatically.

Advantages:

  * Simple for Maven users (but not necessarily for other users)

Inconvenient:

  * Part of Apache SIS maintenance would be outside Apache, and SIS
    would need to refer explicitly to it.
  * It is sufficient for being legally safe?


Is there any though, or other alternative proposals?

    Martin


[1] https://issues.apache.org/jira/browse/LEGAL-183


Re: Legal issue: where to put EPSG's SQL scripts?

Posted by Martin Desruisseaux <ma...@geomatys.com>.
If forgot to said, if anyone wants to see what the EPSG scripts look
like is their form modified for SIS needs, the current "geotk-epsg"
module is there:

https://github.com/Geomatys/geotoolkit/tree/master/modules/referencing/geotk-epsg/src/main/resources/org/geotoolkit/referencing/factory/epsg

Notes:

  * The files provided by EPSG are "Tables.sql", "Data.sql" and "FKeys.sql".
  * The files added by Geotk/SIS are "Extensions.sql" (to be renamed
    "Patches.sql"), "Indexes.sql" and "Grant.sql".
  * The large "Data.sql" file is fully rewritten by Geotk/SIS for making
    it more compact and faster to execute by Derby and PostgreSQL,
    without changing the actual values.
  * The "Tables.sql" file has some minor modifications compared to the
    original EPSG file: a VARCHAR changed to SMALLINT, a NOT NULL
    constraints added, and a primary key added.


    Martin