This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # curl -v http://dev.mlhub.earth:8080/gql \ | |
| curl -v http://dev.mlhub.earth:3000/api/gql \ | |
| -F operations='{ "query": "mutation ($file: Upload!) { upload_dataset_ingest_file( input: { dataset_id: \"guidorice_dataset1\", ingest_filetype: pdf }, blob: $file) { error size message } } ", "variables": { "file": null } }' \ | |
| -F map='{ "0": ["variables.file"] }' \ | |
| -F 0=@test.pdf |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| $ gdalinfo /vsis3/sentinel-cogs/sentinel-s2-l2a-cogs/46/C/DB/2022/10/S2B_46CDB_20221003_0_L2A/B02.tif | |
| Driver: GTiff/GeoTIFF | |
| Files: /vsis3/sentinel-cogs/sentinel-s2-l2a-cogs/46/C/DB/2022/10/S2B_46CDB_20221003_0_L2A/B02.tif | |
| Size is 10980, 10980 | |
| Coordinate System is: | |
| PROJCRS["WGS 84 / UTM zone 46S", | |
| ... |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| """ | |
| Preprocess chips and fields dirs for model_ecaas_agrifieldnet_silver. | |
| """ | |
| from pathlib import Path | |
| import shutil | |
| dataset_src = Path.home() / 'data/ref_agrifieldnet_competition_v1' | |
| fields_src = dataset_src / 'ref_agrifieldnet_competition_v1_labels_test' | |
| images_src = dataset_src / 'ref_agrifieldnet_competition_v1_source' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| apt-get install -y --no-install-recommends gdebi-core | |
| export R_VERSION=4.2.2 | |
| curl -O https://cdn.rstudio.com/r/ubuntu-1804/pkgs/r-${R_VERSION}_1_amd64.deb | |
| gdebi --non-interactive r-${R_VERSION}_1_amd64.deb | |
| export PATH=${PATH}:/opt/R/${R_VERSION}/bin | |
| R -e "install.packages(c('devtools', 'plyr', 'tidyverse', 'raster', 'celestial', 'caret', 'fastICA', 'SOAR', 'RStoolbox', 'jsonlite', 'data.table', 'spdep'), repos='http://cran.us.r-project.org')" | |
| R -e "devtools::install_github('OpenDroneMap/FIELDimageR')" | |
| rm r-${R_VERSION}_1_amd64.deb |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| """ | |
| umm-s can be validated in the default usage of jsonschema: | |
| """ | |
| import json | |
| from pathlib import Path | |
| from jsonschema import validate | |
| schema_src = Path.home() / 'repos/nasa/unified-metadata-model/service/v1.5.0/umm-s-json-schema.json' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/env bash | |
| # | |
| # adds directory of geojson to geopackage database | |
| # | |
| set -e | |
| for file in task_aois/*.geojson; do | |
| echo adding $file; | |
| ogr2ogr -f GPKG task_aois.gpkg -append $file; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| """ | |
| freely copied from @vincentsarago | |
| """ | |
| import rasterio | |
| # http://due.esrin.esa.int/files/GLOBCOVER2009_Validation_Report_2.2.pdf | |
| cmap = { | |
| 0: (0, 0, 0, 0), # Nodata | |
| 11: (192, 240, 239, 255), # Post-flooding or irrigated croplands | |
| 14: (255, 255, 112, 255), # Rainfed croplands |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| """ | |
| from @vincentsarago | |
| """ | |
| import random | |
| import sys | |
| import numpy | |
| import requests | |
| import mercantile | |
| from concurrent import futures | |
| import click |
NewerOlder