You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@sis.apache.org by Martin Desruisseaux <ma...@geomatys.com> on 2019/06/04 12:18:07 UTC

Re: EPSG database encoding (was: Error in maven build)

Le 04/06/2019 à 13:51, csteinforth@gmail.com a écrit :

> I'm on Eclipse, there one can use the "Data Tools Platform". It seems
> that the encoding of the string is wrong in the database as the
> entries are like "Geocentre > equator/0�E".
>
I suspect a mismatch between the SIS version and "sis-epsg" version. The
EPSG database encoding changed from ISO LATIN-1 to UTF-8 maybe one year
ago. This change was reflected in the SIS code base on master, but the
sis-epsg version 0.8 on Maven central is still using ISO LATIN-1. Can
you try to use the following repository? (temporarily, you will be able
to delete it after SIS 1.0 release).

  <repositories>
    <repository>
      <id>geotoolkit</id>
      <name>Geotoolkit.org repository</name>
      <url>http://maven.geotoolkit.org</url>
    </repository>
  </repositories>

Then, use sis-epsg version 1.0-M1 (a milestone). That version use UTF-8
encoding. You can just delete SIS_DATA/Databases/SpatialMetadata
directory for forcing a new creation.

    Martin



Re: EPSG database encoding (was: Error in maven build)

Posted by Martin Desruisseaux <ma...@geomatys.com>.
Le 05/06/2019 à 12:06, csteinforth@gmail.com a écrit :

> the replace() is only taking place on the last part of the String concat:
>>             "  BBox[-90.00, -180.00, 90.00, 180.00],\n" +
>>             "  Id[\"EPSG\", 4326,\\E.*\\Q URI[\"urn:ogc:def:crs:EPSG:\\E.*\\Q:4326\"]]]\n\\E"   // Version number of EPSG dataset may vary.
>> .replace("\n", System.lineSeparator());

Yes, we noticed that. A fix has already been pushed on the geoapi-4.0
branch and will be merged to master during the day.

Thanks!

    Martin



Re: EPSG database encoding (was: Error in maven build)

Posted by cs...@gmail.com, cs...@gmail.com.
Martin,

the replace() is only taking place on the last part of the String concat:

>             "  BBox[-90.00, -180.00, 90.00, 180.00],\n" +
>             "  Id[\"EPSG\", 4326,\\E.*\\Q URI[\"urn:ogc:def:crs:EPSG:\\E.*\\Q:4326\"]]]\n\\E"   // Version number of EPSG dataset may vary.
> .replace("\n", System.lineSeparator());

Regards,

Christoph

Re: EPSG database encoding (was: Error in maven build)

Posted by cs...@gmail.com, cs...@gmail.com.
Martin,

for some reasons I do not fully understand yet this one

 private final String WGS84 =
            "\\QGeodeticCRS[\"WGS 84\",\n" +
            "  Datum[\"World Geodetic System 1984\",\n" +
            "    Ellipsoid[\"WGS 84\", 6378137.0, 298.257223563]],\n" +
            "  CS[ellipsoidal, 2],\n" +
            "    Axis[\"Latitude (B)\", north],\n" +
            "    Axis[\"Longitude (L)\", east],\n" +
            "    Unit[\"degree\", 0.017453292519943295],\n" +
            "  Scope[\"Horizontal component of 3D system.\\E.*\\Q\"],\n" +                      // EPSG geodetic dataset provides more details here.
            "  Area[\"\\E.*\\Q\"],\n" +                                                         // Language may vary because of SIS localization.
            "  BBox[-90.00, -180.00, 90.00, 180.00],\n" +
            "  Id[\"EPSG\", 4326,\\E.*\\Q URI[\"urn:ogc:def:crs:EPSG:\\E.*\\Q:4326\"]]]\n\\E"   // Version number of EPSG dataset may vary.
.replace("\n", System.lineSeparator());

is not working but this

private final String WGS84 = new String(
            "\\QGeodeticCRS[\"WGS 84\",\n" +
            "  Datum[\"World Geodetic System 1984\",\n" +
            "    Ellipsoid[\"WGS 84\", 6378137.0, 298.257223563]],\n" +
            "  CS[ellipsoidal, 2],\n" +
            "    Axis[\"Latitude (B)\", north],\n" +
            "    Axis[\"Longitude (L)\", east],\n" +
            "    Unit[\"degree\", 0.017453292519943295],\n" +
            "  Scope[\"Horizontal component of 3D system.\\E.*\\Q\"],\n" +                      // EPSG geodetic dataset provides more details here.
            "  Area[\"\\E.*\\Q\"],\n" +                                                         // Language may vary because of SIS localization.
            "  BBox[-90.00, -180.00, 90.00, 180.00],\n" +
            "  Id[\"EPSG\", 4326,\\E.*\\Q URI[\"urn:ogc:def:crs:EPSG:\\E.*\\Q:4326\"]]]\n\\E")   // Version number of EPSG dataset may vary.
            .replaceAll("\n", System.lineSeparator());

works.

Regards,

Christoph

Re: EPSG database encoding (was: Error in maven build)

Posted by Martin Desruisseaux <ma...@geomatys.com>.
Le 04/06/2019 à 17:00, csteinforth@gmail.com a écrit :

> in addition in the methods testURN() and testHTTP and the failures are
> gone! There is now only (…snip…)
>
Can you try a "git pull", then "mvn install" again? Now all test
failures should hopefully be gone.

    Thanks,

        Martin



Re: EPSG database encoding (was: Error in maven build)

Posted by cs...@gmail.com, cs...@gmail.com.
Martin,

I rpelaced this 

> Can you try the following replacement? in CRSCommandTest, method
> testCode(), replace the following line:
> 
>     final String wkt = test.outputBuffer.toString();
> 
> by
> 
>     String wkt = test.outputBuffer.toString();
>     wkt = wkt.replace(System.lineSeparator(), "\n");

in addition in the methods testURN() and testHTTP and the failures are gone! There is now only 

  <testcase name="testVerbose" classname="org.apache.sis.console.AboutCommandTest" time="0.745">
    <failure message="geoapi" type="java.lang.AssertionError">java.lang.AssertionError: geoapi
	at org.apache.sis.console.AboutCommandTest.testVerbose(AboutCommandTest.java:94)
</failure>

left.

I run the build both in Eclipse and from the command line, but it makes no difference. The command line version of maven is 3.6.1, the embedded version in Eclipse seems to be 3.5.3.

Regards,

Christoph

Re: EPSG database encoding (was: Error in maven build)

Posted by Martin Desruisseaux <ma...@geomatys.com>.
Le 04/06/2019 à 14:47, csteinforth@gmail.com a écrit :

> worked! The test runs fine, an the entries in the database are correct
> now. Thanks for your excellent help.
>
Good! Thanks for letting us know.


> There is one error remaining when running the ConsoleTestSuite:
>
> (…snip…)
> [ERROR] testVerbose(org.apache.sis.console.AboutCommandTest)  Time elapsed: 0.64 s  <<< FAILURE!
> java.lang.AssertionError: geoapi
> 	at org.apache.sis.console.AboutCommandTest.testVerbose(AboutCommandTest.java:94)

Are you running Maven from the command-line or from the IDE? Tests
should pass in both cases, but knowing the environment may help to
identify the problem.


> [ERROR] testCode(org.apache.sis.console.CRSCommandTest)  Time elapsed: 0.171 s  <<< FAILURE!

Can you try the following replacement? in CRSCommandTest, method
testCode(), replace the following line:

    final String wkt = test.outputBuffer.toString();

by

    String wkt = test.outputBuffer.toString();
    wkt = wkt.replace(System.lineSeparator(), "\n");

Does it help?

    Martin



Re: EPSG database encoding (was: Error in maven build)

Posted by cs...@gmail.com, cs...@gmail.com.
Hello Martin,

using this one

> 
>   <repositories>
>     <repository>
>       <id>geotoolkit</id>
>       <name>Geotoolkit.org repository</name>
>       <url>http://maven.geotoolkit.org</url>
>     </repository>
>   </repositories>
> 
> Then, use sis-epsg version 1.0-M1 (a milestone). That version use UTF-8

worked! The test runs fine, an the entries in the database are correct now. Thanks for your excellent help. 

There is one error remaining when running the ConsoleTestSuite:

[INFO] Running org.apache.sis.test.suite.ConsoleTestSuite
[ERROR] Tests run: 23, Failures: 2, Errors: 0, Skipped: 4, Time elapsed: 1.03 s <<< FAILURE! - in org.apache.sis.test.suite.ConsoleTestSuite
[ERROR] testVerbose(org.apache.sis.console.AboutCommandTest)  Time elapsed: 0.64 s  <<< FAILURE!
java.lang.AssertionError: geoapi
	at org.apache.sis.console.AboutCommandTest.testVerbose(AboutCommandTest.java:94)

[ERROR] testCode(org.apache.sis.console.CRSCommandTest)  Time elapsed: 0.171 s  <<< FAILURE!
java.lang.AssertionError: 
GeodeticCRS["WGS 84",
  Datum["World Geodetic System 1984",
    Ellipsoid["WGS 84", 6378137.0, 298.257223563]],
  CS[ellipsoidal, 2],
    Axis["Latitude (B)", north],
    Axis["Longitude (L)", east],
    Unit["degree", 0.017453292519943295],
  Scope["Horizontal component of 3D system. Used by the GPS satellite navigation system and for NATO military geodetic surveying."],
  Area["World."],
  BBox[-90.00, -180.00, 90.00, 180.00],
  Id["EPSG", 4326, "9.4", URI["urn:ogc:def:crs:EPSG:9.4:4326"]]]

	at org.apache.sis.console.CRSCommandTest.testCode(CRSCommandTest.java:63)

[INFO] 
[INFO] Results:
[INFO] 
[ERROR] Failures: 
[ERROR]   AboutCommandTest.testVerbose:94 geoapi
[ERROR]   CRSCommandTest.testCode:63 GeodeticCRS["WGS 84",
  Datum["World Geodetic System 1984",
    Ellipsoid["WGS 84", 6378137.0, 298.257223563]],
  CS[ellipsoidal, 2],
    Axis["Latitude (B)", north],
    Axis["Longitude (L)", east],
    Unit["degree", 0.017453292519943295],
  Scope["Horizontal component of 3D system. Used by the GPS satellite navigation system and for NATO military geodetic surveying."],
  Area["World."],
  BBox[-90.00, -180.00, 90.00, 180.00],
  Id["EPSG", 4326, "9.4", URI["urn:ogc:def:crs:EPSG:9.4:4326"]]]

Is there anything missing in my setup?

Thanks in advance,

Christoph