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

Add color schemes for visualizing vector data #601

Merged
merged 5 commits into from
Nov 13, 2023
Merged

Add color schemes for visualizing vector data #601

merged 5 commits into from
Nov 13, 2023

Conversation

giswqs
Copy link
Member

@giswqs giswqs commented Nov 13, 2023

import leafmap

url = 'https://data.source.coop/giswqs/nwi/wetlands/DC_Wetlands.parquet'
gdf = leafmap.read_parquet(url, return_type='gdf', src_crs='EPSG:5070', dst_crs='EPSG:4326')

color_map =  {
        "Freshwater Forested/Shrub Wetland": (0, 136, 55),
        "Freshwater Emergent Wetland": (127, 195, 28),
        "Freshwater Pond": (104, 140, 192),
        "Estuarine and Marine Wetland": (102, 194, 165),
        "Riverine": (1, 144, 191),
        "Lake": (19, 0, 124),
        "Estuarine and Marine Deepwater": (0, 124, 136),
        "Other Freshwater Wetland": (178, 134, 86),
    }

leafmap.view_vector(gdf, color_column='WETLAND_TYPE', color_map=color_map, opacity=0.5)

image

leafmap.Legend(title="Wetland Type", legend_dict=color_map)

image

Copy link

github-actions bot commented Nov 13, 2023

@github-actions github-actions bot temporarily deployed to pull request November 13, 2023 02:59 Inactive
@github-actions github-actions bot temporarily deployed to pull request November 13, 2023 03:54 Inactive
@github-actions github-actions bot temporarily deployed to pull request November 13, 2023 04:16 Inactive
@giswqs giswqs merged commit 5dfb16b into master Nov 13, 2023
12 checks passed
@giswqs giswqs deleted the parquet branch November 13, 2023 04:25
sthagen pushed a commit to sthagen/giswqs-leafmap that referenced this pull request Jul 10, 2024
* Add color schemes for visualizing vector data

* Deprecate get_cmap function

* Update unit tests

* Fix colormap error

* Update binder hyperlink
kuzja111 pushed a commit to kuzja111/leafmap that referenced this pull request Jul 25, 2024
* Add color schemes for visualizing vector data

* Deprecate get_cmap function

* Update unit tests

* Fix colormap error

* Update binder hyperlink
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.

1 participant