Is geodesic rectangular possible for a option of "m.set_shape." ? #118
-
Hello again. I have a question for the options of "m.set_shape.". Currently, "m.set_shape." has no option for geodesic rectangular. Is geodesic rectangular possible for a option of "m.set_shape." ? In my field, unit of collecting data is a 1km or 2km rectangular region of the country. So I have data of which columns are (lon, lat) of the rectangular center and measurement value on the rectangular. Currently, I can only rely on "m.set_shape.geod_circles(radius)". This gives me a enough good visualization, but there is a regret that I want it to be a rectangle. |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments
-
Hey, At the moment there is no option for "geodesic rectangles"... (If I find the time I might implement it someday... feel free to come up with a pull-request if you feel up to the task!) However, the good thing is that EOmaps already provides a means of drawing rectangles whose dimensions can be defined in arbitrary projections... so you should be able to achieve what you want as follows:
To give you an example how this would work: from eomaps import Maps, MapsGrid
import numpy as np
lon, lat = np.meshgrid(np.linspace(11, 14, 10), np.linspace(46.5, 48.5, 10))
data = lon+lat
mg = MapsGrid(1, 2, crs=(4326, 31287), figsize=(8, 4))
for m in mg:
m.add_feature.preset.countries(lw=1, ec="k")
m.set_shape.rectangles(radius=10000, radius_crs=31287, n=500)
m.set_data(data, lon, lat)
m.plot_map()
m.set_shape.geod_circles(radius=10000, n=500)
m.plot_map(fc="none", ec="k", lw=0.25)
mg.subplots_adjust(top=0.85)
mg.f.suptitle("Setting shape dimensions in a selected projection.")
mg.m_0_0.ax.set_title("plot epsg=4326 (radius=10km in epsg 31287)", fontsize=8)
mg.m_0_1.ax.set_title("plot epsg=31287 (radius=10km in epsg 31287)", fontsize=8)
mg.m_0_1.add_logo() |
Beta Was this translation helpful? Give feedback.
-
Thank you for answer! The unit of radius in parameters of rectangles is set to be meter like geod_circles if radius_crs=31287? |
Beta Was this translation helpful? Give feedback.
-
epsg 31287 is a projection specific for austria... you'd have to find one that suits your data! |
Beta Was this translation helpful? Give feedback.
Hey,
thanks I wish for its prosperity too... make sure to spread the word 😄!
At the moment there is no option for "geodesic rectangles"... (If I find the time I might implement it someday... feel free to come up with a pull-request if you feel up to the task!)
However, the good thing is that EOmaps already provides a means of drawing rectangles whose dimensions can be defined in arbitrary projections... so you should be able to achieve what you want as follows:
m.set_shape.rectangles(radius=..., radius_crs=...)
to draw re-projected rectangles defined in theradius_crs
projection