mansueto-institute / cloudtile

Converting geospatial file formats to vectortile files
GNU General Public License v3.0
2 stars 2 forks source link

feat: expose settings #34

Closed manmartgarc closed 1 year ago

manmartgarc commented 1 year ago

Description

Adds support for passing CLI settings to tippecanoe directly via the CLI call instead of only via a static .yaml file somewhere in the local filesystem. Now the user can pass a series of settings for tippecanoe via the --tc-kwargs optional argument in the CLI.

The reason that the .yaml file approach was not working out is that when the task is run on ECS, the user doesn't have easy access to the container's file system. Since that setting is still useful when using local-only conversion, the setting still remains available via the usual --config argument. However, with the new --tc-kwargs the user can pass any tippecanoe settings and these will either add to the defaults or override them.

This is accomplished by creating a new TippecanoeSettings that centralizes a lot of the work related to passing these settings around the existing classes. Additionally, this new class can be treated as a built-in dictionary and is therefore mutable in memory. This same class processes using the config files, but additionally it provides runtime mutability.

Fixes #31

Type of change

How Has This Been Tested?

Some of the existing tests were refactored to support the new changes. New unit tests for the added code was also implemented.

Checklist

github-actions[bot] commented 1 year ago

Coverage

Coverage Report
FileStmtsMissCoverMissing
/opt/hostedtoolcache/Python/3.9.16/x64/lib/python3.9/site-packages/cloudtile
   __init__.py00100% 
   __main__.py15011225%30, 34, 40, 44, 46, 49, 51, 58–59, 66–69, 71–74, 77–79, 82–87, 89–92, 94–96, 101–103, 109–110, 114–119, 121–122, 129, 134–137, 140–149, 151–156, 175, 180–182, 186, 190, 194, 198–199, 203, 211–212, 216, 219–220, 225, 230, 239, 251, 257, 263, 272, 304, 309–310, 314, 318, 329, 332, 339, 363–368, 370–375, 382–383, 387
   converter.py630100% 
   ecs.py780100% 
   geofile.py1060100% 
   s3.py990100% 
   tippecanoe.py680100% 
TOTAL56411280% 

Tests Skipped Failures Errors Time
100 0 :zzz: 0 :x: 0 :fire: 6.743s :stopwatch: