🌍 Create 3d-printable STLs from satellite elevation data 🌏

Overview

mapa 🌍

Create 3d-printable STLs from satellite elevation data

Installation

pip install mapa

Usage

mapa uses numpy and numba under the hood to crunch large amounts of data in little time.

1. Using the dem2stl cli

The dem2stl cli lets you create a 3d-printable STL file based on your tiff file. You can run a demo computation to get a feeling of how the output STL will look like:

dem2stl demo

If you have your tiff file ready, you may run something like

dem2stl --input your_file.tiff --output output.stl --model-size 200 --z-offset 3.0 --z-scale 1.5

For more details on the different options, check out the docs.

2. Using the mapa interactive map

If you don't have a tiff file handy, you may simple select your favorite region using the mapa cli. Simply type

mapa

A jupyter notebook will be started with an interactive map. Follow the described steps by executing the cells to create a 3d model of whatever place you like.

3. Using mapa as python library

In case you are building your own application you can simply use mapa's functionality as a within your application by importing the modules functions.

from mapa import convert_tif_to_stl

path_to_stl = convert_tif_to_stl(...)

Refer to the docs for more details.

Documentation

docs

Comments
  • Bug: bottom surface not connected

    Bug: bottom surface not connected

    The generated model's bottom surface has two flaws:

    1. It is not connected to the side walls so those edges down there are all open. This was reported in the slicer and I verified it in an 3D-tool.
    2. It is not triangulated properly (only once into two triangles): all those edges coming down the side walls from the top relief end and are not continued further to e.g. a center vertex. This results in two massive n-gons the bottom surface is made of.

    Maybe these two issues are related?

    opened by sevenoffline 13
  • feature request: tiled area

    feature request: tiled area

    How about offering the possibility to cut the selected (square) area into (square) tiles - 3x3 & 4x4 should be sufficient. With this feature it would be possible to print a larger area in pieces that can be glued together.

    enhancement 
    opened by sevenoffline 6
  • Units

    Units

    This is probably not very important, but it would be nice to have units displayed. For example there's no unit shown on the Z-offset slider. Since this value is directly related to the resulting object's dimensions it would be nice, too to show some information about how large the resulting model will be.

    Typical use case: I want the object to be exactly 1cm thick (base height). I set that and generate the object. In my slicer I notice, the object is too large for my printer and I have to scale it down by 50%. Now my object is only 0.5cm thick. Arrrgh! Back to the website, set the offset to 2cm, re-generate, ...

    Dream-solution A: after the rectangle has been drawn, the dimensions are displayed with the possibility to scale them (with locked ratio). Dream-solution-B: a value can be entered for the largest object-dimension - if it's set to "square" that value will be used for both dimensions.

    enhancement 
    opened by sevenoffline 5
  • No update on area change

    No update on area change

    I just rectangled an area, generated and exported the stl. I then noticed, that the centered city was way off (that's another issue...) and shifted the rectangle sideways (and saved the change). I then re-generated the stl (it was much faster than the first time) and downloaded the new version - same filesize, strange. I then noticed that it was the exact same model! Conclusion: the edit-rectangle-tool does not change the generated model, it does not re-generate but takes the previous data.

    bug 
    opened by sevenoffline 3
  • feature request: display version-number in app

    feature request: display version-number in app

    Pls display the app's version number in e.g. the "About"-window. When testing it I refresh the page but I can't be sure if it's properly reloaded or if I have to flush my browser cache. Having a version number would be great to verify.

    enhancement 
    opened by sevenoffline 3
  • Z-value slider too sensitive

    Z-value slider too sensitive

    The slider to set the Z-scale is a bit too sensitive. Trying to set that value to e.g. 4 takes several attempts. How about limiting it to .1-steps or implement a kind of snap-to-integer?

    enhancement 
    opened by sevenoffline 1
  • Bump certifi from 2022.9.24 to 2022.12.7

    Bump certifi from 2022.9.24 to 2022.12.7

    Bumps certifi from 2022.9.24 to 2022.12.7.

    Commits

    Dependabot compatibility score

    Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


    Dependabot commands and options

    You can trigger Dependabot actions by commenting on this PR:

    • @dependabot rebase will rebase this PR
    • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
    • @dependabot merge will merge this PR after your CI passes on it
    • @dependabot squash and merge will squash and merge this PR after your CI passes on it
    • @dependabot cancel merge will cancel a previously requested merge and block automerging
    • @dependabot reopen will reopen this PR if it is closed
    • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
    • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
    • @dependabot use these labels will set the current labels as the default for future PRs for this repo and language
    • @dependabot use these reviewers will set the current reviewers as the default for future PRs for this repo and language
    • @dependabot use these assignees will set the current assignees as the default for future PRs for this repo and language
    • @dependabot use this milestone will set the current milestone as the default for future PRs for this repo and language

    You can disable automated security fix PRs for this repo from the Security Alerts page.

    dependencies 
    opened by dependabot[bot] 0
  • edge between 3d-surface mesh and side triangles not connected

    edge between 3d-surface mesh and side triangles not connected

    Two sides of the output STL file seem to have issues with open connection between triangles of the 3d surface mesh and the side triangles. See e.g. this screenshot:

    Screenshot 2022-03-28 at 20 12 08 bug 
    opened by fgebhart 0
  • PreView

    PreView

    The handling is a bit akward because of the different projections. If I want to have a 3x3 tiled squared model I first have to output it untiled to check if the wanted area is correct. I have to do this several times because there are two stages of "blindness": first the selected area has a different ratio on the map-screen then on the object, second the squared-mode alters the selection. When this procedure is finally done I can switch to 3x3 and output the final model. This workflow is soooo annoying! Isn't there a way to create a kind of preview? Some outlines on the screen-map to see the resulting ratio & area would be most helpful. I know about the different projections but there has to be a way to calculate this beforehand. A model-viewer to see the computed model in low-res would be great but I guess a lot of users would mistake the low-res-preview for the final model.

    enhancement 
    opened by sevenoffline 1
  • Geometry simplification

    Geometry simplification

    There are now a lot of controls to modify the output except one: the simplification-voodoo you do with that geometry. I exported a large area first and then a smaller part from that area as a second model. I noticed that the smaller area resulted in a larger file = higher resolution. That's great on one hand (great details on the small one) but bad on the other hand (lack of detail on the large one). And yes, this makes sense if the object would be printed in one piece (print resolution) but my plan is/was to export a large area and cut that into smaller parts to print (like the suggestion I made earlier) - but with the lack of detail this is pointless :(

    How about a Geometry Compression-slider to let the user decide how fine the resulting model will be created? Maybe with an estimation of polycount & file size displayed?

    enhancement 
    opened by sevenoffline 1
  • feature request: draw area from center outwards

    feature request: draw area from center outwards

    I rectangled an area and tried to do it as square as possible. I enabled "square output". On the resulting model the desired center was positioned too far to the right.

    I wonder if it's possible to draw the rectangle from the center outwards (not from corner to corner) and make that center on the map stay the center on the model.

    enhancement 
    opened by sevenoffline 1
Releases(v0.10.0)
  • v0.10.0(Dec 16, 2022)

    What's Changed

    • DEP: bump dependencies by @fgebhart in https://github.com/fgebhart/mapa/pull/62
    • DEP: bump dependencies and fix tests by @fgebhart in https://github.com/fgebhart/mapa/pull/63
    • FIX: clean traceback from notebook by @fgebhart in https://github.com/fgebhart/mapa/pull/64
    • DOC: use custom streamlit domain by @fgebhart in https://github.com/fgebhart/mapa/pull/65
    • ENH: Allow passing custom path to cache dir by @fgebhart in https://github.com/fgebhart/mapa/pull/66
    • DEP: upgrade dependencies by @fgebhart in https://github.com/fgebhart/mapa/pull/67
    • Bump certifi from 2022.9.24 to 2022.12.7 by @dependabot in https://github.com/fgebhart/mapa/pull/68
    • DEP: upgrade dependencies by @fgebhart in https://github.com/fgebhart/mapa/pull/69

    New Contributors

    • @dependabot made their first contribution in https://github.com/fgebhart/mapa/pull/68

    Full Changelog: https://github.com/fgebhart/mapa/compare/v0.9.0...v0.10.0

    Source code(tar.gz)
    Source code(zip)
  • v0.9.0(Apr 24, 2022)

    What's Changed

    • TYP: fix type hints for z_offset by @fgebhart in https://github.com/fgebhart/mapa/pull/58
    • ENH: enable option to split model into tiles, zip output stls by @fgebhart in https://github.com/fgebhart/mapa/pull/59

    Full Changelog: https://github.com/fgebhart/mapa/compare/v0.8.0...v0.9.0

    Source code(tar.gz)
    Source code(zip)
  • v0.8.0(Apr 7, 2022)

    What's Changed

    • ensure bottom is connected with side triangles in efficient way by @fgebhart in https://github.com/fgebhart/mapa/pull/53
    • DEP: upgrade dependencies (especially black) to fix failing formattin… by @fgebhart in https://github.com/fgebhart/mapa/pull/54
    • FIX: ensure normals are correctly oriented by changing order of coord… by @fgebhart in https://github.com/fgebhart/mapa/pull/55

    Full Changelog: https://github.com/fgebhart/mapa/compare/v0.7.0...v0.8.0

    Source code(tar.gz)
    Source code(zip)
  • v0.7.0(Mar 28, 2022)

    What's Changed

    • ENH: remove duplicate logging to STDOUT and drop timing decorator by @fgebhart in https://github.com/fgebhart/mapa/pull/44
    • FIX: 3d surface mesh and side mesh are closed by @fgebhart in https://github.com/fgebhart/mapa/pull/46

    Full Changelog: https://github.com/fgebhart/mapa/compare/v0.6.3...v0.7.0

    Source code(tar.gz)
    Source code(zip)
  • v0.6.3(Mar 21, 2022)

    What's Changed

    • ENH: drop rows and cols only in case input array has enough of them by @fgebhart in https://github.com/fgebhart/mapa/pull/42
    • CLN: remove treatmet for max_number_of_stac_items as it is no longer … by @fgebhart in https://github.com/fgebhart/mapa/pull/43

    Full Changelog: https://github.com/fgebhart/mapa/compare/v0.6.2...v0.6.3

    Source code(tar.gz)
    Source code(zip)
  • v0.6.2(Mar 19, 2022)

    What's Changed

    • RFC: rename temp direcoty by @fgebhart in https://github.com/fgebhart/mapa/pull/40
    • RFC: use logging instead of click.echo by @fgebhart in https://github.com/fgebhart/mapa/pull/39
    • FIX: catch index error and raise more meaningful error in case of too… by @fgebhart in https://github.com/fgebhart/mapa/pull/41

    Full Changelog: https://github.com/fgebhart/mapa/compare/v0.6.1...v0.6.2

    Source code(tar.gz)
    Source code(zip)
  • v0.6.1(Mar 17, 2022)

    What's Changed

    • CLN: remove matplotlib, refactor function from utils to stac by @fgebhart in https://github.com/fgebhart/mapa/pull/35
    • TST: mock file downloads to speed up test runtime by @fgebhart in https://github.com/fgebhart/mapa/pull/36
    • DOC: include streamlit app link to readme by @fgebhart in https://github.com/fgebhart/mapa/pull/37
    • DOC: add classifiers to pyproject.toml, bump license by @fgebhart in https://github.com/fgebhart/mapa/pull/38

    Full Changelog: https://github.com/fgebhart/mapa/compare/v0.6.0...v0.6.1

    Source code(tar.gz)
    Source code(zip)
  • v0.6.0(Mar 15, 2022)

    What's Changed

    • DOC: Update readme picture of 3d model by @fgebhart in https://github.com/fgebhart/mapa/pull/29
    • DEP: allow also greater python versions and update dependencies by @fgebhart in https://github.com/fgebhart/mapa/pull/30
    • ENH: allow passing a max number of stac items threshold by @fgebhart in https://github.com/fgebhart/mapa/pull/31
    • ENH: Enable progressbar by @fgebhart in https://github.com/fgebhart/mapa/pull/32
    • CI: enable caching of poetry dependencies by @fgebhart in https://github.com/fgebhart/mapa/pull/33
    • ENH: lower max resolution threshold to ensure smaller STL files by @fgebhart in https://github.com/fgebhart/mapa/pull/34

    Full Changelog: https://github.com/fgebhart/mapa/compare/v0.5.0...v0.6.0

    Source code(tar.gz)
    Source code(zip)
  • v0.5.0(Feb 22, 2022)

    What's Changed

    • ENH: correct handling of z_offset by taking elevation scale into account by @fgebhart in https://github.com/fgebhart/mapa/pull/25
    • TST: add test based on md5sum to detect any algo changes by @fgebhart in https://github.com/fgebhart/mapa/pull/26
    • TST: add test to cover functionality of side triangle computation by @fgebhart in https://github.com/fgebhart/mapa/pull/27
    • DEP: down-pin ipyleaflet to ensure correct behavior of editing rectan… by @fgebhart in https://github.com/fgebhart/mapa/pull/28

    Full Changelog: https://github.com/fgebhart/mapa/compare/v0.4.1...v0.5.0

    Source code(tar.gz)
    Source code(zip)
  • v0.4.1(Feb 18, 2022)

    What's Changed

    • DOC: add explanation of mapa algorithm by @fgebhart in https://github.com/fgebhart/mapa/pull/18
    • RFC: refactoring to introduce a dedicated stl.py module by @fgebhart in https://github.com/fgebhart/mapa/pull/19
    • RFC: extract helper functions to improve readability by @fgebhart in https://github.com/fgebhart/mapa/pull/20
    • FIX: rename stl to stl_file to fix circular import error in jupy… by @fgebhart in https://github.com/fgebhart/mapa/pull/21
    • ENH: add scale and remove unused layer from ipyleaflet map by @fgebhart in https://github.com/fgebhart/mapa/pull/22
    • RFC: rename geometry.py to algorithm.py by @fgebhart in https://github.com/fgebhart/mapa/pull/23
    • TST: add test for merging and clipping tiffs to desired bbox by @fgebhart in https://github.com/fgebhart/mapa/pull/24

    Full Changelog: https://github.com/fgebhart/mapa/compare/v0.4.0...v0.4.1

    Source code(tar.gz)
    Source code(zip)
  • v0.4.0(Feb 15, 2022)

    What's Changed

    • ENH: allow passing format ratio instead of make_sqaure to cover more use cases by @fgebhart in https://github.com/fgebhart/mapa/pull/14
    • FIX: avoid using exit() since it does not work in jupyter notebooks by @fgebhart in https://github.com/fgebhart/mapa/pull/15
    • DOC: show docstrings of convert_bbox_to_stl within jupyter notebook by @fgebhart in https://github.com/fgebhart/mapa/pull/16
    • DOC: enhance and update readme by @fgebhart in https://github.com/fgebhart/mapa/pull/17

    Full Changelog: https://github.com/fgebhart/mapa/compare/v0.3.0...v0.4.0

    Source code(tar.gz)
    Source code(zip)
  • v0.3.0(Feb 14, 2022)

    What's Changed

    • ENH: increase z-scale for dem2stl demo to 2.5 by @fgebhart in https://github.com/fgebhart/mapa/pull/11
    • ENH: put output STL file on z=0 instead of negative z values by @fgebhart in https://github.com/fgebhart/mapa/pull/12
    • CLN: remove performance report by @fgebhart in https://github.com/fgebhart/mapa/pull/13

    Full Changelog: https://github.com/fgebhart/mapa/compare/v0.2.2...v0.3.0

    Source code(tar.gz)
    Source code(zip)
  • v0.2.2(Feb 13, 2022)

    What's Changed

    • ENH: allow enabling/disabling caching of tiff files by @fgebhart in https://github.com/fgebhart/mapa/pull/9
    • ENH: preserve CRS from input geotiff by @fgebhart in https://github.com/fgebhart/mapa/pull/10

    Full Changelog: https://github.com/fgebhart/mapa/compare/v0.2.1...v0.2.2

    Source code(tar.gz)
    Source code(zip)
  • v0.2.1(Feb 12, 2022)

    What's Changed

    • FIX: use click.echo to fix attribute error by @fgebhart in https://github.com/fgebhart/mapa/pull/7
    • DOC: update readme, provide more info on arguments in mapa ipynb by @fgebhart in https://github.com/fgebhart/mapa/pull/8

    Full Changelog: https://github.com/fgebhart/mapa/compare/v0.2.0...v0.2.1

    Source code(tar.gz)
    Source code(zip)
  • v0.2.0(Feb 8, 2022)

    What's Changed

    • DEP: download file using urllib instead of requests by @fgebhart in https://github.com/fgebhart/mapa/pull/5
    • ENH: add another cache layer on stac item level by @fgebhart in https://github.com/fgebhart/mapa/pull/6

    Full Changelog: https://github.com/fgebhart/mapa/compare/v0.1.4...v0.2.0

    Source code(tar.gz)
    Source code(zip)
  • v0.1.4(Feb 6, 2022)

    What's Changed

    • DOC: enhace readme to provide more details and example screenshots by @fgebhart in https://github.com/fgebhart/mapa/pull/3
    • ENH: default location to store STLs to is users home by @fgebhart in https://github.com/fgebhart/mapa/pull/4

    Full Changelog: https://github.com/fgebhart/mapa/compare/v0.1.3...v0.1.4

    Source code(tar.gz)
    Source code(zip)
  • v0.1.3(Feb 6, 2022)

    What's Changed

    • DEP: upgrade dependencies by @fgebhart in https://github.com/fgebhart/mapa/pull/1
    • CLN: remove debug image helper function by @fgebhart in https://github.com/fgebhart/mapa/pull/2

    New Contributors

    • @fgebhart made their first contribution in https://github.com/fgebhart/mapa/pull/1

    Full Changelog: https://github.com/fgebhart/mapa/compare/v0.1.2...v0.1.3

    Source code(tar.gz)
    Source code(zip)
  • v0.1.2(Feb 6, 2022)

  • v0.1.1(Feb 6, 2022)

    Initial Release

    Features

    • dem2stl: convert GeoTIFF to STL file
    • mapa: select a bbox on a map and create a stl file from it
    • optimized performance using numpy and numba
    • reading data from MS Planetary Computer ALOS DEM

    Full Changelog: https://github.com/fgebhart/mapa/commits/v0.1.1

    Source code(tar.gz)
    Source code(zip)
Owner
Fabian Gebhart
Fabian Gebhart
ICLR 2022 Paper submission trend analysis

Visualize ICLR 2022 OpenReview Data

Jintang Li 75 Dec 06, 2022
Retentioneering 581 Jan 07, 2023
DefAP is a program developed to facilitate the exploration of a material's defect chemistry

DefAP is a program developed to facilitate the exploration of a material's defect chemistry. A large number of features are provided and rapid exploration is supported through the use of autoplotting

6 Oct 25, 2022
Functional tensors for probabilistic programming

Funsor Funsor is a tensor-like library for functions and distributions. See Functional tensors for probabilistic programming for a system description.

208 Dec 29, 2022
Pip install minimal-pandas-api-for-polars

Minimal Pandas API for Polars Install From PyPI: pip install minimal-pandas-api-for-polars Example Usage (see tests/test_minimal_pandas_api_for_polars

Austin Ray 6 Oct 16, 2022
Autopsy Module to analyze Registry Hives based on bookmarks provided by EricZimmerman for his tool RegistryExplorer

Autopsy Module to analyze Registry Hives based on bookmarks provided by EricZimmerman for his tool RegistryExplorer

Mohammed Hassan 13 Mar 31, 2022
MetPy is a collection of tools in Python for reading, visualizing and performing calculations with weather data.

MetPy MetPy is a collection of tools in Python for reading, visualizing and performing calculations with weather data. MetPy follows semantic versioni

Unidata 971 Dec 25, 2022
PyEmits, a python package for easy manipulation in time-series data.

PyEmits, a python package for easy manipulation in time-series data. Time-series data is very common in real life. Engineering FSI industry (Financial

Thompson 5 Sep 23, 2022
EOD Historical Data Python Library (Unofficial)

EOD Historical Data Python Library (Unofficial) https://eodhistoricaldata.com Installation python3 -m pip install eodhistoricaldata Note Demo API key

Michael Whittle 20 Dec 22, 2022
The micro-framework to create dataframes from functions.

The micro-framework to create dataframes from functions.

Stitch Fix Technology 762 Jan 07, 2023
DataPrep — The easiest way to prepare data in Python

DataPrep — The easiest way to prepare data in Python

SFU Database Group 1.5k Dec 27, 2022
Jupyter notebooks for the book "The Elements of Statistical Learning".

This repository contains Jupyter notebooks implementing the algorithms found in the book and summary of the textbook.

Madiyar 369 Dec 30, 2022
Fast, flexible and easy to use probabilistic modelling in Python.

Please consider citing the JMLR-MLOSS Manuscript if you've used pomegranate in your academic work! pomegranate is a package for building probabilistic

Jacob Schreiber 3k Jan 02, 2023
Helper tools to construct probability distributions built from expert elicited data for use in monte carlo simulations.

Elicited Helper tools to construct probability distributions built from expert elicited data for use in monte carlo simulations. Credit to Brett Hoove

Ryan McGeehan 3 Nov 04, 2022
Spectral Analysis in Python

SPECTRUM : Spectral Analysis in Python contributions: Please join https://github.com/cokelaer/spectrum contributors: https://github.com/cokelaer/spect

Thomas Cokelaer 280 Dec 16, 2022
CS50 pset9: Using flask API to create a web application to exchange stocks' shares.

C$50 Finance In this guide we want to implement a website via which users can “register”, “login” “buy” and “sell” stocks, like below: Background If y

1 Jan 24, 2022
Python scripts aim to use a Random Forest machine learning algorithm to predict the water affinity of Metal-Organic Frameworks

The following Python scripts aim to use a Random Forest machine learning algorithm to predict the water affinity of Metal-Organic Frameworks (MOFs). The training set is extracted from the Cambridge S

1 Jan 09, 2022
BAyesian Model-Building Interface (Bambi) in Python.

Bambi BAyesian Model-Building Interface in Python Overview Bambi is a high-level Bayesian model-building interface written in Python. It's built on to

861 Dec 29, 2022
Data Competition: automated systems that can detect whether people are not wearing masks or are wearing masks incorrectly

Table of contents Introduction Dataset Model & Metrics How to Run Quickstart Install Training Evaluation Detection DATA COMPETITION The COVID-19 pande

Thanh Dat Vu 1 Feb 27, 2022
PyPDC is a Python package for calculating asymptotic Partial Directed Coherence estimations for brain connectivity analysis.

Python asymptotic Partial Directed Coherence and Directed Coherence estimation package for brain connectivity analysis. Free software: MIT license Doc

Heitor Baldo 3 Nov 26, 2022