python-visualization / python-visualization/folium
ImageOverlay behaviour with WG84 rasters
Chưa có ai nhận issue này.
- Ngôn ngữ chính
- Python
- Star
- 7.4k
- Fork
- 2.3k
- Merge trung bình
- 17 giờ 22 phút
- Pull request đã merge (30 ngày)
- 11
Mô tả
I have a non-expected result when using this code (the raster used is attached to this message):
raster_path = '2019-06-15.tiff'
with rasterio.open(raster_path) as src:
raster_data = src.read(1)
bounds = src.bounds
m = folium.Map(location=[(bounds.top + bounds.bottom) / 2, (bounds.left + bounds.right) / 2], zoom_start=10)
# Create an ImageOverlay
img_overlay = ImageOverlay(
image=raster_data,
bounds=[[bounds.bottom, bounds.left], [bounds.top, bounds.right]],
opacity=0.6,
interactive=False,
cross_origin=True,
zindex=1,
mercator_project=True
)
# Add the overlay to the map
img_overlay.add_to(m)
m.save('map.html')
Indeed, my result html map presents shapes that are not consistent with the same map I could have just by using QGIS.
For instance the result of this code gives this in a specific region:
while using QGIS in an EPSG:3857 projection system gives this:
My raster has natively an EPSG:4326 projection system. I suspect the issue comes from how ImageOverlay changes the projection system.
Can anyone reproduce this and explain how I could obtain the same result as in QGIS which is the correct reference for me?
Thanks,
Vivien
Hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Hướng nghiên cứu
Bắt đầu bằng cách tái hiện ví dụ TIFF được cung cấp với rasterio và folium.ImageOverlay, sau đó so sánh cách xử lý EPSG:4326 của nó với kết quả EPSG:3857 trong QGIS. Đọc cách ImageOverlay xử lý projection và bounds cùng với các kỳ vọng của Leaflet đối với image-overlay; được xem là hoàn tất khi sự khác biệt được giải thích và cách render dự kiến hoặc giới hạn của issue được ghi lại.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Đánh giá
- Công nghệ
- javascript, python
- Lĩnh vực
- data-visualization, web-dev
- Loại issue
- Lỗi
- Độ khó
- 3/5
- Thời gian dự kiến
- 1-2 ngày
- Mức độ hoạt động
- Đình trệ
- Độ rõ ràng
- Khá rõ ràng
- Mức phù hợp với người mới
- 35/100