Skip to content

Commit

Permalink
Merge pull request #3 from doemming/projection-and-references-improve…
Browse files Browse the repository at this point in the history
…ments

Projection and references improvements
  • Loading branch information
doemming authored Mar 23, 2017
2 parents 79c62bd + 52446a8 commit 7ca9fb5
Show file tree
Hide file tree
Showing 7 changed files with 100 additions and 9 deletions.
4 changes: 4 additions & 0 deletions deegree-core/deegree-core-annotations/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,10 @@
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<compilerArgs>
<!-- -g: Generates all debugging information, including local variables. By default, only line number and source file information is generated. -->
<arg>-g</arg>
</compilerArgs>
<source>1.6</source>
<target>1.6</target>
<encoding>UTF-8</encoding>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -259,7 +259,7 @@ public Feature next() {
try {
next = read();
} catch ( IOException e ) {
throw new RuntimeException();
throw new RuntimeException(e);
}
return currentFeature;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,15 @@
* @version $Revision:$, $Date:$
*/
public class GMLSchemaInfoSet extends XMLSchemaInfoSet {


final static List<String> NS_WITH_GENERIC_FEATURECOLLECTIONS = new ArrayList<String>();

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;
Expand Down Expand Up @@ -522,6 +530,21 @@ public List<XSElementDeclaration> 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<XSElementDeclaration> propDecls = getPropertyDecls( type );
for ( XSElementDeclaration propDecl : propDecls ) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21811,12 +21811,8 @@
<crs:UsedProjection>projection_for_epsg:900913</crs:UsedProjection>
</crs:ProjectedCRS>
<crs:ProjectedCRS>
<crs:Id>epsg:3395</crs:Id>
<crs:Id>epsg:3857</crs:Id>
<crs:Id>google_maps</crs:Id>
<crs:Id>http://www.opengis.net/gml/srs/epsg.xml#3395</crs:Id>
<crs:Id>urn:ogc:def:crs:epsg::3395</crs:Id>
<crs:Id>urn:opengis:def:crs:epsg::3395</crs:Id>
<crs:Id>http://www.opengis.net/gml/srs/epsg.xml#3857</crs:Id>
<crs:Id>urn:ogc:def:crs:epsg::3857</crs:Id>
<crs:Id>urn:opengis:def:crs:epsg::3857</crs:Id>
Expand All @@ -21836,6 +21832,50 @@
<crs:Units>metre</crs:Units>
<crs:AxisOrientation>north</crs:AxisOrientation>
</crs:Axis>
<crs:UsedGeographicCRS>google_maps_geographiccrs</crs:UsedGeographicCRS>
<crs:UsedProjection>epsg:3856</crs:UsedProjection>
</crs:ProjectedCRS>
<crs:ProjectedCRS>
<crs:Id>epsg:3395</crs:Id>
<crs:Id>http://www.opengis.net/gml/srs/epsg.xml#3395</crs:Id>
<crs:Id>urn:ogc:def:crs:epsg::3395</crs:Id>
<crs:Id>urn:opengis:def:crs:epsg::3395</crs:Id>
<crs:Name>WGS 84 / World Mercator</crs:Name>
<crs:Name>World Mercator</crs:Name>
<crs:AreaOfUse>-180.0,-80.0,180.0,84.0</crs:AreaOfUse>
<crs:AreaOfUse>World between 80°S and 84°N.</crs:AreaOfUse>
<crs:Axis>
<crs:Name>x</crs:Name>
<crs:Units>metre</crs:Units>
<crs:AxisOrientation>east</crs:AxisOrientation>
</crs:Axis>
<crs:Axis>
<crs:Name>y</crs:Name>
<crs:Units>metre</crs:Units>
<crs:AxisOrientation>north</crs:AxisOrientation>
</crs:Axis>
<crs:UsedGeographicCRS>google_maps_geographiccrs</crs:UsedGeographicCRS>
<crs:UsedProjection>epsg:3856</crs:UsedProjection>
</crs:ProjectedCRS>
<crs:ProjectedCRS>
<crs:Id>epsg:3395</crs:Id>
<crs:Id>http://www.opengis.net/gml/srs/epsg.xml#3395</crs:Id>
<crs:Id>urn:ogc:def:crs:epsg::3395</crs:Id>
<crs:Id>urn:opengis:def:crs:epsg::3395</crs:Id>
<crs:Name>WGS 84 / World Mercator</crs:Name>
<crs:Name>World Mercator</crs:Name>
<crs:AreaOfUse>-180.0,-80.0,180.0,84.0</crs:AreaOfUse>
<crs:AreaOfUse>World between 80°S and 84°N.</crs:AreaOfUse>
<crs:Axis>
<crs:Name>x</crs:Name>
<crs:Units>metre</crs:Units>
<crs:AxisOrientation>east</crs:AxisOrientation>
</crs:Axis>
<crs:Axis>
<crs:Name>y</crs:Name>
<crs:Units>metre</crs:Units>
<crs:AxisOrientation>north</crs:AxisOrientation>
</crs:Axis>
<crs:UsedGeographicCRS>epsg:4326</crs:UsedGeographicCRS>
<crs:UsedProjection>epsg:19883</crs:UsedProjection>
</crs:ProjectedCRS>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10773,6 +10773,24 @@
<crs:FalseEasting>0.0</crs:FalseEasting>
<crs:FalseNorthing>0.0</crs:FalseNorthing>
</crs:Mercator>
<crs:Mercator>
<crs:Id>epsg:3856</crs:Id>
<crs:Name>Pseudo-Mercator</crs:Name>
<crs:LatitudeOfNaturalOrigin>0.0</crs:LatitudeOfNaturalOrigin>
<crs:LongitudeOfNaturalOrigin>0.0</crs:LongitudeOfNaturalOrigin>
<crs:ScaleFactor>1.0</crs:ScaleFactor>
<crs:FalseEasting>0.0</crs:FalseEasting>
<crs:FalseNorthing>0.0</crs:FalseNorthing>
</crs:Mercator>
<crs:Mercator>
<crs:Id>epsg:3856</crs:Id>
<crs:Name>Pseudo-Mercator</crs:Name>
<crs:LatitudeOfNaturalOrigin>0.0</crs:LatitudeOfNaturalOrigin>
<crs:LongitudeOfNaturalOrigin>0.0</crs:LongitudeOfNaturalOrigin>
<crs:ScaleFactor>1.0</crs:ScaleFactor>
<crs:FalseEasting>0.0</crs:FalseEasting>
<crs:FalseNorthing>0.0</crs:FalseNorthing>
</crs:Mercator>
<crs:Mercator>
<crs:Id>projection_for_epsg:900913</crs:Id>
<crs:LatitudeOfNaturalOrigin>0.0</crs:LatitudeOfNaturalOrigin>
Expand All @@ -10781,6 +10799,7 @@
<crs:FalseEasting>0.0</crs:FalseEasting>
<crs:FalseNorthing>0.0</crs:FalseNorthing>
</crs:Mercator>
<!--
<crs:TransverseMercator>
<crs:Id>epsg:19851</crs:Id>
<crs:Name>Croatia Transverse Mercator</crs:Name>
Expand All @@ -10790,4 +10809,5 @@
<crs:FalseEasting>500000.0</crs:FalseEasting>
<crs:FalseNorthing>0.0</crs:FalseNorthing>
</crs:TransverseMercator>
-->
</crs:ProjectionDefinitions>
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -454,7 +456,7 @@ private FeatureCollection parseFeaturesOrCollection( XMLStreamReader xmlStream,
}

// resolve local xlink references
gmlStream.getIdContext().resolveLocalRefs();
// disabled gmlStream.getIdContext().resolveLocalRefs();

return fc;
}
Expand Down

0 comments on commit 7ca9fb5

Please sign in to comment.