From a80c61fbbbccad32532b8bde0b730c659bb0c975 Mon Sep 17 00:00:00 2001 From: pedjar Date: Wed, 27 Jan 2016 10:50:47 +0100 Subject: [PATCH 1/8] backport of spherical epsg3857 --- .../deegree/d3/config/crs-definitions.xml | 26 ++++++++++++++++--- .../d3/config/projection-definitions.xml | 9 +++++++ 2 files changed, 31 insertions(+), 4 deletions(-) diff --git a/deegree-core/deegree-core-cs/src/main/resources/org/deegree/cs/persistence/deegree/d3/config/crs-definitions.xml b/deegree-core/deegree-core-cs/src/main/resources/org/deegree/cs/persistence/deegree/d3/config/crs-definitions.xml index 075cb72b16..3128b09677 100644 --- a/deegree-core/deegree-core-cs/src/main/resources/org/deegree/cs/persistence/deegree/d3/config/crs-definitions.xml +++ b/deegree-core/deegree-core-cs/src/main/resources/org/deegree/cs/persistence/deegree/d3/config/crs-definitions.xml @@ -21811,12 +21811,8 @@ projection_for_epsg:900913 - epsg:3395 epsg:3857 google_maps - http://www.opengis.net/gml/srs/epsg.xml#3395 - urn:ogc:def:crs:epsg::3395 - urn:opengis:def:crs:epsg::3395 http://www.opengis.net/gml/srs/epsg.xml#3857 urn:ogc:def:crs:epsg::3857 urn:opengis:def:crs:epsg::3857 @@ -21836,6 +21832,28 @@ metre north + google_maps_geographiccrs + epsg:3856 + + + epsg:3395 + http://www.opengis.net/gml/srs/epsg.xml#3395 + urn:ogc:def:crs:epsg::3395 + urn:opengis:def:crs:epsg::3395 + WGS 84 / World Mercator + World Mercator + -180.0,-80.0,180.0,84.0 + World between 80°S and 84°N. + + x + metre + east + + + y + metre + north + epsg:4326 epsg:19883 diff --git a/deegree-core/deegree-core-cs/src/main/resources/org/deegree/cs/persistence/deegree/d3/config/projection-definitions.xml b/deegree-core/deegree-core-cs/src/main/resources/org/deegree/cs/persistence/deegree/d3/config/projection-definitions.xml index acc1f6c18b..8b4397a8b3 100644 --- a/deegree-core/deegree-core-cs/src/main/resources/org/deegree/cs/persistence/deegree/d3/config/projection-definitions.xml +++ b/deegree-core/deegree-core-cs/src/main/resources/org/deegree/cs/persistence/deegree/d3/config/projection-definitions.xml @@ -10773,6 +10773,15 @@ 0.0 0.0 + + epsg:3856 + Pseudo-Mercator + 0.0 + 0.0 + 1.0 + 0.0 + 0.0 + projection_for_epsg:900913 0.0 From 8386310b37b7ab2a25f34d46a0ba1de013f273bb Mon Sep 17 00:00:00 2001 From: pedjar Date: Wed, 6 Jan 2016 12:26:18 +0100 Subject: [PATCH 2/8] Split epsg:3857 and epsg:3395 into two seperate crs-definitions. Altered epsg:3857 to use a spherical formula. Added epsg:3856 to projection-definitions. --- .../deegree/d3/config/crs-definitions.xml | 22 +++++++++++++++++++ .../d3/config/projection-definitions.xml | 9 ++++++++ 2 files changed, 31 insertions(+) diff --git a/deegree-core/deegree-core-cs/src/main/resources/org/deegree/cs/persistence/deegree/d3/config/crs-definitions.xml b/deegree-core/deegree-core-cs/src/main/resources/org/deegree/cs/persistence/deegree/d3/config/crs-definitions.xml index 3128b09677..6d3120128d 100644 --- a/deegree-core/deegree-core-cs/src/main/resources/org/deegree/cs/persistence/deegree/d3/config/crs-definitions.xml +++ b/deegree-core/deegree-core-cs/src/main/resources/org/deegree/cs/persistence/deegree/d3/config/crs-definitions.xml @@ -21835,6 +21835,28 @@ google_maps_geographiccrs epsg:3856 + + epsg:3395 + http://www.opengis.net/gml/srs/epsg.xml#3395 + urn:ogc:def:crs:epsg::3395 + urn:opengis:def:crs:epsg::3395 + WGS 84 / World Mercator + World Mercator + -180.0,-80.0,180.0,84.0 + World between 80°S and 84°N. + + x + metre + east + + + y + metre + north + + google_maps_geographiccrs + epsg:3856 + epsg:3395 http://www.opengis.net/gml/srs/epsg.xml#3395 diff --git a/deegree-core/deegree-core-cs/src/main/resources/org/deegree/cs/persistence/deegree/d3/config/projection-definitions.xml b/deegree-core/deegree-core-cs/src/main/resources/org/deegree/cs/persistence/deegree/d3/config/projection-definitions.xml index 8b4397a8b3..dd63baaa2c 100644 --- a/deegree-core/deegree-core-cs/src/main/resources/org/deegree/cs/persistence/deegree/d3/config/projection-definitions.xml +++ b/deegree-core/deegree-core-cs/src/main/resources/org/deegree/cs/persistence/deegree/d3/config/projection-definitions.xml @@ -10782,6 +10782,15 @@ 0.0 0.0 + + epsg:3856 + Pseudo-Mercator + 0.0 + 0.0 + 1.0 + 0.0 + 0.0 + projection_for_epsg:900913 0.0 From 0f0d046b2631310a8f8321ffbb102ce27d1c7128 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andreas=20von=20D=C3=B6mming?= Date: Thu, 23 Mar 2017 17:42:56 +0100 Subject: [PATCH 3/8] make exception more verbose --- .../java/org/deegree/gml/feature/StreamFeatureCollection.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/deegree-core/deegree-core-base/src/main/java/org/deegree/gml/feature/StreamFeatureCollection.java b/deegree-core/deegree-core-base/src/main/java/org/deegree/gml/feature/StreamFeatureCollection.java index b15278b097..5717d16ffb 100644 --- a/deegree-core/deegree-core-base/src/main/java/org/deegree/gml/feature/StreamFeatureCollection.java +++ b/deegree-core/deegree-core-base/src/main/java/org/deegree/gml/feature/StreamFeatureCollection.java @@ -259,7 +259,7 @@ public Feature next() { try { next = read(); } catch ( IOException e ) { - throw new RuntimeException(); + throw new RuntimeException(e); } return currentFeature; } From 7cfa0711a22257b55baa8af8b1e3b6b31fad0591 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andreas=20von=20D=C3=B6mming?= Date: Thu, 23 Mar 2017 17:43:58 +0100 Subject: [PATCH 4/8] do not detect application feature types as gml-feature-collection --- .../deegree/gml/schema/GMLSchemaInfoSet.java | 25 ++++++++++++++++++- 1 file changed, 24 insertions(+), 1 deletion(-) diff --git a/deegree-core/deegree-core-base/src/main/java/org/deegree/gml/schema/GMLSchemaInfoSet.java b/deegree-core/deegree-core-base/src/main/java/org/deegree/gml/schema/GMLSchemaInfoSet.java index ac5e848404..5900c99934 100644 --- a/deegree-core/deegree-core-base/src/main/java/org/deegree/gml/schema/GMLSchemaInfoSet.java +++ b/deegree-core/deegree-core-base/src/main/java/org/deegree/gml/schema/GMLSchemaInfoSet.java @@ -123,7 +123,15 @@ * @version $Revision:$, $Date:$ */ public class GMLSchemaInfoSet extends XMLSchemaInfoSet { - + + final static List NS_WITH_GENERIC_FEATURECOLLECTIONS = new ArrayList(); + + static { + NS_WITH_GENERIC_FEATURECOLLECTIONS.add( CommonNamespaces.GML3_2_NS); + NS_WITH_GENERIC_FEATURECOLLECTIONS.add(CommonNamespaces.CRSNS); + NS_WITH_GENERIC_FEATURECOLLECTIONS.add("http://www.opengis.net/wfs/2.0"); + } + private static final Logger LOG = LoggerFactory.getLogger( GMLSchemaInfoSet.class ); private static final String GML_PRE_32_NS = CommonNamespaces.GMLNS; @@ -522,6 +530,21 @@ public List getFeatureCollectionElementDeclarations( Strin * @return true, if the given element declaration is a feature collection, false otherwise */ private boolean isGML32FeatureCollection( XSElementDeclaration featureDecl ) { + + // several parts of deegree code treat feature collections different from normal feature, e.g. assume to be a container element in WFS transaction requests. + // This is problematic if the feature collection is an custom application type element, so only elements of well known namespace will be treated as fc... + final String targetNS = featureDecl.getNamespace(); + boolean match=false; + for(String ns:NS_WITH_GENERIC_FEATURECOLLECTIONS){ + if(ns.equals( targetNS)){ + match=true; + break; + } + } + if(!match){ + return false; + } + XSComplexTypeDecl type = (XSComplexTypeDecl) featureDecl.getTypeDefinition(); List propDecls = getPropertyDecls( type ); for ( XSElementDeclaration propDecl : propDecls ) { From 548f4ff2d443ba380516498d2d4b3720f15541fa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andreas=20von=20D=C3=B6mming?= Date: Thu, 23 Mar 2017 17:44:42 +0100 Subject: [PATCH 5/8] add debug information when compiling --- deegree-core/deegree-core-annotations/pom.xml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/deegree-core/deegree-core-annotations/pom.xml b/deegree-core/deegree-core-annotations/pom.xml index b334eb5e4c..451c28c222 100644 --- a/deegree-core/deegree-core-annotations/pom.xml +++ b/deegree-core/deegree-core-annotations/pom.xml @@ -34,6 +34,10 @@ org.apache.maven.plugins maven-compiler-plugin + + + -g + 1.6 1.6 UTF-8 From 51e16af4174c701b92f7985be8f20bfb167d0743 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andreas=20von=20D=C3=B6mming?= Date: Thu, 23 Mar 2017 17:45:08 +0100 Subject: [PATCH 6/8] skip ReferenceResolvingException --- .../java/org/deegree/gml/reference/GmlDocumentIdContext.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/deegree-core/deegree-core-base/src/main/java/org/deegree/gml/reference/GmlDocumentIdContext.java b/deegree-core/deegree-core-base/src/main/java/org/deegree/gml/reference/GmlDocumentIdContext.java index e87c8f60e5..48171e7d46 100644 --- a/deegree-core/deegree-core-base/src/main/java/org/deegree/gml/reference/GmlDocumentIdContext.java +++ b/deegree-core/deegree-core-base/src/main/java/org/deegree/gml/reference/GmlDocumentIdContext.java @@ -195,7 +195,9 @@ private GMLObject fetchExternalGmlObject( String uri, String baseURL ) { } return object; } else { - throw new ReferenceResolvingException( "external object reference validation is disabled" ); +// throw new ReferenceResolvingException( "external object reference validation is disabled" ); + LOG.debug( "external object reference validation is disabled" ); + return null; } } From d2934655fa4417c24f9c90445da376a41ec00221 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andreas=20von=20D=C3=B6mming?= Date: Thu, 23 Mar 2017 17:45:51 +0100 Subject: [PATCH 7/8] detect fws2.0-Featurecollection as Container-Element --- .../java/org/deegree/services/wfs/TransactionHandler.java | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/deegree-services/deegree-services-wfs/src/main/java/org/deegree/services/wfs/TransactionHandler.java b/deegree-services/deegree-services-wfs/src/main/java/org/deegree/services/wfs/TransactionHandler.java index 6ac76fdc28..3fc1e044d0 100644 --- a/deegree-services/deegree-services-wfs/src/main/java/org/deegree/services/wfs/TransactionHandler.java +++ b/deegree-services/deegree-services-wfs/src/main/java/org/deegree/services/wfs/TransactionHandler.java @@ -427,7 +427,9 @@ private FeatureCollection parseFeaturesOrCollection( XMLStreamReader xmlStream, gmlStream.setApplicationSchema( schema ); gmlStream.setDefaultCRS( defaultCRS ); - if ( new QName( WFS_NS, "FeatureCollection" ).equals( xmlStream.getName() ) ) { + if ( new QName( WFS_NS, "FeatureCollection" ).equals( xmlStream.getName() )// + ||new QName( WFS_200_NS, "FeatureCollection" ).equals( xmlStream.getName() ) + ) { LOG.debug( "Features embedded in wfs:FeatureCollection" ); fc = parseWFSFeatureCollection( xmlStream, gmlStream ); // skip to wfs:Insert END_ELEMENT @@ -454,7 +456,7 @@ private FeatureCollection parseFeaturesOrCollection( XMLStreamReader xmlStream, } // resolve local xlink references - gmlStream.getIdContext().resolveLocalRefs(); +// disabled gmlStream.getIdContext().resolveLocalRefs(); return fc; } From 52446a8c03a7d294a385398aa4b1c51f8ad2a5d6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andreas=20von=20D=C3=B6mming?= Date: Thu, 23 Mar 2017 17:47:09 +0100 Subject: [PATCH 8/8] remove crs definition that leads to errors when reading projection definitions --- .../cs/persistence/deegree/d3/config/projection-definitions.xml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/deegree-core/deegree-core-cs/src/main/resources/org/deegree/cs/persistence/deegree/d3/config/projection-definitions.xml b/deegree-core/deegree-core-cs/src/main/resources/org/deegree/cs/persistence/deegree/d3/config/projection-definitions.xml index dd63baaa2c..cb8363165a 100644 --- a/deegree-core/deegree-core-cs/src/main/resources/org/deegree/cs/persistence/deegree/d3/config/projection-definitions.xml +++ b/deegree-core/deegree-core-cs/src/main/resources/org/deegree/cs/persistence/deegree/d3/config/projection-definitions.xml @@ -10799,6 +10799,7 @@ 0.0 0.0 +