🌍 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
Data Analysis for First Year Laboratory at Imperial College, London.

Data Analysis for First Year Laboratory at Imperial College, London. For personal reference only, and to reference in lab reports and lab books.

Martin He 0 Aug 29, 2022
Option Pricing Calculator using the Binomial Pricing Method (No Libraries Required)

Binomial Option Pricing Calculator Option Pricing Calculator using the Binomial Pricing Method (No Libraries Required) Background A derivative is a fi

sammuhrai 1 Nov 29, 2021
Finding project directories in Python (data science) projects, just like there R rprojroot and here packages

Find relative paths from a project root directory Finding project directories in Python (data science) projects, just like there R here and rprojroot

Daniel Chen 102 Nov 16, 2022
PyClustering is a Python, C++ data mining library.

pyclustering is a Python, C++ data mining library (clustering algorithm, oscillatory networks, neural networks). The library provides Python and C++ implementations (C++ pyclustering library) of each

Andrei Novikov 1k Jan 05, 2023
CleanX is an open source python library for exploring, cleaning and augmenting large datasets of X-rays, or certain other types of radiological images.

cleanX CleanX is an open source python library for exploring, cleaning and augmenting large datasets of X-rays, or certain other types of radiological

Candace Makeda Moore, MD 20 Jan 05, 2023
OpenARB is an open source program aiming to emulate a free market while encouraging players to participate in arbitrage in order to increase working capital.

Overview OpenARB is an open source program aiming to emulate a free market while encouraging players to participate in arbitrage in order to increase

Tom 3 Feb 12, 2022
BinTuner is a cost-efficient auto-tuning framework, which can deliver a near-optimal binary code that reveals much more differences than -Ox settings.

BinTuner is a cost-efficient auto-tuning framework, which can deliver a near-optimal binary code that reveals much more differences than -Ox settings. it also can assist the binary code analysis rese

BinTuner 42 Dec 16, 2022
NumPy aware dynamic Python compiler using LLVM

Numba A Just-In-Time Compiler for Numerical Functions in Python Numba is an open source, NumPy-aware optimizing compiler for Python sponsored by Anaco

Numba 8.2k Jan 07, 2023
Nobel Data Analysis

Nobel_Data_Analysis This project is for analyzing a set of data about people who have won the Nobel Prize in different fields and different countries

Mohammed Hassan El Sayed 1 Jan 24, 2022
Probabilistic Programming in Python: Bayesian Modeling and Probabilistic Machine Learning with Theano

PyMC3 is a Python package for Bayesian statistical modeling and Probabilistic Machine Learning focusing on advanced Markov chain Monte Carlo (MCMC) an

PyMC 7.2k Dec 30, 2022
PyStan, a Python interface to Stan, a platform for statistical modeling. Documentation: https://pystan.readthedocs.io

PyStan PyStan is a Python interface to Stan, a package for Bayesian inference. Stan® is a state-of-the-art platform for statistical modeling and high-

Stan 229 Dec 29, 2022
Basis Set Format Converter

Basis Set Format Converter Repository for the online tool that allows you to enter a basis set in the form of text input for a variety of Quantum Chem

Manas Sharma 3 Jun 27, 2022
For making Tagtog annotation into csv dataset

tagtog_relation_extraction for making Tagtog annotation into csv dataset How to Use On Tagtog 1. Go to Project Downloads 2. Download all documents,

hyeong 4 Dec 28, 2021
Python data processing, analysis, visualization, and data operations

Python This is a Python data processing, analysis, visualization and data operations of the source code warehouse, book ISBN: 9787115527592 Descriptio

FangWei 1 Jan 16, 2022
Visions provides an extensible suite of tools to support common data analysis operations

Visions And these visions of data types, they kept us up past the dawn. Visions provides an extensible suite of tools to support common data analysis

168 Dec 28, 2022
Investigating EV charging data

Investigating EV charging data Introduction: Got an opportunity to work with a home monitoring technology company over the last 6 months whose goal wa

Yash 2 Apr 07, 2022
MIR Cheatsheet - Survival Guidebook for MIR Researchers in the Lab

MIR Cheatsheet - Survival Guidebook for MIR Researchers in the Lab

SeungHeonDoh 3 Jul 02, 2022
A simple and efficient tool to parallelize Pandas operations on all available CPUs

Pandaral·lel Without parallelization With parallelization Installation $ pip install pandarallel [--upgrade] [--user] Requirements On Windows, Pandara

Manu NALEPA 2.8k Dec 31, 2022
Automatic earthquake catalog building workflow: EQTransformer + Siamese EQTransformer + PickNet + REAL + HypoInverse

Automatic regional-scale earthquake catalog building workflow: EQTransformer + Siamese EQTransforme

Xiao Zhuowei 9 Nov 27, 2022
BasstatPL is a package for performing different tabulations and calculations for descriptive statistics.

BasstatPL is a package for performing different tabulations and calculations for descriptive statistics. It provides: Frequency table constr

Angel Chavez 1 Oct 31, 2021