You can write your own “French Lambert IIe” projection class by inheriting from Projection class and override the following two methods with V2.0 logic.
public class MyProjection : Projection { protected override Vertex[] ConvertToExternalProjectionCore(double[] x, double[] y) { }
public class MyProjection : Projection to public class MyProjection : ManagedProj4Projection and the code build; however, at runtime, I've an exception on MyProjection.open() which says: "Parameter is null" Please advise Patrick
Thanks for your further information, there are two possibility that will cause this exception. 1. You didn’t set the internalProjectionString and extenalProjectionString properties. 2. Your projection is some special format that our managedproj4projection does not support, for that, you need to set MemoryMode to UnManaged.
InternalProjectionParametersString is the original projection you data file use, and ExternalProjectionParametersString is the new projection you want to your data file shows.
thank you for you code, but this is not at all what I’m expected.
Let me rephrase my question.
I do have a custom projection (Lambert IIe with grid) not supported by Proj4. I’ve 2 functions that works with MS2 logic (geodesic_to_custom & custom_to_geodesic)
I need to re-implement this with MS5 logic.
1. How to implement this custom projection ? 2. how to declare a proj4Projection from mycustom to google?
Sorry for waiting, for your first question, it’s a little complicated, the projecting in 2.0 is totally different with 5.0 now, the way I can think about is create a point object, first using the 2.0 old way(exist way in your code) to transform the original data to this point, then using the 5.0 to transform this point to final data to draw, but this will cause you refer both 2.0 and 5.0 MapSuite, I’m not sure it’s a very good idea. Otherwise, you just rewrote the whole custom projection with 5.0 new way.
For the second question, you only need override ConvertToExternalProjectionCore and ConvertToInternalProjectionCore methods, and handle your logic how to transform your custom projection to goolg.
Maybe I’m not say it clearly, please let me know if you have any queries.
I take over this post and any question please feel free to let me know.
I attached a sample shows how to implement a custom projection, you just need to create a custom class that inherit from Projection class, and
override the method protected override Vertex[] ConvertToExternalProjectionCore(double[] x, double[] y) , x and y represent the internal vertex array, and in the method you can
use MapSuite 2.0 API to convert them from Wgs84 to custom, and then return them as vertex array.