
Hi all,
I'm just starting to use sharpmap, and it works great.
However I ran into something I don't quite get.
I have some shapefiles which are in wgs84 and some other input which is in radians.
I want to transform 1 of the layers, so the map on each other.
Who can help me with this?



You could define a CoordinateTransformation in your layer to dynamically define how to project your data



I just found out that both sources are in wgs84, but 1 is in degrees and the other is in radians.
How can I transform this with an on the fly transformation?



360 degrees = 2 * PI radians
so 1 degree = (2 * PI)/360 ≈ 0.0174532925 radians
or 1 radian = 360/(2*PI) ≈ 57.2957795 degrees



JohnDiss wrote:
360 degrees = 2 * PI radians
so 1 degree = (2 * PI)/360 ≈ 0.0174532925 radians
or 1 radian = 360/(2*PI) ≈ 57.2957795 degrees
I know how to convert from degrees to radians and back, but how can I put this in a CoordinateTransformation of a VectorLayer?



Your data is in radians??!? There is no "normal" wellknown spatial reference that uses radians. I think instead you should fix your data.
Anyway if you insist, you could create a geographic coordinate system whose angular unit is radians (just create a WGS84 CS and change the angular unit). The projection engine should take care of the rest for you. However, since this is soooo rare, you might
get yourself into some untested territory here (but be sure to file a bug in the Proj.NET project if it doesn't work).



I cannot change my data, since I cannot control that.
What I want is to plot points on a map.
For the map I have shapefiles in WGS84, and the points I want to plot are in radians.
The shapefiles are put in several vector layers.
The point are plotted in there own vector layer with a list<Geometry> as datasource. This list is provided by another piece of software, so I cannot change the coordinates from radians to degrees.
Isn't there an easier way to do this tang to create my own geographic coordinate system?


Feb 1, 2008 at 3:14 AM
Edited Feb 1, 2008 at 3:15 AM

What do you mean easier? It doesn't get much easier than that.
You want to perform a transformation on your data, so you apply a transformation to your data, and this type of transformation is already there ready to use. That's all there is to it. I mean we are talking 45 lines of code here !
Look at the WIKI showing how to apply transformation to a layer (~4 lines of code), and just tweak the geographic coordinate systems angular units to radians (one line of code).
At least this goes for v0.9. I'm not sure how this work on the v2.0 code though. Personally that version seems to me to be overengineered and made far too complex to work with.



Odegaard wrote:
What do you mean easier? It doesn't get much easier than that.
Remember that for the new 'Rails' developers, anything could be easier, especially if someone else made the work for you...
Odegaard wrote:
Personally that version seems to me to be overengineered and made far too complex to work with.
I think that at this stage we're far for a beta1 or a beta2 version, so (maybe due to requests) we have released a 2.0 beta version too earlier. BTW I've a lot of confidence in codekaizen work, but it's true that the changes from 0.9 to 2.0 are a lot, so I
suspect that move to a new SharpMap version from 0.9v could be hard at the initial stages.

