Skip to content

Commit

Permalink
Fix compile time error in test. #177
Browse files Browse the repository at this point in the history
  • Loading branch information
EmileSonneveld committed Jul 14, 2023
1 parent 9c83b96 commit 61a5719
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -956,8 +956,7 @@ class FileLayerProvider(openSearch: OpenSearchClient, openSearchCollectionId: St
}
}else if(dataPath.endsWith("MTD_TL.xml")) {
//TODO EP-3611 parse angles
SentinelXMLMetadataRasterSource(new URL(vsisToHttpsCreo(dataPath)),bands)
// SentinelXMLMetadataRasterSource(dataPath, bands)
SentinelXMLMetadataRasterSource(dataPath, bands)
}
else {
def alignmentFromDataPath(dataPath: String, projectedExtent: ProjectedExtent): TargetRegion = {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,8 @@ object SentinelXMLMetadataRasterSource {
* @param bands
* @return
*/
def apply(path:URL, bands:Seq[Int]=Seq(0,1,2,3)): Seq[SentinelXMLMetadataRasterSource] = {
val xmlDoc = XML.load(path)
// val xmlDoc = XML.load(CreoFeatureCollection.loadMetadata(path))
def apply(path:String, bands:Seq[Int]=Seq(0,1,2,3)): Seq[SentinelXMLMetadataRasterSource] = {
val xmlDoc = XML.load(CreoFeatureCollection.loadMetadata(path))
val angles = xmlDoc \\ "Tile_Angles"
val meanSun = angles \ "Mean_Sun_Angle"
val mSZA = ( meanSun \ "ZENITH_ANGLE").text.toFloat
Expand Down
2 changes: 1 addition & 1 deletion openeo-geotrellis/src/test/resources/log4j2-test.xml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@

<Logger name="org.openeo.geotrellis.ComputeStatsGeotrellisAdapter" level="debug" />
<Logger name="org.openeo.opensearch.OpenSearchClient" level="debug" />
<Root level="info">
<Root level="warn">
<AppenderRef ref="stdout" />
</Root>
</Loggers>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ class SentinelXMLMetadataRasterSourceTest {

@Test
def testReadAngles(): Unit = {
val source: Seq[SentinelXMLMetadataRasterSource] = SentinelXMLMetadataRasterSource(getClass.getResource("/org/openeo/geotrellis/layers/MTD_TL.xml"))
val source: Seq[SentinelXMLMetadataRasterSource] = SentinelXMLMetadataRasterSource(getClass.getResource("/org/openeo/geotrellis/layers/MTD_TL.xml").getPath)
assertEquals( 171.800, source(0).read().get.tile.band(0).getDouble(0,0),0.001)
assertEquals( 65.707, source(1).read().get.tile.band(0).getDouble(0,0),0.001)
assertEquals( 251.333, source(2).read().get.tile.band(0).getDouble(0,0),0.001)
Expand Down

0 comments on commit 61a5719

Please sign in to comment.