Thursday, 21 January 2016

raster - Convert an arbitrary meta-data-free map image into QGIS project


My background: experienced programmer, amateur historian, complete beginner to GIS (so I'm using QGIS). I did learn to use the QGIS georeferencer tool though.


The input: suppose I have an image like this Wikipedia: File:VoyagesOfRabbanBarSauma.jpg. Assume that it's a "naked" JPG file without any geographic metadata and the author cannot provide any such information. The input image is licensed under GNU FDL, which I'm happy to release my derivative works under.



The goal: import the path shown in the Wikipedia map into QGIS so I can change the projection, superimpose elevation, add labels for physical geography, etc.


The caveat: one workaround might just be to enter the lat/long of the locations in the map into a new GIS project. I don't want to go this route because I'd like to have a record of that particular author's estimate of the geographic information.


What I've tried: I have applied the QGIS Georeferencer to the raster JPG file with a bunch of points around the continents' edges. The alignment of points in the interior of the continent are so-so.


What I'd like to know: the distortions of this particular map are pretty noticeable around the northern edge of Eurasia, and it seems like it's a pretty standard projection. It seems to me that there ought to be an algorithmic way to identify the projection and projection parameters that generated this map, and recover an accurate non-interpolation conversion between image pixels and lat/long?


I see two questions on this:



  1. Identifying Coordinate System of Shapefile when Unknown?

  2. Unknown Coordinate System on old drawing


These seem to talk about a brute-force method involving GDAL or QGIS, and to a GIS-beginner, seem somewhat labor-intensive (basically georeference and fit them to known projections) but I'm willing to try them and see if I can automate them.



The instructions on both these GIS.SE are a bit higher than my experience allows, and any hints on how exactly to do this brute-force method would be very appreciated. E.g., question 2 above shows how to use gdaltransform to convert a list of coordinates into lat/long. Are the input coordinates x-y pixel locations?



Answer



As mentioned, your example map is Plate Carree, which in QGIS is WGS84/lat lon, EPSG:4326. It georeferences nicely in QGIS using the Helmert Linear method with just two points. In my case I used one point near to the top left of the image and another point near to the bottom right of the image. The lat/lon coordinates used for georeferencing were obtained from Google Earth. Remember that when georeferencing Latitude is "y" and Longitude is "x".


Just for fun, I then loaded the georeferenced raster into QGIS and quickly traced the route, saving it as a line shapefile. I then loaded a raster image from Natural Earth and overlaid this with the route (see the attached picture for a part of the resulting map).


Natural Earth raster images are georeferenced (to EPSG:4326), beautiful and free, you can get them from here:


Natural Earth


They are ideal for use as base maps for plotting historical data.


Added later:


I know next to nothing about world-scale mapping but I did note your comments about the obvious distortion in the original WGS84 lat/lon (EPSG:4326) map. QGIS has a good set of tools for reprojecting vector and raster data so (partly for my own self-education!) I thought I'd try and find a CRS that presented the map in a more "natural" way.


The attached picture shows a clipped Natural Earth raster transformed to a custom Albers equal-area projection. The vector data on the map was transformed from WGS84 lat/lon on-the-fly. Why Albers? Well, it seemed like a reasonable thing to try. Obviously, in a finished map one would clip the vector graticule (also courtesy of Natural Earth) to the image. Even so, I think the shapes on the map are reasonably naturalistic and that the map also highlights the fact that Bar Sauma's remarkable journey was made on a globe.



The parameters for the custom CRS were as follows:


+proj=aea +lat_1=22.0 +lat_2=56.0 +lat_0=20.0 +lon_0=55.0 +x_0=0 +y_0=0 +ellps=WGS84 +units=m +no_defs

Was this a reasonable projection to use? I honestly don't know.


Nick.


enter image description here


enter image description here


No comments:

Post a Comment

arcpy - Changing output name when exporting data driven pages to JPG?

Is there a way to save the output JPG, changing the output file name to the page name, instead of page number? I mean changing the script fo...