Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: remove option for legacy hson files #159

Merged
merged 6 commits into from
Dec 11, 2024
Merged

Conversation

AngRodrigues
Copy link
Member

  • Prevents the use of a config file as json or hjson.
  • Included an utils function to convert from old legacy file - update_from_legacy_file
  • if the argument config_filename is used, returns ValueError.

Usage example of converter function, using in the hjson file in here:

from map2loop.project import Project
from map2loop.utils import update_from_legacy_file


bounding_box = {
    "minx": 520000,  "miny": 7490000,  "maxx": 550000,  "maxy": 7510000,   "base": -3200,   "top": 1200,
}

loop_project_filename = "local_source.loop3d"

proj = Project( 
    geology_filename = r"source_data\geol_clip_no_gaps.shp", # required
    structure_filename = r"\source_data\structure_clip.shp", #required
    dtm_filename = r"source_data\dtm_rp.tif", # required
    config_dictionary = update_from_legacy_file(filename=r"source_data\example.hjson"),
    working_projection = "EPSG:28350",
    bounding_box = bounding_box,
    loop_project_filename = loop_project_filename,
    overwrite_loopprojectfile = True, 
)

@AngRodrigues AngRodrigues added this to the v3.2 milestone Dec 3, 2024
map2loop/project.py Outdated Show resolved Hide resolved
map2loop/mapdata.py Outdated Show resolved Hide resolved
map2loop/project.py Outdated Show resolved Hide resolved
@AngRodrigues
Copy link
Member Author

A note that I will merge this into 3.2 by COB today if no review

@lachlangrose lachlangrose merged commit 809019e into v3.2 Dec 11, 2024
36 checks passed
@AngRodrigues AngRodrigues mentioned this pull request Dec 11, 2024
13 tasks
@AngRodrigues AngRodrigues deleted the feat--remove-legacy_2 branch January 5, 2025 22:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants