Take the 2-minute tour ×
Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. It's 100% free, no registration required.

I am trying to render a rectangle graphics box onto the map, given the center location of an polygonal feature and the extent dimensions (length and width) in meters. The feature has the spatial reference of its shape set to WGS84 though.

I am able to get the location of the feature (an IPoint) by taking its centroid. Is there then a straightforward way to accomplish the drawing of such a box with meter-dimensions around that point?

Looking at the API, IEnvelope seems to be what I need, but will I have issues with unit-conversions (since I need the extent dimensions to be in meters)? And how should I go about rendering the IEnvelope?

Any help is appreciated, thanks!

share|improve this question
    
This should be pretty simple given the right interfaces, but I'm not sure of the best approach. Do you want the graphic to persist or do you just want it to flash on the screen momentarily? –  blah238 Oct 9 '12 at 17:23
1  
In a geographic coordinate system, the "envelope" will actually be a polygon with curved segments. I guess IConstructGeodetic could be of help. –  Petr Krebs Oct 9 '12 at 18:42
1  
If you do not want the edges to be curved, you could construct a geodesic ellipse (IConstructGeodetic.ConstructGeodesicEllipse) around the point with the semi-major and semi-minor axes corresponding to the half of the width and length, respectively, then get an envelope of that geometry. –  Petr Krebs Oct 9 '12 at 18:50
1  
If your data frame can be rotated you might also consider the need to rotate the envelope before displaying it as a graphic. –  blah238 Oct 9 '12 at 19:48
    
Thanks @blah238 and Petr. Yes I would want the graphic to persist as an IElement, and I don't want the edges to be curved. I'll try out the Geodesic Ellipse. I am unsure about the semi-major azimuth parameter though. Any idea what this should be? –  kentoh Oct 10 '12 at 0:57

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.