Draw GridLines for 10KM space

mrkrishnanmrkrishnan Global Mapper UserPosts: 29
edited May 2010 in SDK
Hai

i want to draw grid lines for every 10 kilometer space. for that i have set the following parameters and called the GM_SetProjection function as follows,

GM_Projection_t theUtmProj;
::memset( &theUtmProj, 0, sizeof theUtmProj );
theUtmProj.mProjSys = GM_PRJ_UTM;
theUtmProj.mDatum = GM_DATUM_WGS_84;
theUtmProj.mUnit = GM_PRJ_UNIT_METERS;
theUtmProj.mAttrList[0].mAttr = ZONE;
theUtmProj.mAttrList[0].mValue = 15;
theUtmProj.mNumAttrs = 1;
GM_SetProjection( &theUtmProj );


And then i called GM_DrawGridLines with grid space as 10000.0.
But once i called this function my total screen itself filled by black color.
How can i resolve this one.

Thanks in advance
Regards
Radhakrishnan

Comments

  • Hunter GeophysicsHunter Geophysics Global Mapper User Posts: 75Trusted User
    edited May 2010
    Hi,

    Are you zoomed too far out? I noticed when I open Global Mapper initially, it's set to a range of 6000km, so perhaps you are zoomed out so far that you the grid lines are too close together to be able to discern them as individual lines...

    Try zooming in and seeing if the lines move apart.

    I am new to Global Mapper and am trying to do the exact same thing, but with grid lines of only one metre. Could you please explain in detailed steps how you actually set those parameters and how you "called the GM_SetProject function"?

    I hope I have solved your issue, and hope that you can solve mine!

    Thanks.

    Dave
  • global_mapperglobal_mapper Administrator Posts: 17,238
    edited May 2010
    As David said, how large of an area do you have loaded? It's possible that your grid lines are extremely dense at 10 km spacing if you are viewing a very large area.

    David, to get 1.0 meter spaced grid lines, just pass in 1.0 for the grid line spacing and make sure that your projection is set to one with linear units of meters (like the UTM projection set above). Note that you would really need to have just a small area loaded to use such a dense grid line spacing.

    Let me know if I can be of further assistance.

    Thanks,

    Mike
    Global Mapper Support
    support@globalmapper.com
  • Hunter GeophysicsHunter Geophysics Global Mapper User Posts: 75Trusted User
    edited May 2010
    Radhakrishnan, you may be interested in this forum thread: http://www.globalmapperforum.com/forums/vector-data/4449-drawing-grid.html
  • mrkrishnanmrkrishnan Global Mapper User Posts: 29
    edited May 2010
    Hai guys,
    Thanks for your responses.

    In my application i just try to draw the grid once i loaded the map into my full screen. i didn't zoom it.

    I just wrote the above mentioned code when i click a Menu option.

    If you want i can upload my application(VC7) also.


    Regards
    Radhakrishnan
  • Hunter GeophysicsHunter Geophysics Global Mapper User Posts: 75Trusted User
    edited May 2010
    Thanks Mike, solved my issue :)

    Rad, thanks, but no longer needed.
  • mrkrishnanmrkrishnan Global Mapper User Posts: 29
    edited May 2010
    hai
    i have got the grid by set the zone as 36 instead of 15, but the loaded image looks like tilted.

    So i am herewith attached the both outputs before and after grid. Can anyone go through and let know what is the problem?


    Waiting for help.....

    Thanks in advance
    Regards
    Radhakrishnan
  • global_mapperglobal_mapper Administrator Posts: 17,238
    edited May 2010
    Where on earth does your data live? A UTM projection is tilted relative to True North unless you are directly at the center of the UTM zone, so if you have data that is orthogonal to True North I would expect a tilt. If you don't want a tilt, you can use the Mercator projection with meters for units instead, although it is very distorted at high latitudes.

    Let me know if I can be of further assistance.

    Thanks,

    Mike
    Global Mapper Support
    support@globalmapper.com
  • mrkrishnanmrkrishnan Global Mapper User Posts: 29
    edited May 2010
    Thanks mike. i got it.
    I need one clarification.
    Can i change the grid line color?


    Regards
    Radhakrishnan
  • global_mapperglobal_mapper Administrator Posts: 17,238
    edited May 2010
    Yes, use the GM_SetLineFeatureClassDrawStyle function to update the drawing style for the grid lines types (LFC_GRID_LINE, LFC_GRID_LINE_MAJOR, and LFC_GRID_LINE_MINOR) to whatever color and style that you want.

    Let me know if I can be of further assistance.

    Thanks,

    Mike
    Global Mapper Support
    support@globalmapper.com
  • mrkrishnanmrkrishnan Global Mapper User Posts: 29
    edited May 2010
    Thanks mike. i got the answer.
Sign In or Register to comment.