🌍 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
Create HTML profiling reports from pandas DataFrame objects

Pandas Profiling Documentation | Slack | Stack Overflow Generates profile reports from a pandas DataFrame. The pandas df.describe() function is great

null 10k Jan 1, 2023
A library to create multi-page Streamlit applications with ease.

A library to create multi-page Streamlit applications with ease.

Jackson Storm 107 Jan 4, 2023
Python Package for DataHerb: create, search, and load datasets.

The Python Package for DataHerb A DataHerb Core Service to Create and Load Datasets.

DataHerb 4 Feb 11, 2022
Retail-Sim is python package to easily create synthetic dataset of retaile store.

Retailer's Sale Data Simulation Retail-Sim is python package to easily create synthetic dataset of retaile store. Simulation Model Simulator consists

Corca AI 7 Sep 30, 2022
A tool to compare differences between dataframes and create a differences report in Excel

similarpanda A module to check for differences between pandas Dataframes, and generate a report in Excel format. This is helpful in a workplace settin

Andre Pretorius 9 Sep 15, 2022
🧪 Panel-Chemistry - exploratory data analysis and build powerful data and viz tools within the domain of Chemistry using Python and HoloViz Panel.

???? ??. The purpose of the panel-chemistry project is to make it really easy for you to do DATA ANALYSIS and build powerful DATA AND VIZ APPLICATIONS within the domain of Chemistry using using Python and HoloViz Panel.

Marc Skov Madsen 97 Dec 8, 2022
fds is a tool for Data Scientists made by DAGsHub to version control data and code at once.

Fast Data Science, AKA fds, is a CLI for Data Scientists to version control data and code at once, by conveniently wrapping git and dvc

DAGsHub 359 Dec 22, 2022
Tuplex is a parallel big data processing framework that runs data science pipelines written in Python at the speed of compiled code

Tuplex is a parallel big data processing framework that runs data science pipelines written in Python at the speed of compiled code. Tuplex has similar Python APIs to Apache Spark or Dask, but rather than invoking the Python interpreter, Tuplex generates optimized LLVM bytecode for the given pipeline and input data set.

Tuplex 791 Jan 4, 2023
A data parser for the internal syncing data format used by Fog of World.

A data parser for the internal syncing data format used by Fog of World. The parser is not designed to be a well-coded library with good performance, it is more like a demo for showing the data structure.

Zed(Zijun) Chen 40 Dec 12, 2022
Fancy data functions that will make your life as a data scientist easier.

WhiteBox Utilities Toolkit: Tools to make your life easier Fancy data functions that will make your life as a data scientist easier. Installing To ins

WhiteBox 3 Oct 3, 2022
A Big Data ETL project in PySpark on the historical NYC Taxi Rides data

Processing NYC Taxi Data using PySpark ETL pipeline Description This is an project to extract, transform, and load large amount of data from NYC Taxi

Unnikrishnan 2 Dec 12, 2021
Created covid data pipeline using PySpark and MySQL that collected data stream from API and do some processing and store it into MYSQL database.

Created covid data pipeline using PySpark and MySQL that collected data stream from API and do some processing and store it into MYSQL database.

null 2 Nov 20, 2021
Utilize data analytics skills to solve real-world business problems using Humana’s big data

Humana-Mays-2021-HealthCare-Analytics-Case-Competition- The goal of the project is to utilize data analytics skills to solve real-world business probl

Yongxian (Caroline) Lun 1 Dec 27, 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
PrimaryBid - Transform application Lifecycle Data and Design and ETL pipeline architecture for ingesting data from multiple sources to redshift

Transform application Lifecycle Data and Design and ETL pipeline architecture for ingesting data from multiple sources to redshift This project is composed of two parts: Part1 and Part2

Emmanuel Boateng Sifah 1 Jan 19, 2022
Demonstrate the breadth and depth of your data science skills by earning all of the Databricks Data Scientist credentials

Data Scientist Learning Plan Demonstrate the breadth and depth of your data science skills by earning all of the Databricks Data Scientist credentials

Trung-Duy Nguyen 27 Nov 1, 2022
PostQF is a user-friendly Postfix queue data filter which operates on data produced by postqueue -j.

PostQF Copyright © 2022 Ralph Seichter PostQF is a user-friendly Postfix queue data filter which operates on data produced by postqueue -j. See the ma

Ralph Seichter 11 Nov 24, 2022
Catalogue data - A Python Scripts to prepare catalogue data

catalogue_data Scripts to prepare catalogue data. Setup Clone this repo. Install

BigScience Workshop 3 Mar 3, 2022