Skip to content

Map of Norway #3443

Closed Answered by mattijn
rojoaguilar24 asked this question in Q&A
Discussion options

You must be logged in to vote

Have a look to the geoshape docs here: https://altair-viz.github.io/user_guide/marks/geoshape.html

And parts of this blog on 'Engaging geovisualisations with Vega-Altair' is also useful: https://mattijn.github.io/posts/2023-03-07-talk-geopython-2023/.

Example for Norway:

import altair as alt
import pandas as pd
import geopandas as gpd

url = "https://naciscdn.org/naturalearth/110m/cultural/ne_110m_admin_0_countries.zip"
gdf = gpd.read_file(url)  # zipped shapefile
gdf = gdf[["NAME", "CONTINENT", "POP_EST", 'geometry']]

# gdf.head()
# gdf_NO = gdf[gdf.NAME == 'Norway']

extent_roi = gdf.query("NAME == 'Norway'")
xmin, ymin, xmax, ymax = extent_roi.total_bounds
# fit object should be a Geo…

Replies: 2 comments

Comment options

You must be logged in to vote
0 replies
Answer selected by rojoaguilar24
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants