Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for GML 3.2.2 #1108

Merged
merged 1 commit into from
Dec 17, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -58,8 +58,8 @@ public enum GMLVersion {
GML_30( GMLNS, "3.0", "3.0.1" ),
/** GML 3.1 versions (either 3.1.0 or 3.1.1) */
GML_31( GMLNS, "3.1", "3.1.1" ),
/** GML 3.2 versions (3.2.1) */
GML_32( GML3_2_NS, "3.2", "3.2.1" );
/** GML 3.2 versions (either 3.2.1 or 3.2.2) */
GML_32( GML3_2_NS, "3.2", "3.2.2" );

private final String ns;

Expand Down Expand Up @@ -139,7 +139,7 @@ public static GMLVersion fromMimeType( String mimeType, GMLVersion defaultVersio
result = GML_30;
} else if ( v.compareTo( new Version( 3, 1, 1 ) ) <= 0 ) {
result = GML_31;
} else if ( v.compareTo( new Version( 3, 2, 1 ) ) <= 0 ) {
} else if ( v.compareTo( new Version( 3, 2, 2 ) ) <= 0 ) {
result = GML_32;
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,11 @@ public void gml3_2_1() {
assertEquals( GMLVersion.GML_32, fromMimeType( "text/xml; subtype=gml/3.2.1", null ) );
}

@Test
public void gml3_2_2() {
assertEquals( GMLVersion.GML_32, fromMimeType( "text/xml; subtype=gml/3.2.2", null ) );
}

@Test
public void noGML() {
assertEquals( null, fromMimeType( "text/xml", null ) );
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -208,7 +208,7 @@ public void serialize( FeatureInfoParams params, FeatureInfoContext context )
if ( format.endsWith( "3.1" ) || format.endsWith( "3.1.1" ) ) {
gmlVersion = GMLVersion.GML_31;
}
if ( format.endsWith( "3.2" ) || format.endsWith( "3.2.1" ) ) {
if ( format.endsWith( "3.2" ) || format.endsWith( "3.2.1" ) || format.endsWith( "3.2.2" ) ) {
gmlVersion = GMLVersion.GML_32;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -911,6 +911,8 @@ private GMLVersion determineFormat( Version requestVersion, String format ) {
gmlVersion = GMLVersion.GML_31;
} else if ( "text/xml; subtype=gml/3.2.1".equals( format ) ) {
gmlVersion = GMLVersion.GML_32;
} else if ( "text/xml; subtype=gml/3.2.2".equals( format ) ) {
gmlVersion = GMLVersion.GML_32;
}
}
return gmlVersion;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -559,10 +559,12 @@ private void initFormats( List<JAXBElement<? extends AbstractFormatType>> format
mimeTypeToFormat.put( "text/xml; subtype=gml/3.0.1", gml30 );
mimeTypeToFormat.put( "text/xml; subtype=gml/3.1.1", gml31 );
mimeTypeToFormat.put( "text/xml; subtype=gml/3.2.1", gml32 );
mimeTypeToFormat.put( "text/xml; subtype=gml/3.2.2", gml32 );
mimeTypeToFormat.put( "text/xml; subtype=\"gml/2.1.2\"", gml21 );
mimeTypeToFormat.put( "text/xml; subtype=\"gml/3.0.1\"", gml30 );
mimeTypeToFormat.put( "text/xml; subtype=\"gml/3.1.1\"", gml31 );
mimeTypeToFormat.put( "text/xml; subtype=\"gml/3.2.1\"", gml32 );
mimeTypeToFormat.put( "text/xml; subtype=\"gml/3.2.2\"", gml32 );
} else {
LOG.debug( "Using customized format configuration." );
for ( JAXBElement<? extends AbstractFormatType> formatEl : formatList ) {
Expand Down