Export Image as World File

Dec 2, 2009 at 9:45 PM

Is possible export the image to JPF or TIFF format with a world file associated to use in ArcGIS?

Coordinator
Dec 3, 2009 at 5:57 AM

nop, but be welcome to implement it ;}

Dec 11, 2009 at 12:11 AM
Edited Dec 11, 2009 at 12:16 AM

cpmo

I cobbled the following together from a couple of different sources so it may not all be perfect but should give you an idea

Hope this helps

Regards

Ewan

Imports

System.IO.Path

You would first have to select an area on the Gmap control

save the image and Open the bitmap as bitmap (mapPic)

Then get the extents

Dim

area As RectLatLng = GMap.SelectedArea

Dim picX As Integer = mapPIC.Width

Dim picY As Integer = mapPIC.Height

Dim LlonNUM As Double = area.LocationTopLeft.Lng

Dim LlatNUM As Double = area.LocationTopLeft.Lat

Dim RlonNUM As Double = area.LocationRightBottom.Lng

Dim RlatNUM As Double = area.LocationRightBottom.Lat

Then use the following

Dim xDegrees As Double = Abs(LlonNUM - RlonNUM)

Dim yDegrees As Double = 0 - Abs(lLatNUM - RlatNUM)

Dim xCal As Double = (xDegrees / picX)

Dim yCal As Double = (yDegrees / picY)

then save the world file

Dim fileName As String = GetFileNameWithoutExtension(mapLBL.Text)

Dim extension As String = GetExtension(mapLBL.Text)

Dim newExtension = "." & Mid(extension, 2, 1) & Mid(extension, 4, 1) & "w"

objWriter.WriteLine(xCal.ToString)

objWriter.WriteLine(

"0")

objWriter.WriteLine(

"0")

objWriter.WriteLine(yCal.ToString)

objWriter.WriteLine(LlonNUM.Value)

objWriter.WriteLine(lLatNUM.Value)

objWriter.Close()