Coder Social home page Coder Social logo

Comments (2)

gmilcinski avatar gmilcinski commented on July 4, 2024

Ho Joey, some ideas, which you can try:
-the script requires "multi-temporal processing", which is triggered by adding TEMPORAL=true parameter
-FIS service itself does not support multi-temporal processing so you should try it on WMS/WCS/WMTS
-I suggest you first try the query with shorter time period, e.g. one quarter (this is certainly not related with the error you get, but might affect performance significantly)

If you copy-paste this script in "temporal Playground" (we have set it up as a prototype), you will see it works:
https://apps.sentinel-hub.com/sentinel-playground-temporal/?source=S2&lat=40.4&lng=-3.730000000000018&zoom=12&preset=CUSTOM&layers=B04,B03,B02&maxcc=20&gain=1.0&temporal=true&gamma=1.0&time=2015-01-01%7C2016-10-09&atmFilter=&showDates=false&evalscript=ZnVuY3Rpb24gICAgc2V0dXAgKGRzcykgewogIHNldElucHV0Q29tcG9uZW50cyhbZHNzLkIwNCxkc3MuQjA4XSk7CiAgc2V0T3V0cHV0Q29tcG9uZW50Q291bnQoMyk7Cn0KCmZ1bmN0aW9uIGNhbGNORFZJKHNhbXBsZSkgewogIHZhciBkZW5vbSA9IHNhbXBsZS5CMDQrc2FtcGxlLkIwODsKICByZXR1cm4gKChkZW5vbSE9MCkgPyAoc2FtcGxlLkIwOC1zYW1wbGUuQjA0KSAvIGRlbm9tIDogMC4wKTsKfQpmdW5jdGlvbiAgc3RyZXRjaCh2YWwsIG1pbiwgbWF4KSAgewogcmV0dXJuICh2YWwtbWluKS8obWF4LW1pbik7Cn0KCmZ1bmN0aW9uIGV2YWx1YXRlUGl4ZWwoc2FtcGxlcyxzY2VuZXMpIHsgIAogIHZhciBhdmcxID0gMDsKICB2YXIgY291bnQxID0gMDsKICB2YXIgYXZnMiA9IDA7CiAgdmFyIGNvdW50MiA9IDA7CiAgdmFyIGF2ZzMgPSAwOwogIHZhciBjb3VudDMgPSAwOwogIHZhciBlbmRNb250aCA9IHNjZW5lc1swXS5kYXRlLmdldE1vbnRoKCk7CiAgCiAgZm9yICh2YXIgaT0wO2k8c2FtcGxlcy5sZW5ndGg7aSsrKSB7CiAgICAgIHZhciBuZHZpID0gY2FsY05EVkkoc2FtcGxlc1tpXSk7CiAgICAgIGlmIChzY2VuZXNbaV0uZGF0ZS5nZXRNb250aCgpPT1lbmRNb250aCkKICAgICAgewoJCWF2ZzMgPSBhdmczICsgbmR2aTsKICAgICAgICBjb3VudDMrKzsKICAgICAgfQogICAgICBlbHNlIGlmIChzY2VuZXNbaV0uZGF0ZS5nZXRNb250aCgpPT0oZW5kTW9udGgtMSkpCiAgICAgIHsKCQlhdmcyID0gYXZnMiArIG5kdmk7CiAgICAgICAgY291bnQyKys7CiAgICAgIH0KICAgICAgZWxzZQogICAgICB7ICAgICAgCgkJYXZnMT0gYXZnMSArIG5kdmk7CiAgICAgICAgY291bnQxKys7CiAgICAgIH0KICAgICAgCiAgfQogIGF2ZzEgPSBhdmcxL2NvdW50MTsKICBhdmcyID0gYXZnMi9jb3VudDI7CiAgYXZnMyA9IGF2ZzMvY291bnQzOwogIGF2ZzEgPSBzdHJldGNoKGF2ZzEsIDAuMSwgMC43KTsKICBhdmcyID0gc3RyZXRjaChhdmcyLCAwLjEsIDAuNyk7CiAgYXZnMyA9IHN0cmV0Y2goYXZnMywgMC4xLCAwLjcpOwogIAogIHJldHVybiBbYXZnMSxhdmcyLGF2ZzNdOwoKCn0KZnVuY3Rpb24gZmlsdGVyU2NlbmVzIChzY2VuZXMsIGlucHV0TWV0YWRhdGEpIHsKICAgIHJldHVybiBzY2VuZXMuZmlsdGVyKGZ1bmN0aW9uIChzY2VuZSkgewoJICByZXR1cm4gc2NlbmUuZGF0ZS5nZXRUaW1lKCk%2BPShpbnB1dE1ldGFkYXRhLnRvLmdldFRpbWUoKS0zKjMxKjI0KjM2MDAqMTAwMCkgOwogICAgfSk7Cn0%3D

from custom-scripts.

JoeyFaulkner avatar JoeyFaulkner commented on July 4, 2024

Awesome, the temporal flag solved my problem. Thanks! :)

from custom-scripts.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.