Neatline - Associating non-map images with WGS 84

Hi,

I am looking to use Neatline + Simile to curate the restoration of a large painting over the period of 2 years.

My thought is to geo-rectify a base image of the painting, then map smaller detailed images to the master using QGIS. I have this working as a concept, but I think I could use an education on how to associate a non-map image to the WGS 84 projection (preferably in a non-hack manner, as I currently have that)

The following project appears to have done this successfully:

http://neatline.dclure.org/neatline/show/declaration-of-independence

My existing implementation involves using gdal_translate to create a geotiff, then loading it into geoserver. Here is my command:

gdal_translate -a_srs EPSG:4326 -a_ullr -180 90 180 -90 before.tif after.tif

My a_ullr property is a prime suspect, as I derived it via trail-n-error. Is there a more mathematically suitable approach to determine the proper value? Or, does anyone have other approaches that I should consider?

Thanks!

Dave

Hi Dave,

Weird. have you tried decimal versions for the override? (-180.0 90.0 180.0 -90.0). Since this is essentially covering the entire globe, it may be just too "big". If you drop off the override, does it work?

Wayne

PS. These links may help:

http://scholarslab.org/geospatial-and-temporal/using-neatline-with-historical-maps-georeferencing/
http://scholarslab.org/geospatial-and-temporal/using-neatline-with-historical-maps-part-2-transparency/
http://scholarslab.org/geospatial-and-temporal/using-neatline-with-historical-maps-geoserver/

You can drop the points in arbitrary space, then set the max-zoom to focus in on the image. Also, depending on how much space the image takes up on the filesystem, you can also just set the base layer for the exhibit to an image (and skip geoeserver).

Wayne, thanks for your feedback.

When generating a geotiff using the below command, I receive the following error when adding it as a new store in geoserver.

$> gdal_translate -a_srs EPSG:4326 in.tif out.tif

Error:
Could not list layers for this store, an error occurred retrieving them: Failed to create reader from file:///mnt/data/out.tif and hints null

$> gdalinfo out.tif

Driver: GTiff/GeoTIFF
Files: out.tif
Size is 3813, 2304
Coordinate System is:
GEOGCS["WGS 84",
DATUM["WGS_1984",
SPHEROID["WGS 84",6378137,298.257223563,
AUTHORITY["EPSG","7030"]],
AUTHORITY["EPSG","6326"]],
PRIMEM["Greenwich",0],
UNIT["degree",0.0174532925199433],
AUTHORITY["EPSG","4326"]]
Metadata:
AREA_OR_POINT=Area
TIFFTAG_DATETIME=2014:11:07 14:53:32
TIFFTAG_RESOLUTIONUNIT=2 (pixels/inch)
TIFFTAG_SOFTWARE=Adobe Photoshop CS5 Windows
TIFFTAG_XRESOLUTION=300
TIFFTAG_YRESOLUTION=300
Image Structure Metadata:
INTERLEAVE=PIXEL
Corner Coordinates:
Upper Left ( 0.0, 0.0)
Lower Left ( 0.0, 2304.0)
Upper Right ( 3813.0, 0.0)
Lower Right ( 3813.0, 2304.0)
Center ( 1906.5, 1152.0)
Band 1 Block=3813x1 Type=Byte, ColorInterp=Red
Band 2 Block=3813x1 Type=Byte, ColorInterp=Green
Band 3 Block=3813x1 Type=Byte, ColorInterp=Blue

So, I'm pretty sure I know what the problem is ,in that my image doesn't have any associated coordinate data. I know how to "geo-rectify" an image/map using Qgis, but I want to retain as much perspective to the x/y/w/h of the original image as possible (ie I want to avoid any warping/stretching that could occur when plotting/matching points arbitrarily).

Can anyone comment on how they have done this? The Declaration of Independence in particular is an example that matches my use case (I think). How did they associate spatial coords to a non-map image? Is there a w/h to degrees formula that I could use and pass the generated coords to gdal_translate?

Ultimately I would like to have a rectified image of the painting that can be used as a basis for further geo-rectification of close-up, hi-res images.

I suspect David arbitrarily associated Geo coordinates to the painting keeping it out of the way of the interpretation. Nothing too fancy there, but it's what we've done on other similar projects.

Hi,

I think I've come up with an acceptable workflow for creating a geotiff of a non-map based image - specifically for use within Neatline.

1. Original Image Size (w/h)

3813 x 2304

2. Determine the desired scale.

I found using EPSG:3857 easier to work with while attempting to plot this globally, we'll later covert to EPSG:4326.
Using EPSG:3857, I then found that w/h x 1500 produced an image about the size of the US.

3. generate new w/h based on scale

5719500 x 3456000

4. Position the image so it's center point resides at 0,0 on the map (off the western coast of Africa).

This will ensure the least amount of distortion. Simply divide each dimension by 2. Depending on the height of your image, you may need to modify this and scale your w/h differently.

5. Convert image to GeoTiff

gdal_translate -of GTiff -a_srs EPSG:3857 -a_ullr -2859750 1728000 2859750 -1728000 in.tif out_3857.tif

6. Convert from 3857 to 4326

gdalwarp -s_srs EPSG:3857 -t_srs EPSG:4326 out_3857.tif out_4326.tif

7. Check your resulting file.

Its center should be at 0,0 and its coords should be in degrees. You'll notice that the newly computed w/h are different from the original. I am OK with this amount of distortion, but if anyone knows of a more precise way to accomplish this, please float it my way.

8. gdalinfo out_4326.tif

Driver: GTiff/GeoTIFF
Files: out_4326.tif
Size is 3825, 2284
Coordinate System is:
GEOGCS["WGS 84",
DATUM["WGS_1984",
SPHEROID["WGS 84",6378137,298.257223563,
AUTHORITY["EPSG","7030"]],
AUTHORITY["EPSG","6326"]],
PRIMEM["Greenwich",0],
UNIT["degree",0.0174532925199433],
AUTHORITY["EPSG","4326"]]
Origin = (-25.689571337608008,15.336401859896865)
Pixel Size = (0.013431623571063,-0.013431623571063)
Metadata:
AREA_OR_POINT=Area
Image Structure Metadata:
INTERLEAVE=PIXEL
Corner Coordinates:
Upper Left ( -25.6895713, 15.3364019) ( 25d41'22.46"W, 15d20'11.05"N)
Lower Left ( -25.6895713, -15.3414264) ( 25d41'22.46"W, 15d20'29.13"S)
Upper Right ( 25.6863888, 15.3364019) ( 25d41'11.00"E, 15d20'11.05"N)
Lower Right ( 25.6863888, -15.3414264) ( 25d41'11.00"E, 15d20'29.13"S)
Center ( -0.0015913, -0.0025123) ( 0d 0' 5.73"W, 0d 0' 9.04"S)
Band 1 Block=3825x1 Type=Byte, ColorInterp=Red
Band 2 Block=3825x1 Type=Byte, ColorInterp=Green
Band 3 Block=3825x1 Type=Byte, ColorInterp=Blue

Would you be willing to write up a tutorial for the Neatline documentation on this? I think it would be quite valuable for folks wanting to use this technique!