I need to write a function that can project some location defined by latitude/longitue to x,y coordinates on a map (image).
The map itself seems to be using "belgian Lambert" as projection type.
I found some official information about this projection and its configuration : http://ign.be/FR/FR2-1-4.shtm and http://ign.be/Common/Lambert2008/Transformation_Geographic_Lambert_FR.pdf (in french, I'll translate if needed).
Basically, I came to the conclusion that it would be easier to use some library (although that's not a requirement here). After some research, it seems that OpenMap should be able to do the work.
So, here is what I got so far:
private Point mapCoordinatesToPoint(LatLonPoint latLonPoint) {
LatLonPoint centerLatLonPoint = new LatLonPoint(50.797815, 4.3592158333333333333333333333333);
Proj proj = new LambertConformal(centerLatLonPoint, 1, 1000, 1000, 4.3592158333333333333333333333333, 49.833333333333333333333333333333, 51.166666666666666666666666666667, 50.797815, 649328.0, 665262.0, Ellipsoid.GRS_1980);
return proj.forward(latLonPoint);
}
(knowing that my gif is 1000x1000)
JavaDoc for LamberConformal constructor: http://openmap.bbn.com/doc/api/com/bbn/openmap/proj/LambertConformal.html#LambertConformal%28com.bbn.openmap.LatLonPoint,%20float,%20int,%20int,%20double,%20double,%20double,%20double,%20double,%20double,%20com.bbn.openmap.proj.Ellipsoid%29
I guess I didn't configure it right: some point that should be on the map, xxx, gives this result:
x=-1766051.0; y=-1.6355546E7;
Giving the "center point" (?) as parameter gives
x=500.0; y=500.0;
(middle of the map, which looks ok)
Anyone familiar with this, or able to figure the configuration from the links?
EDIT:
tried replacing last line from method with this:
return proj.forward(latLonPoint.getLatitude(), latLonPoint.getLongitude(), new Point(), false);
but not better.