A prototype COG-based tile server for sparse Mars datasets

Overview

Mars tiler

Mars Tiler is a prototype web application that serves tiles from cloud-optimized GeoTIFFs, with an emphasis on supporting planetary datasets. Many features are hard-coded for Mars data and global projections, but the core of this work should be applicable to other planetary projections (e.g., Mars polar data, the Moon, Ceres, etc.).

Dynamic tiling

This applicaion is part of a new generation of "dynamic tilers", which generates and slices mosaics on the fly from input datasets. All it needs to function are a collection of cloud-optimized GeoTIFFs, and a database of footprints to decide which datasets to include for each tile. The datasets do not need to be stored on the same server as the tiler code, opening the door to new distributed and cloud-based workflows.

This software is based on emerging software stacks for Earth observation, especially TiTiler. It can produce tiles compatible with a wide range of web GIS software. It is designed to support the Mars Lab effort towards a flexible software backbone for Mars science GIS.

Software dependencies

This project is based heavily on TiTiler and its dependenies Rasterio and Rio-Tiler. It modifies TiTiler to use a PostGIS database backend for metadata storage rather than MosaicJSON. This allows a simpler API and compatibility with other parts of a typical GIS software stack (e.g., ArcGIS, QGIS, etc.), at some expense of scalability and deployment on cloud workers.

You might also like...
Datasets with Softcatalà website content

softcatala-web-dataset This repository contains Sofcatalà web site content (articles and programs descriptions). Dataset are available in the dataset

An awesome list of AI for art and design - resources, and popular datasets and how we may apply computer vision tasks to art and design.
An awesome list of AI for art and design - resources, and popular datasets and how we may apply computer vision tasks to art and design.

Awesome AI for Art & Design An awesome list of AI for art and design - resources, and popular datasets and how we may apply computer vision tasks to a

 I³ Tracker for Essential Open Innovation Datasets
I³ Tracker for Essential Open Innovation Datasets

I³ Tracker for Essential Open Innovation Datasets This repository is set up to track, version, and contribute updates to the I³ Essential Open Innovat

Adansons Base is a data management tool that organizes metadata of unstructured data and creates and organizes datasets.

Adansons Base is a data management tool that organizes metadata of unstructured data and creates and organizes datasets. It makes dataset creation more effective and helps find essential insights from training results and improves AI performance.

Run-Your-Own Firefox Sync Server

Run-Your-Own Firefox Sync Server This is an all-in-one package for running a self-hosted Firefox Sync server. It bundles the "tokenserver" project for

YunoHost is an operating system aiming to simplify as much as possible the administration of a server.
YunoHost is an operating system aiming to simplify as much as possible the administration of a server.

YunoHost is an operating system aiming to simplify as much as possible the administration of a server. This repository corresponds to the core code, written mostly in Python and Bash.

A simple service that allows you to run commands on the server using text

Server Text A simple flask service that allows you to run commands on the server/computer over sms. Think of it as a shell where you run commands over

An open source server for Super Mario Bros. 35

SMB35 A custom server for Super Mario Bros. 35 This server is highly experimental. Do not expect it to work without flaws.

Remote execution of a simple function on the server

FunFetch Remote execution of a simple function on the server All types of Python support objects.

Comments
  • Tile reads are extremely slow even with testing datasets

    Tile reads are extremely slow even with testing datasets

    Slow tile reads

    Reading COG data always takes > 1s no matter the input dataset. At first I assumed this was just the cost of reprojecting a large raster dataset (most images used by this library are reprojected on the fly from equirectangular to web mercator). However, it seems that these slow speeds persist even when using the test fixtures bundled with this library, which are windowed and downscaled to <100kb per file. Clearly data volume or network transfer is not the issue here.

    Digging a bit, this could be related to some previous issues with GDAL reprojection encountered by rio-tiler (https://github.com/cogeotiff/rio-tiler/issues/346). Some slow speeds identified by @kylebarron, relating to network loading of data, might also be related (https://rasterio.groups.io/g/main/topic/72528118#468). It seems that there was a problem with RasterIO wheels with GDAL < 3.3 (although the problem might still exist in some reduced form).

    It's unclear how to solve this at present.

    Environment

    We are running rio-tiler v3, rasterio 1.2.10 (built as a wheel) and gdal 3.4.0.

    A subset of relevant environment variables:

    GDAL_CACHEMAX=200
    GDAL_DISABLE_READDIR_ON_OPEN=EMPTY_DIR
    GDAL_HTTP_MULTIPLEX=YES
    GDAL_HTTP_MERGE_CONSECUTIVE_RANGES=YES
    CPL_VSIL_CURL_ALLOWED_EXTENSIONS=".tif,.TIF,.tiff"
    VSI_CACHE=TRUE
    VSI_CACHE_SIZE=5000000
    GDAL_HTTP_VERSION=2
    PROJ_NETWORK=OFF
    

    Profiling

    We profiled reading each dataset as a warped VRT; roughly:

    for file in datasets:
        with rasterio.open(file) as src:
            with WarpedVRT(src, crs=MARS_MERCATOR) as vrt:
                 vrt.read(1)
    

    The results suggests that the problem might not be WarpedVRT loading. But it does seem that a long time is taken parsing projection information. Perhaps pre-loading projections can be a speedup...

             12139 function calls (11035 primitive calls) in 0.929 seconds
    
       Ordered by: cumulative time
    
       ncalls  tottime  percall  cumtime  percall filename:lineno(function)
            1    0.000    0.000    0.929    0.929 {built-in method builtins.exec}
            1    0.000    0.000    0.929    0.929 <string>:1(<module>)
            1    0.192    0.192    0.929    0.929 load-datasets:14(open_all_vrts)
            8    0.000    0.000    0.356    0.044 _collections_abc.py:760(get)
            8    0.000    0.000    0.356    0.044 crs.py:73(__getitem__)
            8    0.000    0.000    0.356    0.044 crs.py:195(data)
            8    0.000    0.000    0.356    0.044 crs.py:170(to_dict)
            8    0.000    0.000    0.355    0.044 crs.py:146(to_epsg)
            8    0.354    0.044    0.355    0.044 {method 'to_epsg' of 'rasterio._crs._CRS' objects}
            8    0.000    0.000    0.308    0.038 crs.py:283(to_string)
            8    0.000    0.000    0.305    0.038 crs.py:158(to_authority)
            8    0.305    0.038    0.305    0.038 {method 'to_authority' of 'rasterio._crs._CRS' objects}
            4    0.000    0.000    0.054    0.013 env.py:416(wrapper)
            4    0.022    0.006    0.048    0.012 __init__.py:55(open)
           12    0.000    0.000    0.025    0.002 crs.py:444(from_wkt)
           12    0.025    0.002    0.025    0.002 {rasterio._crs.from_wkt}
            4    0.009    0.002    0.010    0.003 {method 'read' of 'rasterio._warp.WarpedVRTReaderBase' objects}
            8    0.000    0.000    0.008    0.001 env.py:257(__enter__)
            8    0.000    0.000    0.007    0.001 env.py:302(defenv)
          202    0.000    0.000    0.007    0.000 __init__.py:1424(debug)
            8    0.005    0.001    0.007    0.001 {method 'start' of 'rasterio._env.GDALEnv' objects}
    
    opened by davenquinn 8
  • Projection speedups

    Projection speedups

    We have solved #2 by creating a custom fork of RasterIO (davenquinn/rasterio) that disables some key methods for projection handling that are geared towards Earth use. This results in major speedups for opening planetary datasets. We will have to see about integrating these changes (potentially alongside some other Mars-targeted changes as well) upstream.

    opened by davenquinn 0
  • Bravo

    Bravo

    😍 first let me say that this work is incredible 👏

    It seems that you had to re-write a lot of code, and I'm sorry for this, I hope we can make it simpler in the future.

    I see you are using postgres to store the Mosaic, and I wonder if you had a look at https://github.com/stac-utils/titiler-pgstac. This project is a bit different because we use STAC to store the asset within the db but it could be worth having a look. You'll also see that we don't use async code to access the db, this is because as the raster tiling part is non-async (GDAL) we didn't want to have blocking and async code mixed up. That's said I'll be curious to hear/see the performance you are getting.

    Once again 👏

    opened by vincentsarago 1
Owner
Daven Quinn
I'm a structural geologist who investigates the history of Earth and Mars. I am also building the next generation of software tools for geoscience.
Daven Quinn
Developing a python based app prototype with KivyMD framework for a competition :))

Developing a python based app prototype with KivyMD framework for a competition :))

Jay Desale 1 Jan 10, 2022
A collection of existing KGQA datasets in the form of the huggingface datasets library, aiming to provide an easy-to-use access to them.

KGQA Datasets Brief Introduction This repository is a collection of existing KGQA datasets in the form of the huggingface datasets library, aiming to

Semantic Systems research group 21 Jan 6, 2023
Prototype application for GCM bias-correction and downscaling

dodola Prototype application for GCM bias-correction and downscaling This is an unstable prototype. This is under heavy development. Features Nothing!

Climate Impact Lab 9 Dec 27, 2022
Write Streamlit apps using Notion! (Prototype)

Streamlit + Notion test app Write Streamlit apps using Notion! ☠️ IMPORTANT: This is just a little prototype I made to play with some ideas. Not meant

Thiago Teixeira 22 Sep 8, 2022
Terminal compatible with ansi-bbs. Meant to be a prototype, but published because why not.

pybbsterm: Terminal emulator for calling BBSs. Use cases (non-exhaustive) Explore terminal protocols. Connect to BBSs. Highlights Python 3.8+ code. Bu

Roc Vallès i Domènech 9 Apr 29, 2022
Architectural Patterns implementation by using notification handler module prototype

This repository covers singleton, indirection, factory, adaptor, mediator patterns in python language by using university hypothetical notification module prototype. The code is just for demonstrating the pattern implementation not modules working

Muhammad Umair 2 Jan 8, 2022
Transform a Google Drive server into a VFX pipeline ready server

Google Drive VFX Server VFX Pipeline About The Project Quick tutorial to setup a Google Drive Server for multiple machines access, and VFX Pipeline on

Valentin Beaumont 17 Jun 27, 2022
tagls is a language server based on gtags.

tagls tagls is a language server based on gtags. Why I wrote it? Almost all modern editors have great support to LSP, but language servers based on se

daquexian 31 Dec 1, 2022
an elegant datasets factory

rawbuilder an elegant datasets factory Free software: MIT license Documentation: https://rawbuilder.readthedocs.io. Features Schema oriented datasets

Mina Farag 7 Nov 12, 2022
Python: Wrangled and unpivoted gaming datasets. Tableau: created dashboards - Market Beacon and Player’s Shopping Guide.

Created two information products for GameStop. Using Python, wrangled and unpivoted datasets, and created Tableau dashboards.

Zinaida Dvoskina 2 Jan 29, 2022