I'm trying to use a Lambert 93 image overlay on top of an Open Street Map title layer.
var map = L.map('map');
L.tileLayer('http://{s}.tile.osm.org/{z}/{x}/{y}.png', { }).addTo(map);
var coords = {
x : [-0.734794,-0.418381],
y : [47.376276,47.572680]
};
var imageBounds = [[coords.y[0], coords.x[0]], [coords.y[1], coords.x[1]]];
L.imageOverlay('image.png', imageBounds, {opacity:0.8}).addTo(map);
The resulting image overlay does not match the underlying OSM map.
It seems that this is because the image.png
is in lambert 93 projection.
- Can I use a lambert 93 image overlay on top of an OSM tiles layer ?
- If not possible, can I convert my lambert 93
image.png
to be usable with OSM tiles layers using tools such asgdalwrap
?
What I tried :
1) Proj4Leaflet
I looked at the Proj4Leaflet project which enables projections and provides an imageOverlay with projection example but the projection systems seems to concern the whole map and I want lambert 93 only on the imageOverlay.
This question seems to exclude the possibility of multiple projections but as it only focuses on tiles layers I'm not sure this is relevant in my case.
2) gdalwrap
gdalwarp -s_srs EPSG:2154 -t_srs EPSG:3857 -of PNG image-lambert.png image-webmercator.png
=> Output driver `PNG' not recognised or does not support
gdalwarp -s_srs EPSG:2154 -t_srs EPSG:3857 image-lambert.png image-webmercator.tiff
Copying color table from image-lambert.png to new file. ERROR 1: Unable to compute a transformation between pixel/line and georeferenced coordinates for image-lambert.png. There is no affine transformation and no GCPs.