I have a map from here. I want to be able to simply convert arbitrary lon/lat pair to pixels on the map (also the ability to do reverse conversion). The maps come with .tfw file and projection info, here it is:
0.02222222222222
0.00000000000000
0.00000000000000
-0.02222222222222
-180.00000000000000
90.00000000000000
and projection info:
Projection: Plate Carree aka Geographic or "LatLong"
Earth ellipsoid: Sphere, radius 6370997 m
Datum: WGS84
Extent: 180 West to 180 East, 90 North to 90 South
Size: 16,200 height samples wide x 8,100 high
Resolution: 2.47 km/pixel
I am completely new to cartography-related stuff, and as far as I figured out I should first do the transformation from WGS84 (lon/lat pair) to Geographic projection (aren't they the same?). It seems to me that they are the same, actually, but sphere radius in projection info above is 6370997 and is different from spatialreference.com page I found for Plate Carree projection. Anyway, I found DotSpatial.Projections library can do this for me, with the following code:
var kievCoordinates = new[] { 50.4546600, 30.5238000 };
var z = new[] { 1.0 };
var wgs84 = KnownCoordinateSystems.Geographic.World.WGS1984;
var dest = new ProjectionInfo();
dest.ParseEsriString(
"PROJCS[\"WGS 84 / Plate Carree (deprecated)\",GEOGCS[\"GCS_WGS_1984\",DATUM[\"D_WGS_1984\",SPHEROID[\"WGS_1984\",6378137,298.257223563]],PRIMEM[\"Greenwich\",0],UNIT[\"Degree\",0.017453292519943295]],PROJECTION[\"Equidistant_Cylindrical\"],PARAMETER[\"central_meridian\",0],PARAMETER[\"false_easting\",0],PARAMETER[\"false_northing\",0],UNIT[\"Meter\",1]]");
Reproject.ReprojectPoints(kievCoordinates, z, wgs84, dest, 0, 1);
And then I must translate resulting coordinates to pixels on the map using world file. I am aware of the following formula:
But it seems that there are degrees not meters in the world file and I don't know what to do with them. Generally, am I doing right things? Or there is more easy way, given my data?