Skip to content

Commit

Permalink
Fix h3 error
Browse files Browse the repository at this point in the history
  • Loading branch information
giswqs committed Oct 14, 2024
1 parent da1d579 commit 958e59a
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 12 deletions.
25 changes: 14 additions & 11 deletions docs/notebooks/92_maplibre.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -812,16 +812,19 @@
" pitch=40,\n",
" bearing=-27,\n",
")\n",
"data = create_h3_grid()\n",
"m.add_geojson(\n",
" data,\n",
" layer_type=\"fill-extrusion\",\n",
" paint={\n",
" \"fill-extrusion-color\": [\"get\", \"color\"],\n",
" \"fill-extrusion-opacity\": 0.7,\n",
" \"fill-extrusion-height\": [\"*\", 100, [\"get\", \"count\"]],\n",
" },\n",
")\n",
"try:\n",
" data = create_h3_grid()\n",
" m.add_geojson(\n",
" data,\n",
" layer_type=\"fill-extrusion\",\n",
" paint={\n",
" \"fill-extrusion-color\": [\"get\", \"color\"],\n",
" \"fill-extrusion-opacity\": 0.7,\n",
" \"fill-extrusion-height\": [\"*\", 100, [\"get\", \"count\"]],\n",
" },\n",
" )\n",
"except:\n",
" pass\n",
"m"
]
},
Expand Down Expand Up @@ -986,7 +989,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.11.9"
"version": "3.12.2"
}
},
"nbformat": 4,
Expand Down
2 changes: 1 addition & 1 deletion leafmap/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -9482,7 +9482,7 @@ def draw_tile(
gtiff.SetGeoTransform((min(xp0, xp1), pwidth, 0, max(yp0, yp1), 0, -pheight))
gtiff.SetProjection(WKT_3857)
for band in range(imgbands):
array = numpy.array(img.getdata(band), dtype="u8")
array = np.array(img.getdata(band), dtype="u8")
array = array.reshape((img.size[1], img.size[0]))
band = gtiff.GetRasterBand(band + 1)
band.WriteArray(array)
Expand Down

0 comments on commit 958e59a

Please sign in to comment.