python-visualization / python-visualization/folium

ImageOverlay behaviour with WG84 rasters

Abierto
#2,054 2 comentarios 1 reacción 0 asignados Ver en GitHub

Nadie ha tomado este issue todavía.

Lenguaje dominante
Python
Estrellas
7.4k
Forks
2.3k
Merge medio
17 h 22 min
PR fusionados (30 d)
11

Descripción

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:
image

while using QGIS in an EPSG:3857 projection system gives this:
image

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

2019-06-15.zip

Guía de contribución

Abrir la guía de contribución

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Línea de trabajo

Empieza reproduciendo el ejemplo TIFF proporcionado con rasterio y folium.ImageOverlay, y después compara su tratamiento de EPSG:4326 con el resultado EPSG:3857 de QGIS. Lee el comportamiento de proyección y bounds de ImageOverlay junto con las expectativas de Leaflet para image-overlay; se considera terminado cuando se explique la discrepancia y se documente la representación esperada o la limitación del issue.

Escrito por el modelo de indexación a partir del texto del issue.

Evaluación

Stack tecnológico
javascript, python
Área
data-visualization, web-dev
Tipo de issue
Error
Dificultad
3/5
Tiempo estimado
1-2 días
Estado de actividad
Estancado
Claridad
Bastante claro
Aptitud para principiantes
35/100

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.