ntquach closed pull request #9: SDAP-42 Fix NEXUS tile service 
find_tiles_by_metadata
URL: https://github.com/apache/incubator-sdap-nexus/pull/9
 
 
   

This is a PR merged from a forked repository.
As GitHub hides the original diff on merge, it is displayed below for
the sake of provenance:

As this is a foreign pull request (from a fork), the diff is supplied
below (as it won't show otherwise due to GitHub magic):

diff --git a/data-access/nexustiles/nexustiles.py 
b/data-access/nexustiles/nexustiles.py
index 6ecb033..1330c03 100644
--- a/data-access/nexustiles/nexustiles.py
+++ b/data-access/nexustiles/nexustiles.py
@@ -166,7 +166,7 @@ def find_tiles_in_polygon(self, bounding_polygon, ds=None, 
start_time=0, end_tim
     @tile_data()
     def find_tiles_by_metadata(self, metadata, ds=None, start_time=0, 
end_time=-1, **kwargs):
         """
-        Return list of tiles that matches the specified metadata, start_time, 
end_time.
+        Return list of tiles whose metadata matches the specified metadata, 
start_time, end_time.
         :param metadata: List of metadata values to search for tiles e.g 
["river_id_i:1", "granule_s:granule_name"]
         :param ds: The dataset name to search
         :param start_time: The start time to search for tiles
@@ -174,6 +174,20 @@ def find_tiles_by_metadata(self, metadata, ds=None, 
start_time=0, end_time=-1, *
         :return: A list of tiles
         """
         tiles = self._metadatastore.find_all_tiles_by_metadata(metadata, ds, 
start_time, end_time, **kwargs)
+
+        return tiles
+
+    def get_tiles_by_metadata(self, metadata, ds=None, start_time=0, 
end_time=-1, **kwargs):
+        """
+        Return list of tiles that matches the specified metadata, start_time, 
end_time with tile data outside of time
+        range properly masked out.
+        :param metadata: List of metadata values to search for tiles e.g 
["river_id_i:1", "granule_s:granule_name"]
+        :param ds: The dataset name to search
+        :param start_time: The start time to search for tiles
+        :param end_time: The end time to search for tiles
+        :return: A list of tiles
+        """
+        tiles = self.find_tiles_by_metadata(metadata, ds, start_time, 
end_time, **kwargs)
         tiles = self.mask_tiles_to_time_range(start_time, end_time, tiles)
 
         return tiles
diff --git a/data-access/tests/nexustiles_test.py 
b/data-access/tests/nexustiles_test.py
index 9b2901e..9f533a8 100644
--- a/data-access/tests/nexustiles_test.py
+++ b/data-access/tests/nexustiles_test.py
@@ -76,6 +76,11 @@ def test_time_series_tile(self):
         for tile in tiles:
             print tile.get_summary()
 
+    def test_get_tiles_by_metadata(self):
+        tiles = 
self.tile_service.get_tiles_by_metadata(['id:60758e00-5721-3a6e-bf57-78448bb0aeeb'],
+                                                        
"MUR-JPL-L4-GLOB-v4.1", 1514764800, 1514764800)
+        for tile in tiles:
+            print tile.get_summary()
 
 # from nexustiles.model.nexusmodel import get_approximate_value_for_lat_lon
 # import numpy as np


 

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services

Reply via email to