🌍 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
PATC: Introduction to Big Data Analytics. Practical Data Analytics for Solving Real World Problems

PATC: Introduction to Big Data Analytics. Practical Data Analytics for Solving Real World Problems

1 Feb 07, 2022
Stochastic Gradient Trees implementation in Python

Stochastic Gradient Trees - Python Stochastic Gradient Trees1 by Henry Gouk, Bernhard Pfahringer, and Eibe Frank implementation in Python. Based on th

John Koumentis 2 Nov 18, 2022
Renato 214 Jan 02, 2023
Office365 (Microsoft365) audit log analysis tool

Office365 (Microsoft365) audit log analysis tool The header describes it all WHY?? The first line of code was written long time before other colleague

Anatoly 1 Jul 27, 2022
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
This program analyzes a DNA sequence and outputs snippets of DNA that are likely to be protein-coding genes.

This program analyzes a DNA sequence and outputs snippets of DNA that are likely to be protein-coding genes.

1 Dec 28, 2021
Codes for the collection and predictive processing of bitcoin from the API of coinmarketcap

Codes for the collection and predictive processing of bitcoin from the API of coinmarketcap

Teo Calvo 5 Apr 26, 2022
Methylation/modified base calling separated from basecalling.

Remora Methylation/modified base calling separated from basecalling. Remora primarily provides an API to call modified bases for basecaller programs s

Oxford Nanopore Technologies 72 Jan 05, 2023
Automated Exploration Data Analysis on a financial dataset

Automated EDA on financial dataset Just a simple way to get automated Exploration Data Analysis from financial dataset (OHLCV) using Streamlit and ta.

Darío López Padial 28 Nov 27, 2022
A model checker for verifying properties in epistemic models

Epistemic Model Checker This is a model checker for verifying properties in epistemic models. The goal of the model checker is to check for Pluralisti

Thomas Träff 2 Dec 22, 2021
AWS Glue ETL Code Samples

AWS Glue ETL Code Samples This repository has samples that demonstrate various aspects of the new AWS Glue service, as well as various AWS Glue utilit

AWS Samples 1.2k Jan 03, 2023
Repositori untuk menyimpan material Long Course STMKGxHMGI tentang Geophysical Python for Seismic Data Analysis

Long Course "Geophysical Python for Seismic Data Analysis" Instruktur: Dr.rer.nat. Wiwit Suryanto, M.Si Dipersiapkan oleh: Anang Sahroni Waktu: Sesi 1

Anang Sahroni 0 Dec 04, 2021
The Dash Enterprise App Gallery "Oil & Gas Wells" example

This app is based on the Dash Enterprise App Gallery "Oil & Gas Wells" example. For more information and more apps see: Dash App Gallery See the Dash

Austin Caudill 1 Nov 08, 2021
🌍 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
Data Scientist in Simple Stock Analysis of PT Bukalapak.com Tbk for Long Term Investment

Data Scientist in Simple Stock Analysis of PT Bukalapak.com Tbk for Long Term Investment Brief explanation of PT Bukalapak.com Tbk Bukalapak was found

Najibulloh Asror 2 Feb 10, 2022
Using approximate bayesian posteriors in deep nets for active learning

Bayesian Active Learning (BaaL) BaaL is an active learning library developed at ElementAI. This repository contains techniques and reusable components

ElementAI 687 Dec 25, 2022
collect training and calibration data for gaze tracking

Collect Training and Calibration Data for Gaze Tracking This tool allows collecting gaze data necessary for personal calibration or training of eye-tr

Pascal 5 Dec 17, 2022
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
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
A multi-platform GUI for bit-based analysis, processing, and visualization

A multi-platform GUI for bit-based analysis, processing, and visualization

Mahlet 529 Dec 19, 2022