RidgeMap (Topographic) Elevation Map in Python? /u/eidrisov Python Education

Hi everyone!

I am trying to create a 3D elevation map of countries/regions and I came across this Youtube tutorial that uses the RidgeMap package.

Unfortunately, it doesn’t work for me and I have a few questions. Note: full code is pasted below.

I use Python 3.12 in VSCode.

When I run the code, nothing happens. I only get a FutureWarning, but no errors, no map.

FutureWarning: `square` is deprecated since version 0.25 and will be removed in version 0.27. Use `skimage.morphology.footprint_rectangle` instead.

is_lake = rank.gradient(img_as_ubyte(values), square(3)) < lake_flatness

Questions.

  1. Any ideas why nothing is happening ? Why am I not seeing the map despite running the exact same code?

  2. Is it possible to save elevation maps created by RidgeMap as .obj or .stl files later to import into Fusion 360 ?

  3. Is it possible to have, let’s say, all terrain drawn in one colour and all water in another colour ?

Thanks in advance for any help.

from ridge_map import RidgeMap import matplotlib.pyplot as plt mt_shasta_bbox = (-122.5,41.25, -122.0,41.5) rm = RidgeMap(mt_shasta_bbox) values = rm.get_elevation_data(num_lines=150) values = rm.preprocess(values=values, lake_flatness=0.5, water_ntile=0, vertical_ratio=900) rm.plot_map(values=values, label="Test", label_x=0.55, label_y=0.1, label_size=40, linewidth=1, line_color=plt.get_cmap("copper"), kind="elevation") 

submitted by /u/eidrisov
[link] [comments]

​r/learnpython Hi everyone! I am trying to create a 3D elevation map of countries/regions and I came across this Youtube tutorial that uses the RidgeMap package. Unfortunately, it doesn’t work for me and I have a few questions. Note: full code is pasted below. I use Python 3.12 in VSCode. When I run the code, nothing happens. I only get a FutureWarning, but no errors, no map. FutureWarning: `square` is deprecated since version 0.25 and will be removed in version 0.27. Use `skimage.morphology.footprint_rectangle` instead. is_lake = rank.gradient(img_as_ubyte(values), square(3)) < lake_flatness Questions. Any ideas why nothing is happening ? Why am I not seeing the map despite running the exact same code? Is it possible to save elevation maps created by RidgeMap as .obj or .stl files later to import into Fusion 360 ? Is it possible to have, let’s say, all terrain drawn in one colour and all water in another colour ? Thanks in advance for any help. from ridge_map import RidgeMap import matplotlib.pyplot as plt mt_shasta_bbox = (-122.5,41.25, -122.0,41.5) rm = RidgeMap(mt_shasta_bbox) values = rm.get_elevation_data(num_lines=150) values = rm.preprocess(values=values, lake_flatness=0.5, water_ntile=0, vertical_ratio=900) rm.plot_map(values=values, label=”Test”, label_x=0.55, label_y=0.1, label_size=40, linewidth=1, line_color=plt.get_cmap(“copper”), kind=”elevation”) submitted by /u/eidrisov [link] [comments] 

Hi everyone!

I am trying to create a 3D elevation map of countries/regions and I came across this Youtube tutorial that uses the RidgeMap package.

Unfortunately, it doesn’t work for me and I have a few questions. Note: full code is pasted below.

I use Python 3.12 in VSCode.

When I run the code, nothing happens. I only get a FutureWarning, but no errors, no map.

FutureWarning: `square` is deprecated since version 0.25 and will be removed in version 0.27. Use `skimage.morphology.footprint_rectangle` instead.

is_lake = rank.gradient(img_as_ubyte(values), square(3)) < lake_flatness

Questions.

  1. Any ideas why nothing is happening ? Why am I not seeing the map despite running the exact same code?

  2. Is it possible to save elevation maps created by RidgeMap as .obj or .stl files later to import into Fusion 360 ?

  3. Is it possible to have, let’s say, all terrain drawn in one colour and all water in another colour ?

Thanks in advance for any help.

from ridge_map import RidgeMap import matplotlib.pyplot as plt mt_shasta_bbox = (-122.5,41.25, -122.0,41.5) rm = RidgeMap(mt_shasta_bbox) values = rm.get_elevation_data(num_lines=150) values = rm.preprocess(values=values, lake_flatness=0.5, water_ntile=0, vertical_ratio=900) rm.plot_map(values=values, label="Test", label_x=0.55, label_y=0.1, label_size=40, linewidth=1, line_color=plt.get_cmap("copper"), kind="elevation") 

submitted by /u/eidrisov
[link] [comments] 

Leave a Reply

Your email address will not be published. Required fields are marked *