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

Fix wms epsg database not loading #457

Merged
merged 2 commits into from
Jan 23, 2024
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 @@ -67,6 +67,20 @@ public void testGetPng() {
TestOnLocalServer.withHttpPath("/wms/scanCdmUnitTests/conventions/cf/ipcc/tas_A1.nc?service=WMS&version=1.3.0"
+ "&request=GetMap&CRS=CRS:84&WIDTH=512&HEIGHT=512&LAYERS=tas&BBOX=0,-90,360,90&format="
+ ContentType.png.toString() + "&time=1850-01-16T12:00:00Z");
testGetPng(endpoint);
}

@Test
@Category(NeedsCdmUnitTest.class)
public void testGetPngInAnotherProjection() {
String endpoint =
TestOnLocalServer.withHttpPath("/wms/scanCdmUnitTests/conventions/cf/ipcc/tas_A1.nc?service=WMS&version=1.3.0"
+ "&request=GetMap&CRS=EPSG:3857&WIDTH=512&HEIGHT=512&LAYERS=tas&BBOX=0,-90,360,90&format="
+ ContentType.png.toString() + "&time=1850-01-16T12:00:00Z");
testGetPng(endpoint);
}

private static void testGetPng(String endpoint) {
byte[] result = TestOnLocalServer.getContent(endpoint, HttpServletResponse.SC_OK, ContentType.png.toString());
// make sure we get a png back
// first byte (unsigned) should equal 137 (decimal)
Expand Down
4 changes: 2 additions & 2 deletions tds/src/main/java/thredds/server/config/TdsInit.java
Original file line number Diff line number Diff line change
Expand Up @@ -149,8 +149,8 @@ public void onApplicationEvent(ContextRefreshedEvent event) {
configCatalogInitializer.init(readMode, (PreferencesExt) mainPrefs.node("configCatalog"));

// set epsg database location for edal-java (comes from apache-sis)
EpsgDatabasePath.DB_PATH =
(new File(tdsContext.getThreddsDirectory(), "/cache/edal-java/epsg/").toURI().toString());
EpsgDatabasePath.DB_PATH = (new File(tdsContext.getThreddsDirectory(), "/cache/edal-java/epsg/").getPath());
startupLog.info("EPSG database path: " + EpsgDatabasePath.DB_PATH);
startupLog.info("TdsInit complete");
}
}
Expand Down
Loading