We closed this forum 18 June 2010. It has served us well since 2005 as the ALPHA forum did before it from 2002 to 2005. New discussions are ongoing at the new URL http://forum.processing.org. You'll need to sign up and get a new user account. We're sorry about that inconvenience, but we think it's better in the long run. The content on this forum will remain online.
IndexProgramming Questions & HelpOther Libraries › Aligning GPS points on an svg map
Page Index Toggle Pages: 1
Aligning GPS points on an svg map (Read 6997 times)
Aligning GPS points on an svg map
May 9th, 2008, 10:45pm
 
This is relatively basic so if there is another thread I can be pointed to then all the better.  I am just wondering how I would create a map, say of the U.S. on which I could align points to correspond with cities, etc, based most likely on GPS.  I have the visualizing data book and am working through it.  The map samples in the book are great but don't show how I would align a graphic representation of a map and points pulled from GPS.  Any help is appreciated.   The short of it, if this gets to Ben Fry, is how did you create the data set for the center of each state that you overlayed over the U.S. map?


Cheers,
Duncan
Re: Aligning GPS points on an svg map
Reply #1 - May 21st, 2008, 10:38pm
 
Not so basic actually. It's all about geographical information systems (GIS) and how can you make your data sets match.

To align GPS points on a map, you first need to know how the map was constructed, which means, which geographic coordinate system has been used, since there are many ways to transform a 3D ellipsoid (the Earth) to a 2D plane (a map).

GPS coordinates rely on WGS 84 geodetic system, so you'll need a background map in the same coordinate system (or convert it).
Re: Aligning GPS points on an svg map
Reply #2 - May 22nd, 2008, 10:18am
 
The biggest problem is to find georeferenced images or svgs (if you find one please post here). You don't need images in wgs84 cause you can also convert your coords in the coordinate system of your images, like the mercator projection that googlemaps use.

By the way I'm not sure if the map stuff isn't be better done in a GIS software then to build your own in processing.
Re: Aligning GPS points on an svg map
Reply #3 - May 22nd, 2008, 4:03pm
 
I think you hit it on the head, I don't think I'll be able to find the geo-referenced  svgs.  I'm going to take a look at exporting maps from GIS software with a defined long-lat width that I can map my points to.  By the way here are the two projects that got me going along this route.  


http://www.flight404.com/blog/?p=116

http://www.vimeo.com/868319?pg=embed&sec=868319

(though in looking at the second example I realize that like the zip code example in the visualizing data book, the U.S. shape is just defined by the data points, not by any outline.)



Re: Aligning GPS points on an svg map
Reply #4 - May 26th, 2008, 5:20pm
 
Hi again,

You've given me the idea to start implementing a minimalist GIS library for processing.

I've started something, which may not fit your needs and is nothing compared to GeoTools or other Java-based GIS libraries, but this small sketch provides a background map (in raster format and Plate Carree projection) you can easily plot points onto.

Quote:
WorldMap wmap = new WorldMap();
Point paris = wmap.getPoint(2.35, 48.85); // WGS84 lat/long decimal (GPS)
ellipse(paris.x, paris,y, 5, 5);


http://n.clavaud.free.fr/processing/minigis/minigis011.zip

If I have enough time, I'll try implementing SVG background support and more projections.
Re: Aligning GPS points on an svg map
Reply #5 - May 27th, 2008, 12:32am
 
That sounds great, I'm going to give it a spin and let you know what I find.

Thanks
Re: Aligning GPS points on an svg map
Reply #6 - Jun 25th, 2008, 11:35pm
 
Quote:
The short of it, if this gets to Ben Fry, is how did you create the data set for the center of each state that you overlayed over the U.S. map?


The code to find the center of each state can be found on page 52 of the Visualizing Data book. It can of course be applied to other images.
Re: Aligning GPS points on an svg map
Reply #7 - Jun 26th, 2008, 2:17pm
 
right, so the reason it doesn't try to find the centers of the states programmatically is because there isn't a good way to do that. take the max and min of california's coordinates and you get.. nevada! with such a small data set as the 50 states, easier just to point and click once--especially when alaska and hawaii must be treated as exceptions.

for georeferenced svgs, one map i've used in the past are some of the free world maps from the "cia world factbook". these are in pdf format but can be converted to svg using adobe illustrator or maybe even inkscape by now (i thought someone was working on inkscape pdf import.)

to deal with the alternate map projection (the factbook map is prolly mercator or something like that), use the same method as converting the projection found in chapter 6: figure out what the projection is, then check mathworld for the equations, then convert that to code. you can use the albers projection in chapter 6 as a guide on how to convert the equations to code.
Re: Aligning GPS points on an svg map
Reply #8 - Jul 18th, 2008, 10:57pm
 
I'm working on a project that draws on a world map based on GPS coordinates. I had to find a perfectly grid-based world map to do it, but I was able to convert that into a Photoshop Path (vector shape) that I could resize and stylize how I wanted. Unfortunately I have no country or state/province boundaries. If you want it, msg me here.

It's a pretty basic way of doing it, the map shows from -180,90 to 180-90 so it's just a matter of converting that to a percentage and using that percentage to draw onto the map image based on the map's width (0 degrees longitude = 50%, 50% of 1280px wide map is 640px)
Re: Aligning GPS points on an svg map
Reply #9 - May 14th, 2009, 7:15am
 
I don't suppose anyone has some source for a sketch like the one on the blprnt blog? The one that used twitter to track people's flight path?

? I'm about to have a crack at it.... worth asking Cheesy
Re: Aligning GPS points on an svg map
Reply #10 - May 14th, 2009, 7:23am
 
ive got the sourche of gps mapping to a pixelmap onscreen. Have to leave in a sec. but i can post if yoou need it. Do you ?

Re: Aligning GPS points on an svg map
Reply #11 - Jan 22nd, 2010, 11:22am
 
Yes, I'd like to see that source very much, because I want to put a map of Europe in front of a camara and try to recognize it's coordinates in GPS.
Thanks in advanced!
Re: Aligning GPS points on an svg map
Reply #12 - Jan 22nd, 2010, 11:32am
 
here it is
http://processing.org/discourse/yabb2/?num=1259917547
Page Index Toggle Pages: 1