New user interface for STAC search
UI components can be seen at http://localhost:8000/sample.html
- Install the requirements. Go to the root directory of the project and run the following command
python3 -m pip install -r requirements.txt
- Build the project with the following command:
python3 build.py
The files will be moved to the build
directory.
-
Go to the
build
directory and start the webserver -
Go to
http://localhost:8000/sample.html
in a web browser.
Tools to build the dictionary files, client-side functionality, and basic search UI for the STAC search component
Map UI added using Leaflet map that will allow an intuitive interface for the user.
Plugins that do not have a dedicated CDN are installed as
submodules of this repository in the plugins/
directory.
Relevant files from these plugins are then symlinked to the appropriate location in the static/
directory.
The STAC Search UI dictionary comes with a default dictionary of words and terms currently used in the STAC catalog. Currently a short list of words is being used for testing purposes.
- Go to the root of your project and run the build command in the terminal.
python3 build.py
The dictionary files will be created under thetemplates/dictionary/stac_dictionary
directory and then automatically built into thebuild/dictionary/stac_dictionary
directory
Custom dictionaries can be used by providing a csv file with column name/headers "Variable", "Standard name", and "Long name".
- Remove the default
CMIP6_Variables.csv
file already in the folder - Put your CSV source file in the
csv
folder - Go to the root of your project and run the build command in the terminal with the custom dictionary flag
-d
and the name of your dictionary.python3 build.py -d <your-dictionary-name>
- The dictionary files will be created under the
templates/dictionary/<your-dictionary-name>
directory and then automatically built under thebuild/dictionary/<your-dictionary-name>
directory.
- Go to the build directory and start a web server
cd build
python3 -m http.server
-
Go to the localhost in your browser and go to the
sample.html
pagehttp://localhost/sample.html
-
Type in the search field and see the suggested words below it
Leaflet is browser based and dependencies are loaded from the web page.
The Leaflet map is built with the project.
- If needed, go to the root folder of the project and build the project with the following command:
python3 build.py
- Start a localhost:
python3 -m http.server
- Go to the Leaflet map page:
http://localhost:8000/leaflet.html
A dictionary requires two files an "affix"
file (.aff
) and a word list file (.dic
). The affix file is a list of
prefixes and suffixes a word can have. For example, "supply" can have the suffix "ied" when dropping the "y" to make
"supplied".
An affix file is not needed for dictionaries of 100,000 words or less.
The affix file at least needs the encoding set for Typo.js to read it. This is automatically set for UTF-8.
The word list file starts with the number of words in the file, followed by a list of words separated by a newline character.