[ 
https://issues.apache.org/jira/browse/STREAMPIPES-584?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17626564#comment-17626564
 ] 

Florian Micklich commented on STREAMPIPES-584:
----------------------------------------------


{code:java}
-------- Ursprüngliche Nachricht --------<br>
Von: Martin Desruisseaux 
<[[email protected]](mailto:martin%20desruisseaux%20%[email protected]%3e)><br>
Antwort an: [[email protected]](mailto:[email protected])<br>
An: [[email protected]](mailto:[email protected])<br>
Betreff: Re: manually setup an EPSG database base information<br>
Datum: Sun, 30 Oct 2022 21:18:42 +0100<br>


      Hello Florian<br>
      
My pleasure if I can be of any help :-)<br>
      <br>
      
Le 30/10/2022 à 13:32, Florian Micklich via user a écrit :<br>
    <br>
> 
>         
>         What happens (for some reason) the db is not available anymore.
>         Is there an exception I can catch to handle something like this?<br>
If SIS needs to use the EPSG database and an error occurred, an 
org.opengis.util.FactoryException will
      be thrown (this is a checked exception). The cause of that
      exception should be the SQLException.<br>
<br>
    <br>
> Is there a method in SIS that I can use to verify that the
>         DataSource has been set up correctly?<br>
The easiest way is to request an EPSG code, for example 
System.out.println(CRS.forCode("EPSG::3395")).
      This is not fully reliable however for two reasons:<br>
- If that EPSG code was requested before, SIS may return a
        cached value, in which case database problem that may have
        occurred in the meantime will be unnoticed.
- If the EPSG database is not available at all, SIS fallback on
        hard-coded values for a few commonly used CRS. The EPSG::3395
        code is not in current list [1], but it may be in a future
        version.<br>
      

A good way to know the status of Apache SIS is to execute the
      following code:<br>
```
System.out.println(org.apache.setup.About.configuration());
> ```

It should prints a tree. Among the first lines, there is
      information about the EPSG database used. It should show something
      like "EPSG database 9.1 on PostgreSQL". If it shows something like
      "EPSG database subset", then it is not using the database.<br>
    <br><br>
> Also thanks for the hint with the index. I see there is also a
>         prepare.sql script.
>         Is this also necessary or what is its purpose?<br>
Not if you create the EPSG tables yourself from the SQL scripts
      published by EPSG. But SIS has another way to create the EPSG
      database. You can just give a connection to an initially empty
      database, i.e. same as what you currently do but without executing
      any SQL script. If the org.apache.sis.non-free:sis-epsg
      (instead of sis-embedded) JAR is on
      the classpath ([2] but without Derby), SIS will automatically
      execute installation scripts when first needed, including the
      index creation. However during the installation process, SIS
      perform a few changes on-the-fly:<br>
- It creates an "epsg" schema.
- The "epsg_" prefix is table names is replaced by "epsg.", i.e.
        the tables are written in "epsg" schema.
- A few VARCHAR columns which
        were used as enumerations are replaced by real enumeration (this
        is slightly more efficient). This is where the "Prepare.sql" script 
come into play: it
        creates the enumerations before to run the EPSG scripts.<br>
      

All those steps are automatic if sis-epsg
      is on the classpath and you let SIS creates the "epsg" schema
      itself when first needed. A message is logged at the INFO level when this 
creation is
      running.<br>
    Martin<br>
    <br>```
[1] 
[https://sis.apache.org/apidocs/org/apache/sis/referencing/CRS.html#forCode(java.lang.String)](https://sis.apache.org/apidocs/org/apache/sis/referencing/CRS.html#forCode(java.lang.String))
[2] 
[https://sis.apache.org/epsg.html#maven-epsg](https://sis.apache.org/epsg.html#maven-epsg)
```
{code}


> Implementing possibility for reprojection Coordinates
> -----------------------------------------------------
>
>                 Key: STREAMPIPES-584
>                 URL: https://issues.apache.org/jira/browse/STREAMPIPES-584
>             Project: StreamPipes
>          Issue Type: New Feature
>          Components: Backend, Pipeline Elements
>            Reporter: Florian Micklich
>            Assignee: Florian Micklich
>            Priority: Major
>         Attachments: .env, docker-compose.yml, settings_epsg.png, 
> workflow.png, workflow_v2.png
>
>
> h1. Goal:
> Essential Task in Geo is to reproject between different Coordinate Reference 
> Systems (CRS)
> e.g for special calculations which needs meter as CRS Unit instead of degree 
> (as it it in WGS84)
> h1. Libs and Sources:
> Lib for reprojection would be
> https://sis.apache.org/
> Necessary extra package is the EPSG Library Source, which needs a special 
> license agreement (not apache license).
> User Downloads the Postgres SQL Scripts here: 
> https://epsg.org/auth/Account/Login
> During registration User agrees to license, so it can be used in StreamPipes.
> h1. 
> h1. Following Workflow (to be discussed)
> The User unzipped the Scripts and but them into a specific folder.
> Then StreamPipes can start the docker-compose file and here the questions 
> occurs.
> how to implement the service and where
> What happens if files are missing
> Where to register the connectionSource and how to validate?
> What happens if setup fails. Are geo processors active or special Exceptions 
> during Pipeline Creation?
>  !workflow_v2.png! 
> Draft for EPSG Database Setup:
>  !settings_epsg.png! 
> h1. Material
> Docker-compose file for SP Service
>  [^.env]  
> [^docker-compose.yml] 



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to