2

I'm trying to index the LISS-3 (Resourcesat) products to Open-Data-Cube. I'm connecting to the database (datacube) through the Anaconda prompt after activating the virtual environment (please see the code below). After adding the YAML file, the datacube product list shows no output.

Is there anything wrong with my indexing procedure?

(base) C:\Users\user>conda activate cubeenv

(cubeenv) C:\Users\user>cd C:\Program Files\PostgreSQL\13\bin

(cubeenv) C:\Program Files\PostgreSQL\13\bin>psql -U postgres
Password for user postgres:
psql (13.3)
WARNING: Console code page (437) differs from Windows code page (1252)
         8-bit characters might not work correctly. See psql reference
         page "Notes for Windows users" for details.
Type "help" for help.

postgres=# \connect datacube
You are now connected to database "datacube" as user "postgres".
datacube=# datacube product add F:/LISS3/L3_20oct09/product_definition_L3_20oct09.yml
datacube-# datacube dataset add F:/LISS3/L3_20oct09/product_documents_L3_20oct09.yml
datacube-# datacube product list
datacube-#

I'm using Windows 8.1, have created a database using PostgreSQL. The YAML files are attached.

  1. Product definition file
  2. Dataset document file
2
  • Datacube is a python cli tool. Not a PostgreSQL command. Which how-to are you following ? Please drop out of the PostgreSQL prompt and setup environment variables to initialize the schema with 'datacube init' and continue from there.
    – whatnick
    Jul 23 at 21:03
  • @whatnick I'm not following any particular how-to. I got advice from a colleague that this method might work. Can you please explain the method you are saying? I'm new to this and really stuck with this part.
    – Badal
    Jul 24 at 5:21
3

When you use Postgres, you need to terminate a line with ;. If you do that, you'll get an error message because the datacube command is not a Postgres command.

To run Datacube, you do it just from the command prompt. So run datacube system check instead of psql to see if it's working ok.

Then you need to run datacube system init to set up the DB.

And then you can add products and datasets by doing datacube product add <path-to-yaml> or datacube dataset add <path-to-dataset-yaml>.

This is all documented here.

1
  • 1
    Thank you. It worked.
    – Badal
    Jul 25 at 9:20

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.