2

My starting point is KML file containing a PNG image, which displays correctly in Google Earth:

enter image description here

From Google Earth I choose > Save Place As > KML, which gives me the unprojected PNG file, plus the KML file telling Google Earth how to display the image. This includes the coordinates in the LatLonbox section:

<GroundOverlay>
  <drawOrder>1</drawOrder>
  <Icon>
    <href>image.png</href>
  </Icon>
  <LatLonBox>
    <north>-43.35635491009509900</north>
    <south>-43.74776058465478500</south>
    <east>172.75212961661239000</east>
    <west>172.35586651444777000</west>
  </LatLonBox>
</GroundOverlay>

The PNG file is 399px x 544px in size:

enter image description here

... so I input the coordinates manually in the ArcMap Georeferencing toolbar, specifying 0,0 for the top left of the image, and 399,-544 for the lower right of the image, matching these with the north/west and south/east coordinates from the KML file. The data frame is set to WGS84, which is apparently the CRS used by Google Earth.

The resulting geocoded image does not correctly match real-world coordinates (the image should be slightly offset as shown by the red arrow - and possibly rotated so the coastline matches):

enter image description here

The image correctly displays in Google Earth, so the coordinate reference must be correct - presumably my logic of using that bounding box with the image bounding box is flawed.

Any ideas what I'm doing wrong here? Thanks

1 Answer 1

2

Typical - after spending hours on this, I realised the answer a few minutes after posting the question to Stack Exchange. At least others can learn from my stupidity.

I needed to add a 3rd control point, in order to allow the affine transformation to apply the correct adjustment:

enter image description here

1
  • for bonus points, use the Warp command in a script to automate this: arcpy.Warp_management(inImage,"'0 0';'{0} -{1}';'{0} 0'".format(width, height),"'{0} {1}';'{2} {3}';'{2} {1}'".format(west, north, east, south),outImage,"POLYORDER1","NEAREST") Commented Apr 4, 2014 at 3:47

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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