Projections

Topics: Algorithms
Mar 25, 2007 at 8:45 AM
Edited Mar 25, 2007 at 8:45 AM
I'm trying to project countries.shp from its current 0 degrees centered system to one that is centered on North America. The point is to render Asia on the left side of the map rather then the right. I figured out how to make transformations I guess I'm just looking for the right one.
Mar 26, 2007 at 5:59 AM
I think what I need is a geographic transform I tried a couple but didn't get any result?? I just want the origination point to be 0,90 degrees so North America centered. I actually would perfer the default projection if possible.
Mar 27, 2007 at 12:45 AM
Edited Mar 27, 2007 at 2:15 AM
Anyone??

EDIT:
I tried placing 2 maps next to each other and off setting one map by 360. Unfortunatly, the portion of the second map where the center is focused on disappears unless you zoom out more then 500 degrees or so. The solution to this is changing the bounding box code or changing the envelope code so that changes to a layers polygons results in recalculating the envelop.
Coordinator
Mar 27, 2007 at 2:33 AM
It's just not very clear what you are working with. Consider being more careful about your explaination - for example, include key lines of code, what your data is and what parameters you are using - and observe how responses will come more quickly.

What kind of projection do you have? A Mercator projection with the longitude of origin at 0 degrees? And what do you mean by default projection? SharpMap automatically uses a default projection, or the .PRJ file if you are using a shapefile.

I'll take a Mercator shapefile centered on the prime meridian as a guess...

IProjectedCoordinateSystem currentMercator = myShapeFile.CoordinateSystem;
IProjectedCoordinateSystem shiftedMercator = currentMercator;
shiftedMercator.GetParameter("longitude_of_natural_origin").Value = 90.0;
 
CoordinateTransformationFactory transformFactory = new CoordinateTransformationFactory();
ICoordinateTransformation transform = transformFactory.CreateFromCoordinateSystems(currentMercator, shiftedMercator);
 
myVectorLayer.CoordinateTransform = transform;
Apr 7, 2007 at 1:00 AM
Edited Apr 7, 2007 at 7:49 AM
So I didn't have any luck with the code you gave me. I get an object doesn't exist exception and it doesn't appear that the natural origin parameter appears in Mercador.cs other then as a note.
I'm working with the default world map that comes with the demo's downloaded from this site. I would like to go from the SharpMap default projection to a Mercado centered on North America. I also downloaded the latest source from the SourceCode tab today.

Just to be clear I'm trying to acheive something that looks like this
http://delta.innosked.com/ where I can move the world and it will wrap around the other side.
Apr 17, 2007 at 2:31 AM
Still looking for help on this.