Jun 25, 2010 at 2:19 PM
Edited Jul 1, 2010 at 6:18 PM
Hey SharpMap forums,
I'm new to mapping and have found myself a little stuck in my development.
I'm building a simple GPS system that shows the driver where they are on some set routes we've defined via ShapeFiles.
I've been displaying a shapefile that contains all the roads in the area this GPS is for.
Now, I want to add a layer that consists of just one point and has a symbol for your current location.
The GPS attached to this device returns lat and lng, using the WGS84 coordinate system.
I'm at the point where I'm ready to add the layer, but am unsure of how to properly transform the lat/lng that comes back from the GPS into the map's projection/coordinate system.
So my questions are:
1) What are the basic steps for adding a shapefile (with .prj projection file) and a point from live GPS coordinates to display correctly on the map?
2) What's the difference between a projection and a coordinate system?
3) Will every layer I put on the map require a CoordinateTransformation? If so, how do you determine what source/target system to transform it to (from the CoordinateTransformationFactory.CreateFromCoordinateSystems() method)? If it's a shape
file, the source is defined by the projection file - but if it's a SharpMap.Geometry?
4) I also place SharpMap.Geometries on the map (Point, Linestring); will I ever need to set it's SpacialReference (ICoordinateSystem) to display it correctly? If you change the Geometry's SpacialReference, do you still need a CoordinateTransformation
on the layer?
I think once I've wrapped my head around this whole conversion process I should be able to figure the rest out...
Thanks for any help!