Skip to content

Commit

Permalink
[GEOS-3223] EPSG:WGS84(DD) is not a valid SRS
Browse files Browse the repository at this point in the history
  • Loading branch information
aaime committed Feb 25, 2017
1 parent 727e856 commit 952dd20
Show file tree
Hide file tree
Showing 5 changed files with 27 additions and 5 deletions.
Expand Up @@ -760,8 +760,11 @@ private void handleRootCrsList(final Set<String> epsgCodes) {
String currentSRS;

while (it.hasNext()) {
currentSRS = qualifySRS(it.next());
element("CRS", currentSRS);
String code = it.next();
if(!"WGS84(DD)".equals(code)) {
currentSRS = qualifySRS(code);
element("CRS", currentSRS);
}
}
} catch (Exception e) {
LOGGER.log(Level.WARNING, e.getLocalizedMessage(), e);
Expand Down
Expand Up @@ -764,8 +764,11 @@ private void handleRootCrsList(final Set<String> epsgCodes) {
String currentSRS;

while (it.hasNext()) {
currentSRS = qualifySRS(it.next());
element("SRS", currentSRS);
String code = it.next();
if(!"WGS84(DD)".equals(code)) {
currentSRS = qualifySRS(code);
element("SRS", currentSRS);
}
}
} catch (Exception e) {
LOGGER.log(Level.WARNING, e.getLocalizedMessage(), e);
Expand Down
Expand Up @@ -319,7 +319,7 @@ public void testCRSList() throws Exception {
supportedCodes.addAll(CRS.getSupportedCodes("AUTO"));
NodeList allCrsCodes = XPATH.getMatchingNodes("/WMT_MS_Capabilities/Capability/Layer/SRS",
dom);
assertEquals(supportedCodes.size(), allCrsCodes.getLength());
assertEquals(supportedCodes.size() - 1 /* WGS84(DD) */, allCrsCodes.getLength());
}

@Test
Expand Down
Expand Up @@ -16,6 +16,7 @@
import java.io.InputStream;
import java.util.List;

import org.custommonkey.xmlunit.XMLAssert;
import org.custommonkey.xmlunit.XMLUnit;
import org.custommonkey.xmlunit.XpathEngine;
import org.geoserver.catalog.AttributionInfo;
Expand Down Expand Up @@ -93,6 +94,13 @@ public void testCapabilities() throws Exception {
Element e = dom.getDocumentElement();
assertEquals("WMT_MS_Capabilities", e.getLocalName());
}

@org.junit.Test
public void testCapabilitiesNoWGS84DD() throws Exception {
Document dom = dom(get("wms?request=getCapabilities&version=1.1.1"), false);
// print(dom);
XMLAssert.assertXpathNotExists("//SRS[text() = 'EPSG:WGS84(DD)']", dom);
}

@Test
/**
Expand Down
Expand Up @@ -16,6 +16,7 @@
import java.util.List;
import java.util.Map;

import org.custommonkey.xmlunit.XMLAssert;
import org.custommonkey.xmlunit.XMLUnit;
import org.custommonkey.xmlunit.XpathEngine;
import org.geoserver.catalog.AttributionInfo;
Expand Down Expand Up @@ -110,6 +111,13 @@ public void testCapabilities() throws Exception {
Element e = dom.getDocumentElement();
assertEquals("WMS_Capabilities", e.getLocalName());
}

@org.junit.Test
public void testCapabilitiesNoWGS84DD() throws Exception {
Document dom = dom(get("wms?request=getCapabilities&version=1.3.0"), false);
// print(dom);
XMLAssert.assertXpathNotExists("//wms:CRS[text() = 'EPSG:WGS84(DD)']", dom);
}

@org.junit.Test
public void testGetCapsContainsNoDisabledTypes() throws Exception {
Expand Down

0 comments on commit 952dd20

Please sign in to comment.