Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. creating own gps map in vc++

creating own gps map in vc++

Scheduled Pinned Locked Moved C / C++ / MFC
c++help
44 Posts 5 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • G Offline
    G Offline
    gpsmercato
    wrote on last edited by
    #1

    HI,,, i got a garmin 18x usb device and using the sdk I am able to get the gps data lat/lon. now i want to plot this gps data on to my own gps map i dont have any gps map, so is it possible to create so that i can plot the data in it.from some tutorials i got the codes for plotting it in google map which i did already. i just want to make it work on my own map of my town..plz help.

    C C 2 Replies Last reply
    0
    • G gpsmercato

      HI,,, i got a garmin 18x usb device and using the sdk I am able to get the gps data lat/lon. now i want to plot this gps data on to my own gps map i dont have any gps map, so is it possible to create so that i can plot the data in it.from some tutorials i got the codes for plotting it in google map which i did already. i just want to make it work on my own map of my town..plz help.

      C Offline
      C Offline
      chirag_chauhan
      wrote on last edited by
      #2

      Are you having maps in form for pure images(JPG, BMP)? There are some formulas available on NET to convert lat/long to x/y co-ordinates on basis of width/height & lat/long of ((0,0), (width, height) of map. Here is the link: http://www.actionscript.org/forums/showthread.php3?t=164956[^]

      1 Reply Last reply
      0
      • G gpsmercato

        HI,,, i got a garmin 18x usb device and using the sdk I am able to get the gps data lat/lon. now i want to plot this gps data on to my own gps map i dont have any gps map, so is it possible to create so that i can plot the data in it.from some tutorials i got the codes for plotting it in google map which i did already. i just want to make it work on my own map of my town..plz help.

        C Offline
        C Offline
        chandu004
        wrote on last edited by
        #3

        sure you can do that. but answer these. 1.is your town visible on googleearth? 2.are you using visual c++?. 3.if yes, are you aware of device context and drawing routines? like moveto and line to. if you can answer these, then i can help you out how to achieve your task. FYI: i have worked on the same.

        -------------------------------------------- Suggestion to the members: Please prefix your main thread subject with [SOLVED] if it is solved. thanks. chandu.

        modified on Friday, June 19, 2009 2:58 AM

        G 1 Reply Last reply
        0
        • C chandu004

          sure you can do that. but answer these. 1.is your town visible on googleearth? 2.are you using visual c++?. 3.if yes, are you aware of device context and drawing routines? like moveto and line to. if you can answer these, then i can help you out how to achieve your task. FYI: i have worked on the same.

          -------------------------------------------- Suggestion to the members: Please prefix your main thread subject with [SOLVED] if it is solved. thanks. chandu.

          modified on Friday, June 19, 2009 2:58 AM

          G Offline
          G Offline
          gpsmercato
          wrote on last edited by
          #4

          thankyou for your response... the answers 1. yes my town is visible in googleearth 2.yes i am suing vc++ 3. yes i am aware of these stuff but didnt worked on it, but i am sure i can work on it with your help.. thank you once again...

          C 1 Reply Last reply
          0
          • G gpsmercato

            thankyou for your response... the answers 1. yes my town is visible in googleearth 2.yes i am suing vc++ 3. yes i am aware of these stuff but didnt worked on it, but i am sure i can work on it with your help.. thank you once again...

            C Offline
            C Offline
            chandu004
            wrote on last edited by
            #5

            cool, now take a sample of longitude and latitude. for example, 78d32m24.88s 17d33m24.21s now convert these into intregers like 78*60*60*100+32*60*100+24*100+21 -------------------- on the other side, now your aim is to draw your town map on your screen right? now you should try to get the digital data related to your town. this can be obtained in several ways. we will decide which would be easier for you at your circumstances. first go to google earth and note the longitude and latitudes of the bounding rectangle of your town. ootherwise you assume them approximately. let me know them and we shall proceed further if any doubt in what i tried to explain, please be comfortable. ans also let me know how much time you have with you. i mean dead line?

            -------------------------------------------- Suggestion to the members: Please prefix your main thread subject with [SOLVED] if it is solved. thanks. chandu.

            G 1 Reply Last reply
            0
            • C chandu004

              cool, now take a sample of longitude and latitude. for example, 78d32m24.88s 17d33m24.21s now convert these into intregers like 78*60*60*100+32*60*100+24*100+21 -------------------- on the other side, now your aim is to draw your town map on your screen right? now you should try to get the digital data related to your town. this can be obtained in several ways. we will decide which would be easier for you at your circumstances. first go to google earth and note the longitude and latitudes of the bounding rectangle of your town. ootherwise you assume them approximately. let me know them and we shall proceed further if any doubt in what i tried to explain, please be comfortable. ans also let me know how much time you have with you. i mean dead line?

              -------------------------------------------- Suggestion to the members: Please prefix your main thread subject with [SOLVED] if it is solved. thanks. chandu.

              G Offline
              G Offline
              gpsmercato
              wrote on last edited by
              #6

              ok hope u had a great lunch... here is my latitude and longitude from google earth. 25d16min16.10secN and 55d18mi26.95secE so when i convert it into integers 25*60*60*100+16*60+100+16*100+10= 9097610 55*60*60*100+18*60*100+26*100+95= 19910695 my deadline is on july second week.

              C 1 Reply Last reply
              0
              • G gpsmercato

                ok hope u had a great lunch... here is my latitude and longitude from google earth. 25d16min16.10secN and 55d18mi26.95secE so when i convert it into integers 25*60*60*100+16*60+100+16*100+10= 9097610 55*60*60*100+18*60*100+26*100+95= 19910695 my deadline is on july second week.

                C Offline
                C Offline
                chandu004
                wrote on last edited by
                #7

                fine then. could u not find the bounding rectangle of your town. to find it, just draw a virtual rectangle around ur town in GE (ggl erth) take the longi and lati of the top left corner of the rect and bottom right corner of the rect. parallelly, experiment drawing a rectangle(0,0,700,700) on your screen and lines 0,0 to 100,100 to 100,150 to 150,200. if you are stuck up, let me know i shall help u.

                gpsmercato wrote:

                my deadline is on july second week.

                far more than sufficient.

                G 1 Reply Last reply
                0
                • C chandu004

                  fine then. could u not find the bounding rectangle of your town. to find it, just draw a virtual rectangle around ur town in GE (ggl erth) take the longi and lati of the top left corner of the rect and bottom right corner of the rect. parallelly, experiment drawing a rectangle(0,0,700,700) on your screen and lines 0,0 to 100,100 to 100,150 to 150,200. if you are stuck up, let me know i shall help u.

                  gpsmercato wrote:

                  my deadline is on july second week.

                  far more than sufficient.

                  G Offline
                  G Offline
                  gpsmercato
                  wrote on last edited by
                  #8

                  [Message Deleted]

                  C 1 Reply Last reply
                  0
                  • G gpsmercato

                    [Message Deleted]

                    C Offline
                    C Offline
                    chandu004
                    wrote on last edited by
                    #9

                    did it take 1 hr 25 mins for you to create a rectangle ? :-D donot take such bigger rectangles. ;P take one that you can see on ur screen ;) or areu trying to paint it on the ground around ur town? :^) have a sumptuous lunch. i will have a nap till then.

                    -------------------------------------------- Suggestion to the members: Please prefix your main thread subject with [SOLVED] if it is solved. thanks. chandu.

                    G 1 Reply Last reply
                    0
                    • C chandu004

                      did it take 1 hr 25 mins for you to create a rectangle ? :-D donot take such bigger rectangles. ;P take one that you can see on ur screen ;) or areu trying to paint it on the ground around ur town? :^) have a sumptuous lunch. i will have a nap till then.

                      -------------------------------------------- Suggestion to the members: Please prefix your main thread subject with [SOLVED] if it is solved. thanks. chandu.

                      G Offline
                      G Offline
                      gpsmercato
                      wrote on last edited by
                      #10

                      :^) well ...ya it took long time..actually i went for friday prayer in between...... ok so rectangle with the lines done. in GE the values are 25d17m28.90sc & 55d18m31.07sec 25d11m32.57sec & 55d24m17.68sec

                      C 1 Reply Last reply
                      0
                      • G gpsmercato

                        :^) well ...ya it took long time..actually i went for friday prayer in between...... ok so rectangle with the lines done. in GE the values are 25d17m28.90sc & 55d18m31.07sec 25d11m32.57sec & 55d24m17.68sec

                        C Offline
                        C Offline
                        chandu004
                        wrote on last edited by
                        #11

                        can you convert these into integers for me please. make it quick. 25d17m28.90sc & 55d18m31.07sec 25d11m32.57sec & 55d24m17.68sec

                        -------------------------------------------- Suggestion to the members: Please prefix your main thread subject with [SOLVED] if it is solved. thanks. chandu.

                        G 1 Reply Last reply
                        0
                        • C chandu004

                          can you convert these into integers for me please. make it quick. 25d17m28.90sc & 55d18m31.07sec 25d11m32.57sec & 55d24m17.68sec

                          -------------------------------------------- Suggestion to the members: Please prefix your main thread subject with [SOLVED] if it is solved. thanks. chandu.

                          G Offline
                          G Offline
                          gpsmercato
                          wrote on last edited by
                          #12

                          9104890 and 19911100.7 9069257 and 19945768

                          C 1 Reply Last reply
                          0
                          • G gpsmercato

                            9104890 and 19911100.7 9069257 and 19945768

                            C Offline
                            C Offline
                            chandu004
                            wrote on last edited by
                            #13

                            plz verify them that .7 is not supposed to come. and also write a function which will convert ge format to int(pix) format.

                            -------------------------------------------- Suggestion to the members: Please prefix your main thread subject with [SOLVED] if it is solved. thanks. chandu.

                            G 1 Reply Last reply
                            0
                            • C chandu004

                              plz verify them that .7 is not supposed to come. and also write a function which will convert ge format to int(pix) format.

                              -------------------------------------------- Suggestion to the members: Please prefix your main thread subject with [SOLVED] if it is solved. thanks. chandu.

                              G Offline
                              G Offline
                              gpsmercato
                              wrote on last edited by
                              #14

                              sorry the value is 19911107. function to convert ge format? u mean radian to degree format? if so then ok. done

                              G 1 Reply Last reply
                              0
                              • G gpsmercato

                                sorry the value is 19911107. function to convert ge format? u mean radian to degree format? if so then ok. done

                                G Offline
                                G Offline
                                gpsmercato
                                wrote on last edited by
                                #15

                                sorry degree to radian

                                C 2 Replies Last reply
                                0
                                • G gpsmercato

                                  sorry degree to radian

                                  C Offline
                                  C Offline
                                  chandu004
                                  wrote on last edited by
                                  #16

                                  no man, some function like int ConvertGratitoPix(int d,int m,int s,int sf) { return d*60*60*100+m*60*100+s*100+sf; } here graticule in general means latitude and/or longitude. pix refers to an integer.

                                  -------------------------------------------- Suggestion to the members: Please prefix your main thread subject with [SOLVED] if it is solved. thanks. chandu.

                                  G 1 Reply Last reply
                                  0
                                  • C chandu004

                                    no man, some function like int ConvertGratitoPix(int d,int m,int s,int sf) { return d*60*60*100+m*60*100+s*100+sf; } here graticule in general means latitude and/or longitude. pix refers to an integer.

                                    -------------------------------------------- Suggestion to the members: Please prefix your main thread subject with [SOLVED] if it is solved. thanks. chandu.

                                    G Offline
                                    G Offline
                                    gpsmercato
                                    wrote on last edited by
                                    #17

                                    ok done

                                    1 Reply Last reply
                                    0
                                    • G gpsmercato

                                      sorry degree to radian

                                      C Offline
                                      C Offline
                                      chandu004
                                      wrote on last edited by
                                      #18

                                      so, your towns bounds are as follows. top-9104890 and left-19911107 bottom-9069257 and right-19945768 now, the width of your town is 19945768-19911107=34661 and height is 9069257-9104890 =-35633 temporarily we will ignore the - sign for height. theresult would be reversed display of the map. we will correct at the end. finally, width=34661 and height=35633 did you understand till here. if so i shall proceed further otherwise ask ur doubt. be quick.

                                      -------------------------------------------- Suggestion to the members: Please prefix your main thread subject with [SOLVED] if it is solved. thanks. chandu.

                                      G 1 Reply Last reply
                                      0
                                      • C chandu004

                                        so, your towns bounds are as follows. top-9104890 and left-19911107 bottom-9069257 and right-19945768 now, the width of your town is 19945768-19911107=34661 and height is 9069257-9104890 =-35633 temporarily we will ignore the - sign for height. theresult would be reversed display of the map. we will correct at the end. finally, width=34661 and height=35633 did you understand till here. if so i shall proceed further otherwise ask ur doubt. be quick.

                                        -------------------------------------------- Suggestion to the members: Please prefix your main thread subject with [SOLVED] if it is solved. thanks. chandu.

                                        G Offline
                                        G Offline
                                        gpsmercato
                                        wrote on last edited by
                                        #19

                                        yes

                                        C 1 Reply Last reply
                                        0
                                        • G gpsmercato

                                          yes

                                          C Offline
                                          C Offline
                                          chandu004
                                          wrote on last edited by
                                          #20

                                          good. now width=34661 and height=35633 it is evident that, if we draw the abovepattern, it will be a rectangle, not a square.for our convinience we want to make it a square. so out of width and height, which is more? obviously height. so we will subtract height-width=35633-34661 =972. means width is 972 units less than height. so if we adjust 972/2 units to the left and 972/2 units to the right of our original rectangle, then it would become a square. now, i want you to explain those caluculations for me. do it fast.

                                          -------------------------------------------- Suggestion to the members: Please prefix your main thread subject with [SOLVED] if it is solved. thanks. chandu.

                                          C G 2 Replies Last reply
                                          0
                                          Reply
                                          • Reply as topic
                                          Log in to reply
                                          • Oldest to Newest
                                          • Newest to Oldest
                                          • Most Votes


                                          • Login

                                          • Don't have an account? Register

                                          • Login or register to search.
                                          • First post
                                            Last post
                                          0
                                          • Categories
                                          • Recent
                                          • Tags
                                          • Popular
                                          • World
                                          • Users
                                          • Groups