Register  |  Login
ThinkGeo - GPS Tracking and Mapping Solutions  |  Home  |  Cygnus Track  |   Code Community

Discussion Forums

The online community for users of Map Suite GIS components

WorldData center ends up as upper left point of extent in image layer
Last Post 07-06-2009 12:22 PM by Ryan. 3 Replies.
Printer Friendly
Sort:
PrevPrev NextNext
You are not authorized to post a reply.
Author Messages
GregoryUser is Offline
Level 4
Level 4
Posts:176

--
06-30-2009 06:58 PM

I am adding an imagelayer to a map with a WorldData structure that specifies a target lat/long in the center:

WorldData worldData = SketchHelper.ConvertWorldCoordinates(CurrentSketchModel.BaseImage.WorldData);
ImageLayer imageLayer = new ImageLayer(imageFileName, worldData);

this returns the following in the Visual Studio immediate window:

CenterX: -80.14044
CenterY: 26.95556
ColumnRotation: 0.0
RowRotation: 0.0
SizeX: 0.000001025641025645923
SizeY: -0.000001025641025645923

However, the imagelayer's extent is as follows:

? imageLayer.Extent.Centroid
    X: -80.139941025641008
    Y: 26.955249743589739

and the imagelayer's upper left point is as follows:

? imageLayer.Extent.UpperLeftPoint
    X: -80.1404405128205
    Y: 26.955560512820512

In other words, what should be the centroid is ending up as the upper left corner of the extent.

How do I fix this?

RyanUser is Offline
ThinkGeo Support
MVP
MVP
Posts:284
Avatar

--
07-01-2009 02:43 PM

Gregory,

If you look carefully in the Desktop 2.0 API Documentation you will see that CenterX and CenterY are the center of the upper left pixel, which is why you are seeing the imageLayer.Extent.UpperLeftPoint set to the coordinate for CenterX and CenterY.

GregoryUser is Offline
Level 4
Level 4
Posts:176

--
07-01-2009 05:46 PM
You're definitely spot on, Ryan - thanks for the clarification. I've already adjusted my code to allow for the center/upper-left discrepancy (self-inflicted, I must admit) and now I have backup as to why I made the change...
RyanUser is Offline
ThinkGeo Support
MVP
MVP
Posts:284
Avatar

--
07-06-2009 12:22 PM
Glad to be of assistance!
You are not authorized to post a reply.

Active Forums 4.1