Hello everyone,
I am curently trying to create a python toolbox (atbx) to compute a profile of mosaic dataset values. The tool takes a mosaic dataset and a line feature as inputs. The output is a json file with pixel values and the distande from the orgin of the line.
Important facts:
- The mosaic dataset is saved inside a database table (postgre).
- The main objective is to share the tool and use it in Portal.
Until now, I've been working and testing locally with ArcGIS Pro.
I manage to intersect both the mosaic dataset and the line feature, and return pixel values along the line.
However, when I try to filter the mosaic dataset by selecting a date, it returns incoherent values (I notice that there are only 2 different values in the list, it is strange).
Here is what I do in details to filter : I use "arcpy.management.MakeMosaicLayer" to create a temporary layer, with a "where_clause = f"mydate >= timestamp '{startDate}' AND mydate< timestamp '{endDate}'"" . "mydate" is the date field from the mosaic dataset, formatted this way : "YYYY-MM-DD hh:mm:ss.s".
I suppose that the method "MakeMosaicLayer" creates a new layer without keeping the mosaic dataset paths, which would explain why the values are wrong.
Is there a way to filter such a mosaic dataset by date in this case ?