Skip to content

Commit

Permalink
Merge pull request #818 from lat-lon/translateUnicodeToAsciiInFeature…
Browse files Browse the repository at this point in the history
…StoreCOnfigWriter-4166

Improved support of UTF-8/ASCII in the SQLFeatureStore
  • Loading branch information
copierrj authored Feb 2, 2018
2 parents d66d52d + 0b5dfd2 commit 277c108
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,10 @@
<groupId>org.antlr</groupId>
<artifactId>antlr-runtime</artifactId>
</dependency>
<dependency>
<groupId>${project.groupId}</groupId>
<artifactId>junidecode</artifactId>
</dependency>
</dependencies>

<profiles>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ catch [RecognitionException re] {
*------------------------------------------------------------------*/

Identifier
: ('a'..'z' | 'A'..'Z' | '0'..'9' | '_' | '-' | '"' )+
: ('a'..'z' | 'A'..'Z' | '0'..'9' | '_' | '-' | '"' | '\u0080'..'\ufffe' )+
;

Text
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@

import javax.xml.namespace.QName;

import gcardone.junidecode.Junidecode;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

Expand Down Expand Up @@ -106,7 +107,7 @@ private String getSQLIdentifier( String prefix, String name ) {
String substring = id.substring( 0, maxLength - 6 );
id = substring + "_" + ( this.id++ );
}
return id;
return Junidecode.unidecode( id );
}

private String toString( QName qName ) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -505,6 +505,9 @@ The following table lists all available configuration options for ``<Primitive>`
| ``<StorageCRS>`` | 0..1 | Complex | CRS of stored geometries and database srid (only for ``<Geometry>``) |
+-----------------------+-------------+---------+------------------------------------------------------------------------------+

.. hint::
If your configuration file is stored in UTF-8 encoding deegree allows special chars from this charset in the mapping (e.g. the property Straße can be stored in the column 'strasse' or 'straße'). Required is that the database supports UTF-8 as well.

^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Mapping GML application schemas
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Expand Down Expand Up @@ -915,6 +918,9 @@ This walkthrough is based on the INSPIRE Annex I schemas, but you should be able
.. tip::
Instead of PostGIS, you can also use an Oracle Spatial or an Microsoft SQL Server database. In order to enable support for these databases, see :ref:`anchor-db-libraries`.

.. hint::
If the application schema contains UTF-8 characters which are not part of the 7-bit ASCII subset they are normalised during the generation of the feature store configuration for the database mapping (but kept for the feature type names). So the mapping to table and column names contains only 7-bit ASCII character and it is no requirement to the database to use UTF-8.

As a first step, create a JDBC connection to your database. Click **server connections -> jdbc** and enter **inspire** (or an other identifier) as connection id:

.. figure:: images/console_featurestore_mapping1.jpg
Expand Down
5 changes: 5 additions & 0 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -983,6 +983,11 @@
<artifactId>antlr-runtime</artifactId>
<version>3.4</version>
</dependency>
<dependency>
<groupId>${project.groupId}</groupId>
<artifactId>junidecode</artifactId>
<version>0.2</version>
</dependency>
</dependencies>
</dependencyManagement>

Expand Down

0 comments on commit 277c108

Please sign in to comment.