Python Forum

Full Version: GPS Points to map for game/simulator
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hi All,
I'm new to attempting any game development but been fooling about with pygame a bunch and seems pretty intuitive as I've got a decent programming background doing other python, c and such.
I'm looking for the best approach to take a set of gps data, essentially a csv file of lat/lon points and have them plotted in a way I can use the perspective of cameras in pygame to scroll about and zoom in/out to the map I create.
So I should have stated, I can already convert the lat/lon to x,y cartesian, so that makes the data a little more straight forward I would think for my approach.
My end goal is to have a sort of simulator for a little robot I have to wander about a property and report back position, and I could plot this on a map. I was taking baby steps to understand the movements and positioning aspects of sprites in pygame, and also plotting with matplotlib figuring I could merge the two to provide what I'm looking for. But I'm stuck on how to best get my data plotted to a "map" environment that I can simply use that information as an image or such to be a basemap of sorts. I did attempt to follow some "Basemap" tutorials but found my environment just won't load/recognize the "mpl_toolkit.basemap" on sublime text 3.

Sorry for the long and deviated path, but what is the recommended way to take my x,y coordinates and formulate a map of sorts that I can represent a robot sprite over?

Thank you for any suggestions!!
AvgPlum
I just joined this forum and I'm surprised that someone is making games in such a slow programming language.
About 3 times the difference compared to C#
From the position that you want, imagine a vertical line to the X axis, and use the values shown on the X axis to estimate the x coordinate where your line meets the X axis. Then do the same with a horizontal line to the Y axis to estimate the y coordinates.
<snipped>