public void setSRS(String srs) { delegate.setSRS(srs); }
String nativeCrsWkt = (String) envelope.get("crs"); coverage.setSRS(userDefinedCrsIdentifier); CoordinateReferenceSystem crs = CRS.parseWKT(nativeCrsWkt); coverage.setNativeCRS(crs);
Integer code = CRS.lookupEpsgCode(nativeCRS, false); if (code != null) { cinfo.setSRS("EPSG:" + code); cinfo.setProjectionPolicy(ProjectionPolicy.REPROJECT_TO_DECLARED);
cv.setName("coverage"); cv.setAbstract("abstract"); cv.setSRS("EPSG:4326"); cv.setNativeCRS(CRS.decode("EPSG:4326")); cv.getParameters().put("foo", null);
Integer code = CRS.lookupEpsgCode(nativeCRS, false); if (code != null) { cinfo.setSRS("EPSG:" + code); cinfo.setProjectionPolicy(ProjectionPolicy.FORCE_DECLARED);
@Test public void testInitCoverageSRSLookup_GEOS8973() throws Exception { Catalog cat = getCatalog(); CatalogBuilder cb = new CatalogBuilder(cat); cb.setStore(cat.getCoverageStoreByName(MockData.WORLD.getLocalPart())); CoverageInfo cinfo = cb.buildCoverage(); cinfo.setSRS(null); String wkt = "GEOGCS[\"ED50\",\n" + " DATUM[\"European Datum 1950\",\n" + " SPHEROID[\"International 1924\", 6378388.0, 297.0]],\n" + "PRIMEM[\"Greenwich\", 0.0],\n" + "UNIT[\"degree\", 0.017453292519943295]]"; CoordinateReferenceSystem testCRS = CRS.parseWKT(wkt); cinfo.setNativeCRS(testCRS); cb.initCoverage(cinfo, "srs lookup"); assertEquals("EPSG:4230", cinfo.getSRS()); }
CoverageInfo ci = catalog.getCoverageByName("usa"); ci.setProjectionPolicy(ProjectionPolicy.FORCE_DECLARED); ci.setSRS("EPSG:3857"); catalog.save(ci);
cv.setName("cv"); cv.setAbstract("abstract"); cv.setSRS("EPSG:4326"); cv.setNativeCRS(CRS.decode("EPSG:4326")); cv.getParameters().put("foo", null);
cinfo.setSRS("EPSG:4326");
cinfo.setSRS( "EPSG:4326" );
info.setSRS("EPSG:4326"); info.setProjectionPolicy(ProjectionPolicy.REPROJECT_TO_DECLARED);
info.setSRS("EPSG:4326"); info.setProjectionPolicy(ProjectionPolicy.REPROJECT_TO_DECLARED);
@Test public void testRasterReprojectToDeclared() throws Exception { // force it to "reproject to declared" CoverageInfo ci = getCatalog().getCoverageByName(getLayerId(CUSTOM)); ci.setProjectionPolicy(ProjectionPolicy.REPROJECT_TO_DECLARED); ci.setSRS("EPSG:900913"); getCatalog().save(ci); // make a first reprojected request on a pixel that's black (0) String result = getAsString( "wms?REQUEST=GetFeatureInfo&EXCEPTIONS=application%2Fvnd.ogc.se_xml" + "&BBOX=-887430.34934%2C4467316.30601%2C-885862.361705%2C4468893.535223&SERVICE=WMS" + "&INFO_FORMAT=text%2Fplain&QUERY_LAYERS=cite%3Acustom&FEATURE_COUNT=50&Layers=custom" + "&WIDTH=509&HEIGHT=512&format=image%2Fjpeg&styles=&srs=epsg%3A900913&version=1.3.0&i=177&j=225"); assertTrue(result.contains("0.0")); // and now one with actual data, 2 result = getAsString( "wms?REQUEST=GetFeatureInfo&EXCEPTIONS=application%2Fvnd.ogc.se_xml" + "&BBOX=-887430.34934%2C4467316.30601%2C-885862.361705%2C4468893.535223&SERVICE=WMS" + "&INFO_FORMAT=text%2Fplain&QUERY_LAYERS=cite%3Acustom&FEATURE_COUNT=50&Layers=custom" + "&WIDTH=509&HEIGHT=512&format=image%2Fjpeg&styles=&srs=epsg%3A900913&version=1.3.0&i=135&j=223"); assertTrue(result.contains("2.0")); }
@Test public void testRasterReprojectToDeclared() throws Exception { // force it to "reproject to declared" CoverageInfo ci = getCatalog().getCoverageByName(getLayerId(CUSTOM)); ci.setProjectionPolicy(ProjectionPolicy.REPROJECT_TO_DECLARED); ci.setSRS("EPSG:900913"); getCatalog().save(ci); // make a first reprojected request on a pixel that's black (0) String result = getAsString( "wms?REQUEST=GetFeatureInfo&EXCEPTIONS=application%2Fvnd.ogc.se_xml" + "&BBOX=-887430.34934%2C4467316.30601%2C-885862.361705%2C4468893.535223&SERVICE=WMS" + "&INFO_FORMAT=text%2Fplain&QUERY_LAYERS=cite%3Acustom&FEATURE_COUNT=50&Layers=custom" + "&WIDTH=509&HEIGHT=512&format=image%2Fjpeg&styles=&srs=epsg%3A900913&version=1.1.1&x=177&y=225"); assertTrue(result.contains("0.0")); // and now one with actual data, 2 result = getAsString( "wms?REQUEST=GetFeatureInfo&EXCEPTIONS=application%2Fvnd.ogc.se_xml" + "&BBOX=-887430.34934%2C4467316.30601%2C-885862.361705%2C4468893.535223&SERVICE=WMS" + "&INFO_FORMAT=text%2Fplain&QUERY_LAYERS=cite%3Acustom&FEATURE_COUNT=50&Layers=custom" + "&WIDTH=509&HEIGHT=512&format=image%2Fjpeg&styles=&srs=epsg%3A900913&version=1.1.1&x=135&y=223"); assertTrue(result.contains("2.0")); }
cinfo.setSRS("EPSG:4326");
coverage.setLatLonBoundingBox(envelope); coverage.setNativeBoundingBox(envelope); coverage.setSRS("EPSG:4326"); coverage.setNativeCRS(DefaultGeographicCRS.WGS84); coverage.setEnabled(false);