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

Hillshade seg map #87

Merged
merged 44 commits into from
Dec 14, 2021
Merged

Hillshade seg map #87

merged 44 commits into from
Dec 14, 2021

Conversation

GwydionJon
Copy link
Collaborator

#71 GeoTiff support has been added, with hillshade and slope visualization, but geoJPEG support has not yet been added.

#64 mouse wheel no longer interacts with the map.

we can now overlay a hillshade or slope model.
does not need to convert the whole dataset to EEPSG:4326
Copy link
Member

@dokempf dokempf left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I liked the code that you wrote and mainly marked some minor stylistic nitpicks. The only major thing I see is the duplication of visualization configuration options instead of honouring the existing schema. If you prefer so, you could do this refactoring after the merge, but I would like to do it for sure.

adaptivefiltering/dataset.py Show resolved Hide resolved
doc/environment-rtd.yml Outdated Show resolved Hide resolved
test_map.ipynb Outdated Show resolved Hide resolved
adaptivefiltering/utils.py Outdated Show resolved Hide resolved
adaptivefiltering/utils.py Outdated Show resolved Hide resolved
resolution=2,
azimuth=315,
angle_altitude=45,
opacity=0.6,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This parameter list is a sort of redundant repetition of the input parameters for visualization. Instead, it would be possible to accept **kwargs and validate it against the schema defined in schema/visualization.json. The docstring could just refer to it as "accepts all parameters that DataSet.show accepts. The non-supported visualization types (Scatter, 2.5D mesh) can be excluded by throwing an error.

+ ",az:"
+ str(azimuth)
+ ",ang:"
+ str(angle_altitude)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure a string is the best option here. If you have **kwargs anyway, tuple(kwargs.items()) might do the job.

resolution = resolution

# calculate the hillshade or slope
if map_type == "Hillshade":
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Again this logic is duplicated from visualization and could be reused. Maybe the dispatch from https://github.com/ssciwr/adaptivefiltering/blob/hillshade_seg_map/adaptivefiltering/dataset.py#L114 needs to be refactored to be available from visualization.py.

adaptivefiltering/segmentation.py Outdated Show resolved Hide resolved
test_map = Map(segmentation=5)


def test_load_overlay(dataset_thingstaette, boundary_segmentation):
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is the THingstaette data set actually in the repo? I cannot find it right now (independently of our LFS problems)

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

apparently it is not, but if we decide to not use the Westport dataset, we should probably include it.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The dataset is not published under an open license, we should be looking for a replacement.

@codecov
Copy link

codecov bot commented Dec 14, 2021

Codecov Report

Merging #87 (f48bbdb) into main (192f77e) will increase coverage by 0.71%.
The diff coverage is 91.61%.

Impacted file tree graph

@@            Coverage Diff             @@
##             main      #87      +/-   ##
==========================================
+ Coverage   84.08%   84.79%   +0.71%     
==========================================
  Files          14       14              
  Lines        1181     1289     +108     
==========================================
+ Hits          993     1093     +100     
- Misses        188      196       +8     
Impacted Files Coverage Δ
adaptivefiltering/dataset.py 89.23% <ø> (ø)
adaptivefiltering/segmentation.py 93.25% <90.67%> (-2.90%) ⬇️
adaptivefiltering/utils.py 93.02% <94.11%> (+4.13%) ⬆️
adaptivefiltering/apps.py 34.48% <100.00%> (+1.37%) ⬆️
adaptivefiltering/pdal.py 93.75% <100.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 192f77e...f48bbdb. Read the comment docs.

@dokempf
Copy link
Member

dokempf commented Dec 14, 2021

Further review comments deferred to a future PR.

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.

None yet

2 participants