PlanetaryComputerDataCatalog

Data catalog for the Microsoft Planetary Computer

https://github.com/microsoft/PlanetaryComputerDataCatalog

Science Score: 36.0%

This score indicates how likely this project is to be science-related based on various indicators:

  • CITATION.cff file
  • codemeta.json file
    Found codemeta.json file
  • .zenodo.json file
    Found .zenodo.json file
  • DOI references
  • Academic publication links
  • Committers with academic emails
    2 of 25 committers (8.0%) from academic institutions
  • Institutional organization owner
  • JOSS paper metadata
  • Scientific vocabulary similarity
    Low similarity (18.0%) to scientific vocabulary

Keywords

aiforearth

Keywords from Contributors

earth-observation earth-observation-catalogue satellites
Last synced: 10 months ago · JSON representation

Repository

Data catalog for the Microsoft Planetary Computer

Basic Info
Statistics
  • Stars: 44
  • Watchers: 7
  • Forks: 17
  • Open Issues: 19
  • Releases: 4
Topics
aiforearth
Created over 5 years ago · Last pushed 12 months ago
Metadata Files
Readme License Code of conduct Security Support

README.md

Planetary Computer Data Catalog

Note: This repository serves as a reference implementation for interacting with Planetary Computer APIs on Azure. Ths code supports the production deployment of the Planetary Computer Data Catalog and Explorer applications. This repository is not meant to be reusable in other situations without significant modification, and the repository maintainers cannot provide any support for non-development deployments of this code. Additionally, this application is under constant development, including some significant planned refactors.

That said, it is hoped that components or examples contained here will be helpful for users developing applications using the open-source components also used by the Planetary Computer, or against Planetary Computer APIs themselves. Please review the terms of use.

To file general issues or ask questions, please visit the Planetary Computer repository.

Data Catalog

A homepage, data catalog, and visualizations for the Planetary Computer.

Requirements

  • Docker
  • docker-compose

Getting started

The entire development environment is created as part of a multi-container docker-compose setup. To fetch and build the images, run:

```sh ./scripts/update

```

Now you can start the development server, and the site should be accessible at http://localhost:4280.

sh ./scripts/server

If you want to run just the frontend development server on your host, ensure you have Node 14 installed and run:

sh npm install npm start

To build the latest docs or external notebook, or if any new dependencies have been added, re-run ./scripts/update (you may need to refresh the app in your browser if the site was running).

Developing

There are four main components to the application:

  1. etl - downloads and processes external files to be included in the application build
  2. docs - a sphinx-powered, markdown based documentation system
  3. api - an Azure Function app that provides a lightweight backend
  4. src - the main React application, bootstrapped from Create React App

Frontend development

First, copy .env.sample file to .env, and ensure the configuration values are set.

| Name | Value | Description | |------|-------|-------------| |REACT_APP_API_ROOT| https://planetarycomputer-staging.microsoft.com | The root URL for the STAC API, either prod, staging or a local instance using http://localhost:8080/stac. If the URL ends in 'stac', this is a special case that is handled by replacing 'stac' with the target service, e.g. 'data' or 'sas' |REACT_APP_TILER_ROOT| Optional | The root URL for the data tiler API, if not hosted from the domain of the STAC API. |REACT_APP_IMAGE_API_ROOT| PC APIs pcfunc endpoint | The root URL for the image data API for animations. For a local instance use http://localhost:8080/f. |REACT_APP_AZMAPS_CLIENT_ID| Retrieve from Azure Portal | The Client ID used to authenticate against Azure Maps. |REACT_APP_ONEDS_TENANT_KEY| Lookup at https://1dswhitelisting.azurewebsites.net/ | Telemetry key (not needed for dev) |REACT_APP_AUTH_URL| Optional. URL to root pc-session-api instance | Used to enable login work.

Run ./scripts/server --api to launch a development server with a local Azure Functions host running.

Azure Maps

In the local development setups, the Azure Maps token is generated using the local developer identity. Be sure to az login and az account set --subscription "Planetary Computer" to ensure the correct token is generated. Your identity will also need the "Azure Maps Search and Render Data Reader" permission, which can be set with:

sh USER_NAME=$(az account show --query user.name -o tsv) az role assignment create \ --assignee "$USER_NAME" \ --role "Azure Maps Search and Render Data Reader" \ --scope "/subscriptions/9da7523a-cb61-4c3e-b1d4-afa5fc6d2da9/resourceGroups/pc-datacatalog-rg/providers/Microsoft.Maps/accounts/pc-datacatalog-azmaps" \ --subscription "Planetary Computer"

Note, you may need to assign this role via an identity that has JIT admin privileges enabled against the Planetary Computer subscription.

Developing against local STAC assets

The REACT_APP_API_ROOT can be set to a local instance of the Metadata API if you are prototyping changes to collections, e.g., http://localhost:8080/stac. However, as a shortcut, you can also run the ./scripts/mockstac script in order to locally serve a static json file from /mockstac/collections. Simply alter the contents of the JSON file as you need, and set your REACT_APP_API_ROOT value to http://localhost:8866 and restart your dev server.

Feature flags

A simple feature flag system is included in the application. To add a flagged feature during development:

  1. Wrap the component to be shown or hidden with a Feature component, providing a name.
  2. In /utils/featureFlags.js add an object to the list with name, description, and active (bool)
  3. Use the script in /extra/ff-bookmarklet.js to toggle features on a running site
    1. Use a JS minifier like https://javascript-minifier.com/ to minimize the file
    2. Add a new bookmark, and paste the minified JS as the URL. You'll likely need add the javascript: label back to the front of the screen.
  4. Toggle feature flags on or off. Be sure that the site works in both states.
  5. Remove the Feature component and the flag entry when the feature is mature enough to be included.

API development

To debug or extend the small API backend, please read the API README.

Testing and linting

The project contains cypress end-to-end tests and jest based unit tests.

To run jest based unit test and perform linting and code format analysis, run ./scripts/test.

Formatting

The project contains a prettier config file that is used to format code, which should integrate with your editor. Alternatively you can run ./scripts/format to format all files. The CI system will check for formatting errors.

Cypress

If you're on WSL2, be sure to set up your system to run the Cypress GUI: https://wilcovanes.ch/articles/setting-up-the-cypress-gui-in-wsl2-ubuntu-for-windows-10/

You may also need to install cypress locally on your computer, with npm install cypress and ./node_modules/.bin/cypress install.

  • Install Google Chrome in your WSL2 environment (Cypress ships with a chromium-based electron browser)
  • Run npm run cypress:open to run the GUI and debug tests, or
  • Run npm run cypress:run to run the headless version in the terminal

Both test suites are run from CI.

Note- the cypress tests currently involve the sentinel-2-l2a collection, but running the backend locally only comes out of the box with naip, so the tests will fail.

Ports

| Service | Port | |--------------------------|------| | Webpack Dev Server | 3000 | | Functions App Dev Server | 7071 | | Mock STAC API Server | 8866 |

Scripts

| Name | Description | |---------|------------------------------------------------------------------| | clean | Removes intermediate build files from docs and dataset codefiles | | format | Runs black and prettier against Python and Java/TypeScript files | mockstac | Serves contents of /mockstac/collections at http://localhost:8866 | | server | Runs frontend development server | | test | Runs unit tests and linter | | update | Install dependencies and build etl and docs content. Use --devdocs to develop against a local notebook repo. | | npm * | Run configured npm commands like npm add, npm lint, npm test, etc |

Deploying

There are 3 Azure Static Web App services enabled, for staging, test and production. They are configured via the GitHub workflow files. Generally, merging to deployment branches will initiate a build and deploy with the service framework:

  • develop: Deploys to staging and test (pc-datacatalog, pc-datacatalog-test)
  • main: Deploys to production (pc-datacatalog-production)

Opening a PR against either branch will also create an ephemeral staging environment, and a site link will be added to the PR comment section.

The release process can be managed with git flow, initialized with the default settings. To bring forth a production release, pull local develop and main to latest, and follow these steps:

  • Identify the latest release

Use CalVer versioning. If the latest release is 2024.2.3 then the next release will be 2024.2.4 if it's still february, otherwise 2024.3.1 or whatever month/year it happens to be when you are runnign releases.

bash git tag | sort

  • Start a release

bash git flow release start X.Y.Z

  • Bump the version number in package.json and check it in

bash git status # check staging area is clean git add package.json git commit -m "X.Y.Z"

  • Publish the release

bash git flow release publish X.Y.Z

  • Finish and push the release branch
    • When prompted, keep default commit messages
    • Use X.Y.Z as the tag message

bash git flow release finish -p X.Y.Z

Contributing

This project welcomes contributions and suggestions. Most contributions require you to agree to a Contributor License Agreement (CLA) declaring that you have the right to, and actually do, grant us the rights to use your contribution. For details, visit https://cla.opensource.microsoft.com.

When you submit a pull request, a CLA bot will automatically determine whether you need to provide a CLA and decorate the PR appropriately (e.g., status check, comment). Simply follow the instructions provided by the bot. You will only need to do this once across all repos using our CLA.

This project has adopted the Microsoft Open Source Code of Conduct. For more information see the Code of Conduct FAQ or contact opencode@microsoft.com with any additional questions or comments.

Trademarks

This project may contain trademarks or logos for projects, products, or services. Authorized use of Microsoft trademarks or logos is subject to and must follow Microsoft's Trademark & Brand Guidelines. Use of Microsoft trademarks or logos in modified versions of this project must not cause confusion or imply Microsoft sponsorship. Any use of third-party trademarks or logos are subject to those third-party's policies.

Owner

  • Name: Microsoft
  • Login: microsoft
  • Kind: organization
  • Email: opensource@microsoft.com
  • Location: Redmond, WA

Open source projects and samples from Microsoft

GitHub Events

Total
  • Issues event: 6
  • Watch event: 7
  • Delete event: 26
  • Issue comment event: 42
  • Push event: 41
  • Pull request review comment event: 1
  • Pull request event: 43
  • Pull request review event: 8
  • Fork event: 3
  • Create event: 33
Last Year
  • Issues event: 6
  • Watch event: 7
  • Delete event: 26
  • Issue comment event: 42
  • Push event: 41
  • Pull request review comment event: 1
  • Pull request event: 43
  • Pull request review event: 8
  • Fork event: 3
  • Create event: 33

Committers

Last synced: 10 months ago

All Time
  • Total Commits: 931
  • Total Committers: 25
  • Avg Commits per committer: 37.24
  • Development Distribution Score (DDS): 0.338
Past Year
  • Commits: 22
  • Committers: 4
  • Avg Commits per committer: 5.5
  • Development Distribution Score (DDS): 0.545
Top Committers
Name Email Commits
Matt McFarland m****d@m****m 616
Tom Augspurger t****r@m****m 148
Rob Emanuele r****e@g****m 37
Preston Hartzell p****l@g****m 31
Dan Morris d****n@m****m 12
Jeff Frankl j****l@a****m 12
Manish Kumar Gupta m****g@m****m 12
Paola Holleway 9****y@u****m 10
dependabot[bot] 4****]@u****m 10
Gustavo Hidalgo g****o@m****m 7
Gustavo Hidalgo z****o@g****m 7
Microsoft Open Source m****e@u****m 5
Pete Gadomski p****i@g****m 5
Dan Morris d****s@c****u 4
Marc Lichtman m****l@v****u 4
Alex Kaminsky a****y@a****m 2
Bruno Sánchez-Andrade Nuño b****c@m****m 1
Bruno Sánchez-Andrade Nuño b****n@g****m 1
Gregorio Martin g****2@g****m 1
Maitreyee Joshi 1****i@u****m 1
Matthew McFarland m****d@g****m 1
Michael Delgado d****m@u****m 1
Ubuntu d****s@g****t 1
maitjoshi m****i@m****m 1
microsoft-github-operations[bot] 5****]@u****m 1

Issues and Pull Requests

Last synced: 11 months ago

All Time
  • Total issues: 23
  • Total pull requests: 489
  • Average time to close issues: 2 months
  • Average time to close pull requests: 11 days
  • Total issue authors: 13
  • Total pull request authors: 18
  • Average comments per issue: 1.65
  • Average comments per pull request: 3.0
  • Merged pull requests: 429
  • Bot issues: 0
  • Bot pull requests: 54
Past Year
  • Issues: 5
  • Pull requests: 34
  • Average time to close issues: 28 days
  • Average time to close pull requests: 8 days
  • Issue authors: 5
  • Pull request authors: 4
  • Average comments per issue: 0.8
  • Average comments per pull request: 1.79
  • Merged pull requests: 23
  • Bot issues: 0
  • Bot pull requests: 11
Top Authors
Issue Authors
  • m-mohr (5)
  • jfrankl (3)
  • ngam (2)
  • mmcfarland (2)
  • srijan55 (2)
  • cmosig (1)
  • hrodmn (1)
  • lukasValentin (1)
  • FlorisCalkoen (1)
  • iuryt (1)
  • rachtsingh (1)
  • gblanco10 (1)
  • not-Karot (1)
Pull Request Authors
  • mmcfarland (226)
  • TomAugspurger (101)
  • dependabot[bot] (73)
  • pjhartzell (30)
  • lossyrob (25)
  • srijan55 (16)
  • pholleway (12)
  • ghidalgo3 (12)
  • 777arc (10)
  • agentmorris (8)
  • gadomski (5)
  • joshimai (4)
  • delgadom (2)
  • brunosan (2)
  • jfrankl (2)
Top Labels
Issue Labels
Pull Request Labels
dependencies (73) javascript (58) python (6)

Dependencies

etl/requirements.txt pypi
  • Jinja2 ==3.0.
  • ipython ==7.31.1
  • myst-parser >=0.13.5
  • nbconvert ==6.0.
  • nbformat ==5.1.3
  • nbsphinx ==0.8.3
  • numpydoc ==1.1.0
  • pyyaml ==5.4.1
  • requests *
  • sphinx ==3.5.4
.github/workflows/azure-static-web-apps-icy-meadow-0fc35e30f.yml actions
  • Azure/static-web-apps-deploy v1 composite
  • actions/cache v3 composite
  • actions/checkout v3 composite
.github/workflows/azure-static-web-apps-thankful-sand-0ed34c70f.yml actions
  • Azure/static-web-apps-deploy v1 composite
  • actions/checkout v3 composite
.github/workflows/azure-static-web-apps-wonderful-stone-06c70c70f.yml actions
  • Azure/static-web-apps-deploy v1 composite
  • actions/cache v3 composite
  • actions/checkout v3 composite
.github/workflows/cypress-ci.yml actions
  • actions/checkout v3 composite
  • actions/upload-artifact v3 composite
  • cypress-io/github-action v4 composite
api/Dockerfile docker
  • mcr.microsoft.com/azure-functions/python 3.0-python3.8 build
docker-compose.yml docker
  • node 14.19.3-slim
  • tiangolo/uvicorn-gunicorn-fastapi python3.7
etl/Dockerfile docker
  • python 3.9-slim build
package-lock.json npm
  • 1513 dependencies
package.json npm
  • copy-webpack-plugin ^11.0.0 development
  • cypress ^10.1.0 development
  • json-loader ^0.5.7 development
  • nock ^13.2.7 development
  • prettier ^2.7.1 development
  • yaml-loader ^0.8.0 development
  • @apidevtools/json-schema-ref-parser ^9.0.9
  • @craco/craco 7.0.0-alpha.3
  • @fluentui/react ^8.76.0
  • @radiantearth/stac-fields 1.0.0-beta.7
  • @reduxjs/toolkit ^1.8.2
  • @testing-library/jest-dom ^5.16.4
  • @testing-library/react ^12.1.3
  • @testing-library/user-event ^14.2.0
  • @turf/bbox-polygon ^6.5.0
  • @turf/boolean-intersects ^6.5.0
  • @turf/centroid ^6.5.0
  • @turf/union ^6.5.0
  • @types/dompurify ^2.3.3
  • @types/geojson ^7946.0.8
  • @types/jest ^27.4.1
  • @types/lodash-es ^4.17.6
  • @types/marked ^4.0.3
  • @types/node ^17.0.44
  • @types/react ^17.0.39
  • @types/react-dom ^17.0.12
  • @types/react-redux ^7.1.24
  • @types/react-router-dom ^5.3.3
  • @types/react-router-hash-link ^2.4.5
  • @types/swagger-ui-react ^4.11.0
  • @uifabric/icons ^7.7.2
  • axios ^0.27.2
  • azure-maps-control ^2.2.0
  • azure-maps-drawing-tools ^1.0.0
  • buffer ^6.0.3
  • dayjs ^1.11.3
  • dompurify ^2.3.8
  • formik ^2.2.9
  • highlight.js ^11.5.1
  • https-browserify ^1.0.0
  • json-stringify-pretty-compact ^4.0.0
  • lodash-es ^4.17.21
  • marked ^4.0.17
  • minisearch ^5.1.0
  • next-share ^0.18.4
  • number-abbreviate ^2.0.0
  • process ^0.11.10
  • query-string ^7.1.3
  • react ^17.0.2
  • react-dom ^17.0.2
  • react-error-boundary ^3.1.4
  • react-helmet ^6.1.0
  • react-query ^3.39.1
  • react-redux ^7.2.9
  • react-router-dom ^6.3.0
  • react-router-hash-link ^2.4.3
  • react-scripts 5.0.1
  • react-use ^17.4.0
  • redux ^4.2.0
  • stream-http ^3.2.0
  • swagger-ui-react ^4.12.0
  • typescript ^4.6.2
  • yup ^0.32.11
api/requirements-dev.txt pypi
  • black * development
  • mypy * development
  • types-requests * development
api/requirements.txt pypi
  • azure-functions ==1.11.2
  • requests ==2.28.1