Draw GridLines for 10KM space
mrkrishnan
Global Mapper User
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
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
-
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 -
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 -
Radhakrishnan, you may be interested in this forum thread: http://www.globalmapperforum.com/forums/vector-data/4449-drawing-grid.html
-
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 -
Thanks Mike, solved my issue
Rad, thanks, but no longer needed. -
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 -
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 -
Thanks mike. i got it.
I need one clarification.
Can i change the grid line color?
Regards
Radhakrishnan -
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 -
Thanks mike. i got the answer.
Categories
- 12.7K All Categories
- 5.6K Features Discussion
- 342 Downloading Imagery
- 1.3K Elevation Data
- 380 Georeferencing Imagery Discussion
- 628 GM Script Language
- 53 User Scripts
- 113 GPS Features
- 414 Projection Questions
- 819 Raster Data
- 1.3K Vector Data
- 6.6K Support
- 177 Announcement and News
- 908 Bug Report
- 558 SDK
- 1.2K Suggestion Box
- 3.7K Technical Support
- 562 Other Discussion
- 129 GIS Data Sources
- 27 Global Mapper Showcase
- 233 How I use Global Mapper
- 107 Global Mapper Forum Website