Skip to content

Commit

Permalink
Use loadMetadata #177
Browse files Browse the repository at this point in the history
  • Loading branch information
EmileSonneveld committed Jul 5, 2023
1 parent 6ef811a commit 109758c
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -956,7 +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)
}
else {
def alignmentFromDataPath(dataPath: String, projectedExtent: ProjectedExtent): TargetRegion = {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import geotrellis.proj4.CRS
import geotrellis.raster.io.geotiff.OverviewStrategy
import geotrellis.raster.{CellSize, CellType, FloatConstantNoDataCellType, FloatConstantTile, GridBounds, GridExtent, MultibandTile, Raster, RasterMetadata, RasterSource, ResampleMethod, ResampleTarget, SourceName, TargetCellType}
import geotrellis.vector.Extent
import org.openeo.opensearch.OpenSearchResponses.CreoFeatureCollection

import java.net.URL
import scala.xml.XML
Expand All @@ -16,8 +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)
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

0 comments on commit 109758c

Please sign in to comment.