Global Mapper v25.0

Question, How to draw circle?

gugupo
gugupo Global Mapper UserTrusted User
edited April 2014 in SDK
GlobalMapper to draw cirle.

Image8.jpgaaa.jpg

How to draw circle for GlobalMapperSDK function?

Comments

  • global_mapper
    global_mapper Administrator
    edited November 2012
    In the SDK you would build the list of points for the outer boundary of the circle and create the new area or line feature using GM_AddAreaToVectorLayer or GM_AddLineToVectorLayer. If you want to create a range ring, you could use GM_CalcProjectedLocation to get a point some distance (i.e. the ring radius) from the center point in a particular bearing, then just do different bearings around the circle until you build up a complete point list, then add that as a feature.

    Let me know if I can be of further assistance.

    Thanks,

    Mike
    Global Mapper Guru
    gmsupport@bluemarblegeo.com
    http://www.globalmapper.com
  • ltl9999
    ltl9999 Global Mapper User Trusted User
    edited April 2014
    It doesn't work for me if the bearing is not incremented by 1. I have to do a loop from 0 to 360 for the bearing. And then, i calculated the distance. But it is not the number as the input i created
  • global_mapper
    global_mapper Administrator
    edited April 2014
    You would need to calculate the projected point on the ring edge at a bunch of different bearings, with 1 degree being a good increment. The distance is projected along the ellipsoidal surface of the earth by default, so the great circle distance should match what you specified. Are you not seeing that distance match up (i.e. what is returned by GM_CalcDistance?)?

    Thanks,

    Mike
    Global Mapper Guru
    geohelp@bluemarblegeo.com
    Blue Marble Geographics for Coordinate Conversion, Image Reprojection and Vector Translation