Coder Social home page Coder Social logo

plant99 / felicette Goto Github PK

View Code? Open in Web Editor NEW
1.8K 40.0 88.0 5.32 MB

Satellite imagery for dummies.

License: MIT License

Python 98.34% Dockerfile 1.66%
geospatial-data gis geospatial-visualization geospatial python python3 geoinformatics earth-observation earth-science satellite-imagery

felicette's Introduction

felicette

Satellite imagery for dummies.

What can you do with this tool?

TL;DR: Generate JPEG earth imagery from coordinates/location name with publicly available satellite data.

This tool is for a sentient being who wants to view high-res satellite imagery of earth, without digging through all the nitty gritty geospatial details of it. So if this is your first time trying to explore how parts of the Earth look from space, you're at the right place.

NB: felicette at the present state searches for cloud-cover < 10%, and doesn't constrain results on the basis of dates.

One can see Product Roadmap for upcoming features.

Installation

felicette depends on GDAL. But the following steps cover GDAL's installation as well.

rio-color uses numpy headers to setup, thus installing numpy and GDAL=={ogrinfo --version} would be sufficient before installing felicette.

Debian

$ sudo add-apt-repository ppa:ubuntugis/ppa
$ sudo apt-get update
$ sudo apt-get install python-numpy gdal-bin libgdal-dev
$ gdal-config --version
 <version-number>
 
* activate virtual environment *

$ pip install numpy GDAL==<version-number>
$ pip install felicette

MacOS

$ brew install gdal
$ gdal-config --version
 <version-number>

* activate virtual environment *

$ pip install numpy GDAL==<version-number>
$ pip install felicette

Docker

As pointed out here, the following docker image works and is volume-mapped to the present working directory.

$ docker run -it -v "$PWD"/felicette-data:/root/felicette-data milhouse1337/felicette felicette -l "Montreal"

Thanks @milhouse1337 for the docker-image.

"Why you no make a section for Windows?" :|

rio-color, one of the felicette's dependencies isn't available on conda ecosystem yet. Here's the link to a small discussion on an installation-issue. This section would be updated when there is a stable version of felicette for Windows.

Felicette has plans to build in-house RGB image enhancement algorithms or use imagemagick /[similar tools on conda-forge] for a Windows release, at least until rio-color is available on conda-forge/conda.


Usage

To use it:

$ felicette --help
Usage: felicette [OPTIONS]

  Satellite imagery for dummies.

Options:
  -c, --coordinates FLOAT...  Coordinates in (lon, lat) format. This overrides
                              -l command

  -l, --location-name TEXT    Location name in string format
  -pan, --pan-enhancement     Enhance image with panchromatic band
  --no-preview                Skip previewing of pre-processed low resolution RGB
                              satellite image.

  -v, --vegetation            Show Color Infrared image to highlight
                              vegetation

  -V, --version               Show the version number and quit
  -p, --product TEXT          Product name 'landsat'/'sentinel'
  --help                      Show this message and exit.

Felicette can download and process Landsat images taking the location's input as (lon, lat) or the location name. They can be used in the following way.

With location name:

$ felicette -l "Kanyakumari"

With coordinates:

$ felicette -c 77.5385 8.0883

--product / -p option is used to specify which data-product is used to generate images i.e Sentinel or Landsat. By default, Landsat-8 data will be used to generate images.

$ felicette -l "Kanyakumari" -p "sentinel"

NB: *To use sentinel data source, one has to set AWS_ACCESS_KEY_ID and AWS_SECRET_ACCESS_KEY (To generate a pair, go to AWS console -> My Security Credentials -> Access keys). This is because Sentinel-2 data is in a Requester Pays bucket.

-pan option uses the panchromatic band to enhance image's resolution to 15 meters, contrary to resolution of RGB bands(30 meters) if Landsat product is being used. Felicette doesn't support any panchromatic enhancements for Sentinel-2 data which already have a resolution of 10m. To get a better Landsat image using felicette use:

$ felicette -pan -c 77.5385 8.0883

--no-preview option doesn't download image to preview, and directly downloads and processes original data. Please use this if you're sure of the location/quality of the images to be generated by felicette with the arguments provided to it.

$ felicette --no-preview -p -c 77.5385 8.0883

-v option generates a CIR image to highlight vegetation in 'red' color. Note that, '-p' option isn't taken into consideration while generating CIR imagery in felicette.

$ felicette  -v -l "Kanyakumari"

Latest release

0.1.13


Feli.. what?

Félicette

Félicette was the first cat launched into space, on 18 October 1963. Even though she landed back on earth safely, Félicette was euthanized two months after the launch so that scientists could perform a necropsy to examine her brain. She was the only cat to have survived spaceflight. Here's a footage of the mission from the archives.

When you get a satellite imagery using this tool, imagine Félicette took the picture for you :))


Preview and examples

Coastal Odisha

Here are some more sample images generated by felicette.

Here is a link to the original images generated with RGB, CIR options.

Following is a recording of the terminal session recording usage of felicette. asciicast


Contributing

felicette is open-source and welcomes all kinds of contributions, be it documentation/wiki pages/bug-fixes/development of new features. A small contributors' guide is available here.

felicette's People

Contributors

alexanderdavid avatar dependabot[bot] avatar epogrebnyak avatar milhouse1337 avatar mmatongo avatar plant99 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

felicette's Issues

Getting Felicette to run on Debian in WSL

I had to run these commands in order to get it to work in Debian on WSL

sudo apt -y install python3-venv python-numpy gdal-bin libgdal-dev
pip3 install wheel
pip3 install --upgrade pip
pip3 install numpy GDAL==$(gdal-config --version)
pip3 install opencv-python==4.3.0.36
pip3 install felicette

I was getting random errors otherwise.

Also xdg-open is meaningless in the context of WSL.
WSL can launch windows exes directly, but I'm not sure if there is a shim available so that xdg-open would invoke ShellOpen somehow on the windows side.

I used xdg-open-wsl. Works great.

Unable to get a meaninful image

When I run the following,

felicette -c -1.5494 47.2119

I get the following image output (tiff shown in QGIS)

Sélection_271

I've installed felicette on Ubuntu 18.04 using python3 -m pip install felicette

Are you able to reproduce? What other informations do you need from me to be able to traceback/get any clue about the issue?

Unable to install on macOS: 'numpy/arrayobject.h' file not found

Installation fails for rio-color. Actually, this may not belong to felicette’s repository, since installing rio-color alone results in the same error.

Getting error:

    rio_color/colorspace.c:583:10: fatal error: 'numpy/arrayobject.h' file not found

Full log, from a freshly created virtual environment (GDAL also installed with brew system-wide per instructions):

bash-5.0:felicette:felicette$ source bin/activate
(felicette) bash-5.0:felicette$ python --version
Python 3.8.5
(felicette) bash-5.0:felicette$ which python
/Users/tonys/Developer/felicette/bin/python
(felicette) bash-5.0:felicette$ 
(felicette) bash-5.0:felicette$ which pi
(felicette) bash-5.0:felicette$ which pip
/Users/tonys/Developer/felicette/bin/pip
(felicette) bash-5.0:felicette$ gdal-config --version
3.1.2
(felicette) bash-5.0:felicette$ pip install numpy GDAL==3.1.2
Collecting numpy
  Downloading numpy-1.19.1-cp38-cp38-macosx_10_9_x86_64.whl (15.3 MB)
     |████████████████████████████████| 15.3 MB 2.7 MB/s 
Collecting GDAL==3.1.2
  Downloading GDAL-3.1.2.tar.gz (593 kB)
     |████████████████████████████████| 593 kB 3.1 MB/s 
Building wheels for collected packages: GDAL
  Building wheel for GDAL (setup.py) ... done
  Created wheel for GDAL: filename=GDAL-3.1.2-cp38-cp38-macosx_10_15_x86_64.whl size=832103 sha256=4774963a7a77bc43cfb6b29dde62de2270f6227b9568601e9d8cf5932aba7151
  Stored in directory: /Users/tonys/Library/Caches/pip/wheels/8f/1d/48/b1adb343d1b157fb1be5511a81afdf195c505d11712e526e28
Successfully built GDAL
Installing collected packages: numpy, GDAL
Successfully installed GDAL-3.1.2 numpy-1.19.1
(felicette) bash-5.0:felicette$ pip install felicette
Collecting felicette
  Using cached felicette-0.1.9-py2.py3-none-any.whl (25 kB)
Collecting rich==3.3.2
  Using cached rich-3.3.2-py3-none-any.whl (137 kB)
Collecting opencv-python==4.3.0.36
  Using cached opencv_python-4.3.0.36-cp38-cp38-macosx_10_9_x86_64.whl (52.6 MB)
Collecting rio-color==1.0.0
  Using cached rio-color-1.0.0.tar.gz (71 kB)
Collecting click==7.1.2
  Using cached click-7.1.2-py2.py3-none-any.whl (82 kB)
Collecting tqdm==4.48.0
  Using cached tqdm-4.48.0-py2.py3-none-any.whl (67 kB)
Collecting pillow==7.2.0
  Using cached Pillow-7.2.0-cp38-cp38-macosx_10_10_x86_64.whl (2.2 MB)
Collecting requests==2.24.0
  Using cached requests-2.24.0-py2.py3-none-any.whl (61 kB)
Processing /Users/tonys/Library/Caches/pip/wheels/d8/bc/05/19898a607218ae30f53e9eeefe20ed676b90cef501b7edf908/sat_search-0.2.3-py3-none-any.whl
Collecting rasterio==1.1.5
  Using cached rasterio-1.1.5-cp38-cp38-macosx_10_9_x86_64.whl (17.4 MB)
Collecting pygments<3.0.0,>=2.6.0
  Using cached Pygments-2.6.1-py3-none-any.whl (914 kB)
Collecting colorama<0.5.0,>=0.4.0
  Using cached colorama-0.4.3-py2.py3-none-any.whl (15 kB)
Collecting typing-extensions<4.0.0,>=3.7.4
  Using cached typing_extensions-3.7.4.2-py3-none-any.whl (22 kB)
Collecting pprintpp<0.5.0,>=0.4.0
  Using cached pprintpp-0.4.0-py2.py3-none-any.whl (16 kB)
Collecting commonmark<0.10.0,>=0.9.0
  Using cached commonmark-0.9.1-py2.py3-none-any.whl (51 kB)
Requirement already satisfied: numpy>=1.17.3 in ./lib/python3.8/site-packages (from opencv-python==4.3.0.36->felicette) (1.19.1)
Collecting rio-mucho
  Using cached rio_mucho-1.0.0-py3-none-any.whl (5.8 kB)
Collecting idna<3,>=2.5
  Using cached idna-2.10-py2.py3-none-any.whl (58 kB)
Collecting certifi>=2017.4.17
  Using cached certifi-2020.6.20-py2.py3-none-any.whl (156 kB)
Collecting urllib3!=1.25.0,!=1.25.1,<1.26,>=1.21.1
  Using cached urllib3-1.25.10-py2.py3-none-any.whl (127 kB)
Collecting chardet<4,>=3.0.2
  Using cached chardet-3.0.4-py2.py3-none-any.whl (133 kB)
Processing /Users/tonys/Library/Caches/pip/wheels/83/0e/ee/2d26cc743e0d27215aa05d51b59d429780c691d54ba08946a8/sat_stac-0.3.3-py3-none-any.whl
Collecting affine
  Using cached affine-2.3.0-py2.py3-none-any.whl (15 kB)
Collecting snuggs>=1.4.1
  Using cached snuggs-1.4.7-py3-none-any.whl (5.4 kB)
Collecting cligj>=0.5
  Using cached cligj-0.5.0-py3-none-any.whl (5.7 kB)
Collecting attrs
  Using cached attrs-19.3.0-py2.py3-none-any.whl (39 kB)
Collecting click-plugins
  Using cached click_plugins-1.1.1-py2.py3-none-any.whl (7.5 kB)
Collecting python-dateutil~=2.7.5
  Using cached python_dateutil-2.7.5-py2.py3-none-any.whl (225 kB)
Collecting pyparsing>=2.1.6
  Using cached pyparsing-2.4.7-py2.py3-none-any.whl (67 kB)
Collecting six>=1.5
  Using cached six-1.15.0-py2.py3-none-any.whl (10 kB)
Building wheels for collected packages: rio-color
  Building wheel for rio-color (setup.py) ... error
  ERROR: Command errored out with exit status 1:
   command: /Users/tonys/Developer/felicette/bin/python -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/private/var/folders/zv/dw7jcgw93sjcxcjlw3p_9rfc0000gn/T/pip-install-4e0p0ol9/rio-color/setup.py'"'"'; __file__='"'"'/private/var/folders/zv/dw7jcgw93sjcxcjlw3p_9rfc0000gn/T/pip-install-4e0p0ol9/rio-color/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' bdist_wheel -d /private/var/folders/zv/dw7jcgw93sjcxcjlw3p_9rfc0000gn/T/pip-wheel-j0d05h8s
       cwd: /private/var/folders/zv/dw7jcgw93sjcxcjlw3p_9rfc0000gn/T/pip-install-4e0p0ol9/rio-color/
  Complete output (34 lines):
  running bdist_wheel
  running build
  running build_py
  creating build
  creating build/lib.macosx-10.15-x86_64-3.8
  creating build/lib.macosx-10.15-x86_64-3.8/rio_color
  copying rio_color/__init__.py -> build/lib.macosx-10.15-x86_64-3.8/rio_color
  copying rio_color/operations.py -> build/lib.macosx-10.15-x86_64-3.8/rio_color
  copying rio_color/utils.py -> build/lib.macosx-10.15-x86_64-3.8/rio_color
  copying rio_color/workers.py -> build/lib.macosx-10.15-x86_64-3.8/rio_color
  creating build/lib.macosx-10.15-x86_64-3.8/rio_color/scripts
  copying rio_color/scripts/__init__.py -> build/lib.macosx-10.15-x86_64-3.8/rio_color/scripts
  copying rio_color/scripts/cli.py -> build/lib.macosx-10.15-x86_64-3.8/rio_color/scripts
  running egg_info
  writing rio_color.egg-info/PKG-INFO
  writing dependency_links to rio_color.egg-info/dependency_links.txt
  writing entry points to rio_color.egg-info/entry_points.txt
  writing requirements to rio_color.egg-info/requires.txt
  writing top-level names to rio_color.egg-info/top_level.txt
  reading manifest file 'rio_color.egg-info/SOURCES.txt'
  reading manifest template 'MANIFEST.in'
  writing manifest file 'rio_color.egg-info/SOURCES.txt'
  copying rio_color/colorspace.c -> build/lib.macosx-10.15-x86_64-3.8/rio_color
  copying rio_color/colorspace.pyx -> build/lib.macosx-10.15-x86_64-3.8/rio_color
  running build_ext
  building 'rio_color.colorspace' extension
  creating build/temp.macosx-10.15-x86_64-3.8
  creating build/temp.macosx-10.15-x86_64-3.8/rio_color
  clang -Wno-unused-result -Wsign-compare -Wunreachable-code -fno-common -dynamic -DNDEBUG -g -fwrapv -O3 -Wall -isysroot /Library/Developer/CommandLineTools/SDKs/MacOSX10.15.sdk -I/Library/Developer/CommandLineTools/SDKs/MacOSX10.15.sdk/usr/include -I/Library/Developer/CommandLineTools/SDKs/MacOSX10.15.sdk/System/Library/Frameworks/Tk.framework/Versions/8.5/Headers -I/usr/local/include -I/usr/local/opt/[email protected]/include -I/usr/local/opt/sqlite/include -I/Users/tonys/Developer/felicette/include -I/usr/local/opt/[email protected]/Frameworks/Python.framework/Versions/3.8/include/python3.8 -c rio_color/colorspace.c -o build/temp.macosx-10.15-x86_64-3.8/rio_color/colorspace.o
  rio_color/colorspace.c:583:10: fatal error: 'numpy/arrayobject.h' file not found
  #include "numpy/arrayobject.h"
           ^~~~~~~~~~~~~~~~~~~~~
  1 error generated.
  error: command 'clang' failed with exit status 1
  ----------------------------------------
  ERROR: Failed building wheel for rio-color
  Running setup.py clean for rio-color
Failed to build rio-color
Installing collected packages: pygments, colorama, typing-extensions, pprintpp, commonmark, rich, opencv-python, click, affine, pyparsing, snuggs, cligj, attrs, click-plugins, rasterio, rio-mucho, rio-color, tqdm, pillow, idna, certifi, urllib3, chardet, requests, six, python-dateutil, sat-stac, sat-search, felicette
    Running setup.py install for rio-color ... error
    ERROR: Command errored out with exit status 1:
     command: /Users/tonys/Developer/felicette/bin/python -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/private/var/folders/zv/dw7jcgw93sjcxcjlw3p_9rfc0000gn/T/pip-install-4e0p0ol9/rio-color/setup.py'"'"'; __file__='"'"'/private/var/folders/zv/dw7jcgw93sjcxcjlw3p_9rfc0000gn/T/pip-install-4e0p0ol9/rio-color/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record /private/var/folders/zv/dw7jcgw93sjcxcjlw3p_9rfc0000gn/T/pip-record-e2ctigmf/install-record.txt --single-version-externally-managed --compile --install-headers /Users/tonys/Developer/felicette/include/site/python3.8/rio-color
         cwd: /private/var/folders/zv/dw7jcgw93sjcxcjlw3p_9rfc0000gn/T/pip-install-4e0p0ol9/rio-color/
    Complete output (34 lines):
    running install
    running build
    running build_py
    creating build
    creating build/lib.macosx-10.15-x86_64-3.8
    creating build/lib.macosx-10.15-x86_64-3.8/rio_color
    copying rio_color/__init__.py -> build/lib.macosx-10.15-x86_64-3.8/rio_color
    copying rio_color/operations.py -> build/lib.macosx-10.15-x86_64-3.8/rio_color
    copying rio_color/utils.py -> build/lib.macosx-10.15-x86_64-3.8/rio_color
    copying rio_color/workers.py -> build/lib.macosx-10.15-x86_64-3.8/rio_color
    creating build/lib.macosx-10.15-x86_64-3.8/rio_color/scripts
    copying rio_color/scripts/__init__.py -> build/lib.macosx-10.15-x86_64-3.8/rio_color/scripts
    copying rio_color/scripts/cli.py -> build/lib.macosx-10.15-x86_64-3.8/rio_color/scripts
    running egg_info
    writing rio_color.egg-info/PKG-INFO
    writing dependency_links to rio_color.egg-info/dependency_links.txt
    writing entry points to rio_color.egg-info/entry_points.txt
    writing requirements to rio_color.egg-info/requires.txt
    writing top-level names to rio_color.egg-info/top_level.txt
    reading manifest file 'rio_color.egg-info/SOURCES.txt'
    reading manifest template 'MANIFEST.in'
    writing manifest file 'rio_color.egg-info/SOURCES.txt'
    copying rio_color/colorspace.c -> build/lib.macosx-10.15-x86_64-3.8/rio_color
    copying rio_color/colorspace.pyx -> build/lib.macosx-10.15-x86_64-3.8/rio_color
    running build_ext
    building 'rio_color.colorspace' extension
    creating build/temp.macosx-10.15-x86_64-3.8
    creating build/temp.macosx-10.15-x86_64-3.8/rio_color
    clang -Wno-unused-result -Wsign-compare -Wunreachable-code -fno-common -dynamic -DNDEBUG -g -fwrapv -O3 -Wall -isysroot /Library/Developer/CommandLineTools/SDKs/MacOSX10.15.sdk -I/Library/Developer/CommandLineTools/SDKs/MacOSX10.15.sdk/usr/include -I/Library/Developer/CommandLineTools/SDKs/MacOSX10.15.sdk/System/Library/Frameworks/Tk.framework/Versions/8.5/Headers -I/usr/local/include -I/usr/local/opt/[email protected]/include -I/usr/local/opt/sqlite/include -I/Users/tonys/Developer/felicette/include -I/usr/local/opt/[email protected]/Frameworks/Python.framework/Versions/3.8/include/python3.8 -c rio_color/colorspace.c -o build/temp.macosx-10.15-x86_64-3.8/rio_color/colorspace.o
    rio_color/colorspace.c:583:10: fatal error: 'numpy/arrayobject.h' file not found
    #include "numpy/arrayobject.h"
             ^~~~~~~~~~~~~~~~~~~~~
    1 error generated.
    error: command 'clang' failed with exit status 1
    ----------------------------------------
ERROR: Command errored out with exit status 1: /Users/tonys/Developer/felicette/bin/python -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/private/var/folders/zv/dw7jcgw93sjcxcjlw3p_9rfc0000gn/T/pip-install-4e0p0ol9/rio-color/setup.py'"'"'; __file__='"'"'/private/var/folders/zv/dw7jcgw93sjcxcjlw3p_9rfc0000gn/T/pip-install-4e0p0ol9/rio-color/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record /private/var/folders/zv/dw7jcgw93sjcxcjlw3p_9rfc0000gn/T/pip-record-e2ctigmf/install-record.txt --single-version-externally-managed --compile --install-headers /Users/tonys/Developer/felicette/include/site/python3.8/rio-color Check the logs for full command output.

Question (or Feature Request?) on DTG of imagery

Is there a way to know when the imagery was collected? I assume sometime in the daylight hours, and probably recently(?) but I have no way of knowing by looking at the output and the associated image.

Can that output be put in the CLI output or some other metadata file that gets associated with the LC####### directory?

Flag -p generates error

Using the -p flag to get even more eye-cany generates an error. I reveived this error during usage of the docker image. However I assume this is an error in the code..
Here is the output, first without the -p flag then with:

arjan@arjanpc:/tmp/lm> docker run -it -v "$PWD"/felicette-data:/root/felicette-data milhouse1337/felicette felicette --no-preview -v -l Neede
✗ required data doesn't exist, downloading green band
b3: 100%|███████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 60.0M/60.0M [00:04<00:00, 13.8MB/s]
✗ required data doesn't exist, downloading red band
b4: 100%|███████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 62.0M/62.0M [00:04<00:00, 14.1MB/s]
✗ required data doesn't exist, downloading NIR band
b5: 100%|███████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 68.0M/68.0M [00:05<00:00, 13.8MB/s]
Let's make our 🌍 imagery a bit more colorful for a human eye!
Generated 🌍 images!🎉
Please wait while I resize and crop the image :)
GeoTIFF saved at:
/root/felicette-data/LC08_L1TP_197024_20210305_20210312_01_T1/LC08_L1TP_197024_20210305_20210312_01_T1-vegetation.tiff
JPEG image saved at:
/root/felicette-data/LC08_L1TP_197024_20210305_20210312_01_T1/LC08_L1TP_197024_20210305_20210312_01_T1-vegetation.jpeg
sh: 1: xdg-open: not found

arjan@arjanpc:/tmp/lm> docker run -it -v "$PWD"/felicette-data:/root/felicette-data milhouse1337/felicette felicette --no-preview -p -v -l Neede
Traceback (most recent call last):
File "/usr/local/bin/felicette", line 8, in
sys.exit(main())
File "/usr/local/lib/python3.7/dist-packages/click/core.py", line 829, in call
return self.main(*args, **kwargs)
File "/usr/local/lib/python3.7/dist-packages/click/core.py", line 782, in main
rv = self.invoke(ctx)
File "/usr/local/lib/python3.7/dist-packages/click/core.py", line 1066, in invoke
return ctx.invoke(self.callback, **ctx.params)
File "/usr/local/lib/python3.7/dist-packages/click/core.py", line 610, in invoke
return callback(*args, **kwargs)
File "/usr/local/lib/python3.7/dist-packages/felicette/cli.py", line 73, in main
item = search_satellite_data(coordinates, 10, product=product)
File "/usr/local/lib/python3.7/dist-packages/felicette/sat_downloader.py", line 53, in search_satellite_data
search_items = search.items()
File "/usr/local/lib/python3.7/dist-packages/satsearch/search.py", line 90, in items
found = self.found(headers=headers)
File "/usr/local/lib/python3.7/dist-packages/satsearch/search.py", line 62, in found
results = self.query(url=url, headers=headers, **kwargs)
File "/usr/local/lib/python3.7/dist-packages/satsearch/search.py", line 80, in query
raise SatSearchError(response.text)
satsearch.search.SatSearchError: index_not_found_exception
arjan@arjanpc:/tmp/lm>

Cheers,
Arjan

No module named 'osgeo' on Debian 10

(env) elmos@furni:~/GIS_dumps$ felicette -c "51.311454,4.867640" 
Traceback (most recent call last):
  File "/home/elmos/.local/bin/felicette", line 5, in <module>
    from felicette.cli import main
  File "/home/elmos/.local/lib/python3.6/site-packages/felicette/cli.py", line 13, in <module>
    from felicette.sat_processor import process_landsat_data
  File "/home/elmos/.local/lib/python3.6/site-packages/felicette/sat_processor.py", line 9, in <module>
    from felicette.utils.gdal_pansharpen import gdal_pansharpen
  File "/home/elmos/.local/lib/python3.6/site-packages/felicette/utils/gdal_pansharpen.py", line 35, in <module>
    from osgeo import gdal
ModuleNotFoundError: No module named 'osgeo'

I followed installation instructions and made sure I'm using python3. Also tried pip3 install -r requirements.txt. Also, tried updating pip in the virtual environment via https://bootstrap.pypa.io/get-pip.py .. same same
Any other suggestions? thanks

Docker image

Hey guys!

Is there a chance that Docker (Docker File) image can be included in this repository. I believe that I've found a bug in it and I would like to submit a patch for it.

Cheers!

Failed on partial data (I think)

Sorry for the rapid fire issues!

I wanted to preview my images, and I thought that -pre was -p, so I started a query:

$ felicette -p -c 34.6064 -70.345
✗ required data doesn't exist, downloading blue band
b2:  51%|█████████████████████████████████████████████████████████████████▎                                                             | 28.9M/56.2M [00:08<00:16, 1.73MB/s]b2:  52%|█████████████████████████████████████████████████████████████████▋                                                             | 29.1M/56.2M [00:08<00:07, 3.64MB/s]

Aborted!

When I looked at the docs and realized I wanted -pre instead of -p, I aborted the felicette task with ^c and ran it again, but this time it thought it had the full blue band and didn't download it, then failed on decoding a partial tiff:

$ felicette -pre -c 34.6064 -70.345
✗ preview data doesn't exist, downloading image
preview: 100%|█████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 162k/162k [00:00<00:00, 518kB/s]
Preview image saved at:
/Users/llimllib/felicette-data/LC81511092019265/LC81511092019265-preview.jpg
Are you sure you want to see an enhanced version of the image at the path shown above? [Y/n]
 ✓  required data exists for blue band
✗ required data doesn't exist, downloading green band
b3: 100%|███████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 57.7M/57.7M [00:23<00:00, 2.56MB/s]
✗ required data doesn't exist, downloading red band
b4: 100%|███████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 59.3M/59.3M [00:15<00:00, 4.14MB/s]
ERROR 1: TIFFFillTile:Read error at row 7168, col 7168, tile 159; got 281659 bytes, expected 310764
ERROR 1: TIFFReadEncodedTile() failed.
ERROR 1: /Users/llimllib/felicette-data/LC81511092019265/LC81511092019265-b2.tiff, band 1: IReadBlock failed at X offset 15, Y offset 8: TIFFReadEncodedTile() failed.
Traceback (most recent call last):
  File "rasterio/_io.pyx", line 695, in rasterio._io.DatasetReaderBase._read
  File "rasterio/shim_rasterioex.pxi", line 142, in rasterio._shim.io_multi_band
  File "rasterio/_err.pyx", line 182, in rasterio._err.exc_wrap_int
rasterio._err.CPLE_AppDefinedError: /Users/llimllib/felicette-data/LC81511092019265/LC81511092019265-b2.tiff, band 1: IReadBlock failed at X offset 15, Y offset 8: TIFFReadEncodedTile() failed.

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/Users/llimllib/.pyenv/versions/3.8.5/bin/felicette", line 8, in <module>
    sys.exit(main())
  File "/Users/llimllib/.pyenv/versions/3.8.5/lib/python3.8/site-packages/click/core.py", line 829, in __call__
    return self.main(*args, **kwargs)
  File "/Users/llimllib/.pyenv/versions/3.8.5/lib/python3.8/site-packages/click/core.py", line 782, in main
    rv = self.invoke(ctx)
  File "/Users/llimllib/.pyenv/versions/3.8.5/lib/python3.8/site-packages/click/core.py", line 1066, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/Users/llimllib/.pyenv/versions/3.8.5/lib/python3.8/site-packages/click/core.py", line 610, in invoke
    return callback(*args, **kwargs)
  File "/Users/llimllib/.pyenv/versions/3.8.5/lib/python3.8/site-packages/felicette/cli.py", line 76, in main
    process_landsat_data(data_id, bands)
  File "/Users/llimllib/.pyenv/versions/3.8.5/lib/python3.8/site-packages/felicette/sat_processor.py", line 153, in process_landsat_data
    process_landsat_rgb(id, bands)
  File "/Users/llimllib/.pyenv/versions/3.8.5/lib/python3.8/site-packages/felicette/sat_processor.py", line 94, in process_landsat_rgb
    b = b2.read(1)
  File "rasterio/_io.pyx", line 359, in rasterio._io.DatasetReaderBase.read
  File "rasterio/_io.pyx", line 698, in rasterio._io.DatasetReaderBase._read
rasterio.errors.RasterioIOError: Read or write failed. /Users/llimllib/felicette-data/LC81511092019265/LC81511092019265-b2.tiff, band 1: IReadBlock failed at X offset 15, Y offset 8: TIFFReadEncodedTile() failed.

I hope these issue reports are helpful and not bothersome! Thank you for putting a cool tool out into the world, I appreciate it.

edit: I would report the version but there's no felicette --version - you may want to add that!

Fails to re-download data if there was a network error

If any of the bands (blue, green or red) fails during the download, felicette doesn't re-download it. Rerunning the program again for the specific place shows the required data exists for the said band. But in reality it is an incomplete download. This throws an error

rasterio.errors.RasterioIOError: Read or write failed. /home/mithun/felicette-data/LC81430542020100/LC81430542020100-b4.tiff, band 1: IReadBlock failed at X offset 1, Y offset 6: TIFFReadEncodedTile() failed.

Current workaround is to delete the folder and run again.

felicette -l jacksonvlile

the tile LC81162052019260 seems to preview into a grey diamond. i've been able to load some other tiles correctly, but the one for north florida seems to be not rendering correctly for some reason?

IndexError on failed reverse geocodes

I live in Portland, Maine so if I search for Portland it almost always brings up Oregon. Therefore the first thing I did when downloading this was:

$ felicette -l "Portland, ME"
Traceback (most recent call last):
  File "/Users/llimllib/.pyenv/versions/3.8.5/bin/felicette", line 8, in <module>
    sys.exit(main())
  File "/Users/llimllib/.pyenv/versions/3.8.5/lib/python3.8/site-packages/click/core.py", line 829, in __call__
    return self.main(*args, **kwargs)
  File "/Users/llimllib/.pyenv/versions/3.8.5/lib/python3.8/site-packages/click/core.py", line 782, in main
    rv = self.invoke(ctx)
  File "/Users/llimllib/.pyenv/versions/3.8.5/lib/python3.8/site-packages/click/core.py", line 1066, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/Users/llimllib/.pyenv/versions/3.8.5/lib/python3.8/site-packages/click/core.py", line 610, in invoke
    return callback(*args, **kwargs)
  File "/Users/llimllib/.pyenv/versions/3.8.5/lib/python3.8/site-packages/felicette/cli.py", line 50, in main
    coordinates = geocoder_util(location_name)
  File "/Users/llimllib/.pyenv/versions/3.8.5/lib/python3.8/site-packages/felicette/utils/geo_utils.py", line 19, in geocoder_util
    return (float(r_json[0]["lon"]), float(r_json[0]["lat"]))
IndexError: list index out of range

I debugged into it a bit and nominatim returns empty results for Portland Maine and Portland, ME:

$ curl 'https://nominatim.openstreetmap.org/search?city=Portland%20Maine&format=json'
[]
$ curl 'https://nominatim.openstreetmap.org/search?city=Portland,%20ME&format=json'
[]

It would be best if the reverse geocode worked, but also totally OK for felicette to print out an understandable error if the reverse geocode failed.

Image cropping not working as intended

Hi!

Please try creating satellite imagery for Budapest - you'll see, that the actual city will be at the very left of the image, and literally only half of the city (right part from Danube, "Pest") is visible, the left part (left from Danube, "Buda") is completely cropped.

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.