Select to view content in your preferred language

Adding a local geo-referenced image file

3035
5
10-14-2011 08:05 PM
EricDaniel
Deactivated User
So I'm not seeing any examples of doing this on the Sample SDK so I'm unsure on any direction to add a local geo-referenced image file such as a geo-jpeg.  Could anyone point me to a code sample or give me some direction on how I could do this using the Silverlight API?
0 Kudos
5 Replies
DominiqueBroux
Esri Frequent Contributor
Did you look at this sample? It's done with a video but may be an image as well.
0 Kudos
EricDaniel
Deactivated User
I did see that sample but what's different about that is the lat/log geo-referenced coordinate info was added directly in the xaml code.  With a geo-referenced image, that information is typically in a world file or the image file itself.  So the key will be passing the coordinate information within the text world file to the Xaml code I guess to position the image correctly.  I imagine that should be possible but I don't know where to start.  He additional direction would be appreciated.
0 Kudos
DanielWalton
Frequent Contributor
If you're working with a world file, it's very simple. Refer to the Wikipedia article on the world file and just set the coordinates of your polygon (represented by a picture fill symbol) with the coefficients in the world file.
0 Kudos
EricDaniel
Deactivated User
Daniel,

Thanks for the reply.  I realize the world file is giving the coordinates of the top left pixel location, and then the number in the first and fourth are giving the size of each pixel.  However, how would could I get any of the other locations besides that top left?  In the live sample given that dbroux linked to, it gives the coordinates of the bottom left and top right locations of that video image.  Maybe there is some kind of equation I could use to get coordinates of another corner?  Seems like I would need to know how many pixels there are in height and width and not sure how I can get that info without special software.  Also, looks like I need the bottom left(southwest corner) and top right (northeast corner) based on the Silverlight example.
0 Kudos
DanielWalton
Frequent Contributor
The world file specifies rotation, and you can get h and w in pixels from system.drawing.image classes.
0 Kudos