๐ŸŒ 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
TE-dependent analysis (tedana) is a Python library for denoising multi-echo functional magnetic resonance imaging (fMRI) data

tedana: TE Dependent ANAlysis TE-dependent analysis (tedana) is a Python library for denoising multi-echo functional magnetic resonance imaging (fMRI)

136 Dec 22, 2022
Galvanalyser is a system for automatically storing data generated by battery cycling machines in a database

Galvanalyser is a system for automatically storing data generated by battery cycling machines in a database, using a set of "harvesters", whose job it

Battery Intelligence Lab 20 Sep 28, 2022
This repo contains a simple but effective tool made using python which can be used for quality control in statistical approach.

๐Ÿ“ˆ Statistical Quality Control ๐Ÿ“‰ This repo contains a simple but effective tool made using python which can be used for quality control in statistica

SasiVatsal 8 Oct 18, 2022
A Python adaption of Augur to prioritize cell types in perturbation analysis.

A Python adaption of Augur to prioritize cell types in perturbation analysis.

Theis Lab 2 Mar 29, 2022
PySpark bindings for H3, a hierarchical hexagonal geospatial indexing system

h3-pyspark: Uber's H3 Hexagonal Hierarchical Geospatial Indexing System in PySpark PySpark bindings for the H3 core library. For available functions,

Kevin Schaich 12 Dec 24, 2022
๐ŸŒ Create 3d-printable STLs from satellite elevation data ๐ŸŒ

mapa ๐ŸŒ Create 3d-printable STLs from satellite elevation data Installation pip install mapa Usage mapa uses numpy and numba under the hood to crunch

Fabian Gebhart 13 Dec 15, 2022
Calculate multilateral price indices in Python (with Pandas and PySpark).

IndexNumCalc Calculate multilateral price indices using the GEKS-T (CCDI), Time Product Dummy (TPD), Time Dummy Hedonic (TDH), Geary-Khamis (GK) metho

Dr. Usman Kayani 3 Apr 27, 2022
Intake is a lightweight package for finding, investigating, loading and disseminating data.

Intake: A general interface for loading data Intake is a lightweight set of tools for loading and sharing data in data science projects. Intake helps

Intake 851 Jan 01, 2023
MS in Data Science capstone project. Studying attacks on autonomous vehicles.

Surveying Attack Models for CAVs Guide to Installing CARLA and Collecting Data Our project focuses on surveying attack models for Connveced Autonomous

Isabela Caetano 1 Dec 09, 2021
Convert monolithic Jupyter notebooks into Ploomber pipelines.

Soorgeon Join our community | Newsletter | Contact us | Blog | Website | YouTube Convert monolithic Jupyter notebooks into Ploomber pipelines. soorgeo

Ploomber 65 Dec 16, 2022
This mini project showcase how to build and debug Apache Spark application using Python

Spark app can't be debugged using normal procedure. This mini project showcase how to build and debug Apache Spark application using Python programming language. There are also options to run Spark a

Denny Imanuel 1 Dec 29, 2021
Synthetic data need to preserve the statistical properties of real data in terms of their individual behavior and (inter-)dependences

Synthetic data need to preserve the statistical properties of real data in terms of their individual behavior and (inter-)dependences. Copula and functional Principle Component Analysis (fPCA) are st

32 Dec 20, 2022
Big Data & Cloud Computing for Oceanography

DS2 Class 2022, Big Data & Cloud Computing for Oceanography Home of the 2022 ISblue Big Data & Cloud Computing for Oceanography class (IMT-A, ENSTA, I

Ocean's Big Data Mining 5 Mar 19, 2022
A program that uses an API and a AI model to get info of sotcks

Stock-Market-AI-Analysis I dont mind anyone using this code but please give me credit A program that uses an API and a AI model to get info of stocks

1 Dec 17, 2021
Python package for processing UC module spectral data.

UC Module Python Package How To Install clone repo. cd UC-module pip install . How to Use uc.module.UC(measurment=str, dark=str, reference=str, heade

Nicolai Haaber Junge 1 Oct 20, 2021
A probabilistic programming language in TensorFlow. Deep generative models, variational inference.

Edward is a Python library for probabilistic modeling, inference, and criticism. It is a testbed for fast experimentation and research with probabilis

Blei Lab 4.7k Jan 09, 2023
ASTR 302: Python for Astronomy (Winter '22)

ASTR 302, Winter 2022, University of Washington: Python for Astronomy Mario Juriฤ‡ Location When: 2:30-3:50, Monday & Wednesday, Winter quarter 2022 Wh

UW ASTR 302: Python for Astronomy 4 Jan 12, 2022
cLoops2: full stack analysis tool for chromatin interactions

cLoops2: full stack analysis tool for chromatin interactions Introduction cLoops2 is an extension of our previous work, cLoops. From loop-calling base

YaqiangCao 25 Dec 14, 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
Modular analysis tools for neurophysiology data

Neuroanalysis Modular and interactive tools for analysis of neurophysiology data, with emphasis on patch-clamp electrophysiology. Functions for runnin

Allen Institute 5 Dec 22, 2021