GithubHelp home page GithubHelp logo

pbogden / framework-map Goto Github PK

View Code? Open in Web Editor NEW
3.0 2.0 0.0 30.17 MB

How to put a satellite image on MapLibre in Observable Framework

Home Page: https://pbogden.github.io/framework-map/

Makefile 38.60% TypeScript 61.40%

framework-map's Introduction

framework-map

How to put a satellite image on MapLibre with Observable Framework

image processing

Convert from GeoTIFF to PNG using GDAL. (Note: if you installed geopandas from conda-forge, then you have gdal.) The final projection must be Web Mercator.

Our demo file is transverse Mercator

gdalinfo data/vt.tif

Convert to Web Mercator

gdalwarp -t_srs EPSG:3857 -r near data/vt.tif data/webmap.tif

Get corner coordinates in decimal degrees from "wgs84Extent" in the JSON output

gdalinfo -json data/webmap.tif

Convert to PNG

gdal_translate data/webmap.tif data/webmap.png

Observable notebook

Observable Framework

Framework has great documentation. See: getting started. The ./hello-framework directory is a barebones project that created with

yarn create @observablehq

Copy the PNG into the data directory of the Framework project. For example:

cp data/webmap.png hello-framework/docs/data

hello-framework/docs/map.md has a Framework version of the Observable notebook: Vermont.

Deploy on github pages, in this case served from ./docs

mkdir docs
touch docs/.nojekyll
cd hello-framework
yarn build
cp -r dist/* ../docs

The site is here: https://pbogden.github.io/framework-map/

See also...

Map tiles

The solution above creates a single image. This approach creates raster map tiles, which are also available on the github-pages demo. Create the tiles with:

gdal2tiles.py data/webmap.tif docs/webmap

hello-framework/docs/tiles.md has a Framework version of the observable notebook: Vermont tiles.

framework-map's People

Contributors

pbogden avatar pbnu avatar

Stargazers

Aaron Kyle Dennis avatar Aïmérou Ndiaye avatar @jaguar avatar

Watchers

 avatar  avatar

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.