2

I need to convert a JPEG into a Geo-referenced TIF and generate tiles from it for overlaying them on Google Maps. The JPEG is available at ftp://ftp.bom.gov.au/anon/gen/radar_transparencies/IDE00035.background.jpg. I do not the know its projection. But I came to know its four vertex coordinates to be: Upper Left ( 114.05, -7.73), Lower Left ( 105.61, -46.27), Upper Right ( 152.95, -7.8) & Lower Right ( 161.35, -46.2) from http://www.bom.gov.au/products/national_radar_sat.loop.shtml.

How do I identify the map projection in JPEG so that I generate a Geo-referenced TIF of correct project and proceed with generating tiles using gdal2tiles.py?

  • Are you going to have to warp it to web-mercator for your tiles anyway? In which case I'd use a georeferencer and feed it the corners and a bunch of known points on the Australian coast and the state boundaries, and let the georeferencer warp it to mercator. Its only 512x512 so precision won't be its strong point... – Spacedman Dec 12 '16 at 9:23
  • @MikkelLydholmRasmussen its not that because the corners have different lat-longs, and the state border lines (which are lines of longitude) are converging. It could be a conical or azimuthal projection... – Spacedman Dec 12 '16 at 9:34
  • 2
    At the bottom of this page Radar Map Features, it says The projection for the individual radar map images at 64, 128, 256 and 512 km is gnomonic. Lambert Conformal, with standard parallels of 18S and 40S, Central Meridian 134E is the projection of the National Loop Radar image. Is this the information needed? – Kazuhito Dec 12 '16 at 10:57
  • I thought of EPSG:3112, but +lat_2 is different compared with EPSG:3112 +proj=lcc +lat_1=-18 +lat_2=-36 +lat_0=0 +lon_0=134 +x_0=0 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs ...may need custom CRS? – Kazuhito Dec 12 '16 at 11:12
2

I tried georeferencing it from the corners but results were not looking good. A few things, even in the corners where accuracy should be good, were way out. So I digitised a few more control points from the raster with reference to features on OpenStreetMap and did a thin-plate spline warp to EPSG:4326.

Here's the result over Stamen Toner - note the curved edges which are the warped edges of the raster, and the slight fringing where the overlay of the raster and the OSM Australia are slightly misaligned. Its pretty close, perhaps a little more care around Tasmania might get better results:

enter image description here

I'm not sure if warping like this is a better solution for your problem than trying to work out the CRS parameters and scale of the image from the description, but might work for you.

I have just tried with the following workflow to use the Lambert conformal conic (LCC) projection given above (but with lat_2=-40):

  1. Create four points at the given corners in lat-long.
  2. Transform corners to LCC.
  3. Use transformed corners to compute World file for jpeg (pixel size, top left corner) in LCC coordinates.
  4. Load JPG into QGIS, set CRS to the LCC one, it gets its location from the World file

This raster is way off, much much more than my warped version above, especially in the north where you'd expect it to do well since the corners should be exact. I'm not convinced those corner locations are correct, since the only way I see to get them is from the web map, and that image is in projected coordinates and I don't see if the underlying javascript is doing the inverse transformation. I suspect its just being linear in the image.

  • I second. The map I obtained looked same as described by Spacedman, but the corner points provided by OP seemed accurate enough. I was scratching my head in puzzlement. – Kazuhito Dec 13 '16 at 10:43
  • The top-left corner of the original grid within my warped raster is at latitude -6.3, which is a way out from the -7.73 quoted. I reckon if I replace those corner coordinates with the corners I get from my warp and make a world file with that LCC projection we might just hit it... – Spacedman Dec 13 '16 at 12:57
  • If you don't mind, could you share your corner coordinates? – Kazuhito Dec 13 '16 at 13:01
  • Top Left: (113.580, -6.326), Top Right: (152.370, -6.326), Bottom Right: (158.250, -45.350). I think bottom left of the warped grid is outside the destination grid, annoyinglym but 3 points should be enough to transform to LCC and work out the cell size for the World file... – Spacedman Dec 13 '16 at 13:09
  • Many thanks! I am still struggling, as I cannot seem to be able to fit them easily. Part of the cause might be this fitting involves contraction in the northern&central part and expansion in the south. Currently trying helmert, will continue a little more work... – Kazuhito Dec 13 '16 at 13:34
1

enter image description here

The above was mapped under Spacedman's guidance in his follow-up comment, i.e.:

  1. Create World file from corner points produced by his warp image
  2. Project to LCC

His corner points were provided and then converted to LCC coordinates, and several attempts to find possible combinations of cell size and origin yielded a world file (.jgw) as below. (This may require more refinement, but satisfactory close enough to Spacedman's warp-raster.)

    8400.0
       0.0
       0.0
   -8400.0
-2200000.0
 -920000.0

(The image was underlain on-the-fly by QuickMapServices plugin::OSM monochrome map and rendered in overlay blending mode.)

Note1: Custom CRS +proj=lcc +lat_1=-18 +lat_2=-40 +lat_0=0 +lon_0=134 +x_0=0 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defswas used.

Note2: Origin point (-2200000, -920000) does not seem to correspond to cell center but adding half-cell value does not help fitting...

  • Teamwork! I would like to see the OP return and see if this is all good. I looked at the web page's Javascript and it seems to do a simple cosine stretch from pixels to lat-long which is probably not accurate on a conical projection. – Spacedman Dec 13 '16 at 18:23

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.