Loop3D / map2loop

MIT License
11 stars 10 forks source link

Fix/random colors #99

Closed AngRodrigues closed 4 months ago

AngRodrigues commented 5 months ago

Description

📝 Summary of changes (6/6/2024)

Fixes #90

Update (7/6/24)

Also fixes #93, as this bug is coming from a duplicate in the clut file for Jeerinah formation. Added fix in https://github.com/Loop3D/map2loop/pull/99/commits/4052eca85825a8ddd9d3c2f6c57c3f838ae2dd3e and test for duplicates in https://github.com/Loop3D/map2loop/pull/99/commits/354689d57cd28352693163697571483490695ec7

Type of change

How Has This Been Tested?

Please describe any tests that you ran to verify your changes. Provide branch name so we can reproduce.

from map2loop.project import Project
from map2loop.m2l_enums import Datatype
from map2loop.sampler import SamplerSpacing, SamplerDecimator

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

proj = Project( 
    geology_filename = "./source_data/geol_clip.shp",
    fault_filename = "./source_data/faults_clip.shp",
    structure_filename = "./source_data/structure_clip.shp",
    dtm_filename = './source_data/dtm_rp.tif',
    config_filename = './source_data/example.hjson',
    clut_file_legacy = True,
    working_projection = "EPSG:28350",
    bounding_box = bounding_box,
    loop_project_filename = 'lpf.loop3d',
    overwrite_loopprojectfile = True
)

proj.set_minimum_fault_length(5000.0)
proj.set_sampler(Datatype.GEOLOGY, SamplerSpacing(200.0))
proj.set_sampler(Datatype.FAULT, SamplerSpacing(200.0))
proj.set_sampler(Datatype.STRUCTURE, SamplerDecimator(1))

proj.run_all()
proj.draw_geology_map()

image

proj.stratigraphic_column.stratigraphicUnits[['name', 'colour']]

image

Checklist: