[Xastir] Ordnance Survey (OSGB) "OS OpenMap Local"

Tom Russo russo at bogodyn.org
Tue May 1 14:46:30 PDT 2018


On Tue, May 01, 2018 at 08:19:58PM +0000, we recorded a bogon-computron collision of the <paul.g0wxt at gmail.com> flavor, containing:
> Hello, probably my first post here (have used Xastir for years so may not be).
> 
> in the UK, the national mapping authority (OSGB) has a new open-source
> map, called OS OpenMap Local, which I am attempting to use within
> Xastir 2.0.4  on Raspberry Pi.
> 
> I was using online maps which were free but now have been pulled.
> I downloaded and compiled from source, with all options included, but
> I couldn't get git version to start compiling (that's not what I'm
> posting about here).
> 
> the specific message from debug is below:
> ------
> Load maps start
> load_maps: Calling draw_map
> draw_map: Searching for map driver
> draw_map: Found map driver: tif: 3
> map_visible, rejecting: map_min_y:61199181 > SE_corner_latitude:21669765
> 	map or object is below viewport
> Load maps stop
> ------
> I can read the GDAL data from the tif file:
> 
> 
> =====
>  gdalinfo SO83SE.tif
> Driver: GTiff/GeoTIFF
> Files: SO83SE.tif
> Size is 5000, 5000
> Coordinate System is:
> PROJCS["OSGB 1936 / British National Grid",
  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
[...]
> =====
> Any Idea why I'm getting  this error?

Yes.  This is why.  Your TIFF file is georeferenced using coordinates
in the British National Grid.  Xastir has no idea what to do with that.  Xastir
only understands TIFF files in UTM projected coordinates, and geographic
coordinates (lat/lon).  Or rather, it is trying to understand the 
projected coordinate system from the geotiff file, and doing the wrong
thing with it in this case. 

Your only path forward is to change the coordinate system of the images into 
something that Xastir can deal with.  Your best choice is straight WGS84 
geographic coordinates, EPSG:4326.  The tool to use here is gdalwarp, and the 
command needed to do the work is in README.MAPS, under the heading "GeoTIFF 
files in certain projections need special processing."  That command is:

        gdalwarp -t_srs EPSG:4326 original_raster.tif usable_raster.tif

> I'd rather not have to run a script to mangle each and every tile in
> the set, as there will be hundreds

Unfortunately, there is no other choice.  Fortunately, as Jason says, 
you can do it with a script and a loop, and only need to do it once.

-- 
Tom Russo    KM5VY
Tijeras, NM  

 echo "prpv_a'rfg_cnf_har_cvcr" | sed -e 's/_/ /g' | tr [a-m][n-z] [n-z][a-m]



More information about the Xastir mailing list