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

grass.jupyter: Use InteractiveMap with custom projections #4204

Draft
wants to merge 8 commits into
base: main
Choose a base branch
from

Conversation

29riyasaxena
Copy link
Contributor

Hi there,

This is a basic implementation of my understanding of using InteractiveMap with custom projections.

@github-actions github-actions bot added Python Related code is in Python libraries notebook labels Aug 21, 2024
layout = self._ipywidgets.Layout(width=f"{width}px", height=f"{height}px")
self.map = self._ipyleaflet.Map(
basemap=basemap, layout=layout, scroll_wheel_zoom=True
if crs:
Copy link
Contributor

Choose a reason for hiding this comment

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

You need to get the CRS of the current project with g.proj, use the 'srid' key to get EPSG

else:
crs_dict = crs

proj = gs.read_command("g.proj", flags="jf", srid=crs)
Copy link
Contributor

Choose a reason for hiding this comment

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

I meant g.proj -g to get the srid key from the output which contains the EPSG:

g.proj -g
name=Lambert Conformal Conic
proj=lcc
datum=nad83
a=6378137.0
es=0.006694380022900787
lat_1=36.16666666666666
lat_2=34.33333333333334
lat_0=33.75
lon_0=-79
x_0=609601.22
y_0=0
no_defs=defined
srid=EPSG:3358
unit=Meter
units=Meters
meters=1

You can use parse_command

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
libraries notebook Python Related code is in Python
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants