6

i want to add a geotiff image as base layer on openlayers :

  • copy my image.tiff in a directory and open it with openlayers directly without using a cartography server.
1

In fact you can turn the GeoTIFF files into an OpenLayers base map with the help of MapTiler software (http://www.maptiler.com/). Once the GeoTIFF file is processed with the software on your desktop - you get a directory with JPEG/PNG tiles together with a sample viewer made using OpenLayers.

Such a viewer and the folder with tiles can be uploaded to any web hosting - so there is no need to install any cartography server...

MapTiler either creates the Standard Mercator tiles - so your GeoTIFF can easily overlay Google Maps or OpenStreetMap, or it can keep the image in the original map coordinates.

If your file is a proper GeoTIFF with the geographical location and coordinate system definition embedded, then the software will load it automatically after you drag&drop it in - as in this video: https://www.youtube.com/watch?v=-rSYFwcWVnc&list=PLGHe6Moaz52PiQd1mO-S9QrCjqSn1v-ay&index=12

If you have a World file, but the coordinate system information is missing you can specify it easily: http://www.maptiler.com/how-to/coordinate-systems/

To turn an ordinary scanned maps without any location info into a map overlay see this video: http://www.maptiler.com/how-to/overlay-image-over-map/

  • It is quite nice, but is it possible to do this programmatically? How about converting hundreds of files at the same time? – F3L1X79 Nov 17 '16 at 14:01
  • 1
    Sure it is. See: maptiler.com/sdk and the manual for the command line usage: manual.maptiler.com – Klokan Technologies GmbH Nov 17 '16 at 15:01
  • In fact, we have in pre-release status a cluster version running on Amazon or Google cloud or on private clouds with Docker. This version is able to orchestrate a group of computers to render huge number of input files into a single seamless map (such as a detailed aerial photo of whole Texas or a stream of imagery from satellites - as done for our customers). – Klokan Technologies GmbH Nov 17 '16 at 15:04
4

Unfortunately you cannot do this.

You can only display those images using OpenLayers which are spported by browsers. That is why using OpenLayers.Layer.Image you can only display JPEG, PNG & GIF images.

Other Image formats like Erdas Imagine, Tiff, GeoTiff ASCII etc need to be converted to a format which browsers understand, before they can be shown in the browser.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.