Problem Reprojection WGS84 LatLon (EPSG:4326) to National MonteMarioItaly2 (EPSG:3004)

Oct 9, 2012 at 7:35 AM

Hi all,

I'm trying to reproject LatLon geographics coordinates into MonteMarioItaly2 projected coordinates.

I've tryied to use:
- MonteMarioItaly2
- Roma1940GaussBoagaEst
- MonteMarioRomeItaly2

But the result appear to be very imprecise, I get 30mt of error.

That's strange, so probably I do something wrong.

GeographicSystems geoSys = new GeographicSystems();
ProjectedSystems proSys = new ProjectedSystems();
ProjectionInfo wgs84 = geoSys.World.WGS1984;
ProjectionInfo gb = proSys.MonteMarioItaly2;

[...]

double[] coordArr = new double[2] { (double) row.Longitude, (double) row.Latitude };
double[] z = new double[1] { (double) row.Height };
Reproject.ReprojectPoints(coordArr, z, wgs84, gb, 0, 1);

[...]
I have tryied to use ESRI strings in this way to have a good result, but without success.
GeographicSystems geoSys = new GeographicSystems();
ProjectedSystems proSys = new ProjectedSystems();
string proj4string4326 = "GEOGCS[\"GCS_WGS_1984\",DATUM[\"D_WGS_1984\",SPHEROID[\"WGS_1984\",6378137,298.257223563]],PRIMEM[\"Greenwich\",0],UNIT[\"Degree\",0.017453292519943295]]";
string proj4string3004 = "PROJCS[\"Monte_Mario_Italy_zone_2\",GEOGCS[\"GCS_Monte Mario\",DATUM[\"D_Monte_Mario\",SPHEROID[\"International_1924\",6378388,297]],PRIMEM[\"Greenwich\",0],UNIT[\"Degree\",0.017453292519943295]],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER[\"central_meridian\",15],PARAMETER[\"scale_factor\",0.9996],PARAMETER[\"false_easting\",2520000],PARAMETER[\"false_northing\",0],UNIT[\"Meter\",1]]";
ProjectionInfo gb = new ProjectionInfo();
gb.ParseEsriString(proj4string3004);
ProjectionInfo wgs84 = new ProjectionInfo();
wgs84.ParseEsriString(proj4string4326);

[...]

double[] coordArr = new double[2] { (double)row.Longitude, (double)row.Latitude };
double[] z = new double[1] { (double) row.Height };
Reproject.ReprojectPoints(coordArr, z, wgs84, gb, 0, 1);

[...]
In both cases, I've had also this logs in console:
ProjectionInfo.ParseProj4String: command 'to' not supported and the portion of the string after 'to' will not be processed in '+proj=sterea +lat_0=52.15616055555555 +lon_0=5.38763888888889 +k=0.999908 +x_0=155000 +y_0=463000 +ellps=bessel +units=m +towgs84=565.2369, 50.0087, 465.658, -0.406857330322398, 0.350732676542563, -1.8703473836068, 4.0812 +no_defs +to +proj=latlong +datum=WGS84 '
ProjectionInfo.ParseProj4String: command 'R_A' not understood in '+proj=mill +lat_0=0 +lon_0=0 +x_0=0 +y_0=0 +R_A +ellps=WGS84 +datum=WGS84 +units=m +no_defs '
ProjectionInfo.ParseProj4String: command 'R_A' not understood in '+proj=vandg +lon_0=0 +x_0=0 +y_0=0 +R_A +ellps=WGS84 +datum=WGS84 +units=m +no_defs '
ProjectionInfo.ParseProj4String: command 'R_A' not understood in '+proj=mill +lat_0=0 +lon_0=0 +x_0=0 +y_0=0 +R_A +a=6371000 +b=6371000 +units=m +no_defs '
ProjectionInfo.ParseProj4String: command 'R_A' not understood in '+proj=vandg +lon_0=0 +x_0=0 +y_0=0 +R_A +a=6371000 +b=6371000 +units=m +no_defs '
ProjectionInfo.ParseProj4String: command 'to' not supported and the portion of the string after 'to' will not be processed in '+proj=sterea +lat_0=52.15616055555555 +lon_0=5.38763888888889 +k=0.999908 +x_0=155000 +y_0=463000 +ellps=bessel +units=m +towgs84=565.2369, 50.0087, 465.658, -0.406857330322398, 0.350732676542563, -1.8703473836068, 4.0812 +no_defs +to +proj=latlong +datum=WGS84 '
ProjectionInfo.ParseProj4String: command 'R_A' not understood in '+proj=mill +lat_0=0 +lon_0=0 +x_0=0 +y_0=0 +R_A +ellps=WGS84 +datum=WGS84 +units=m +no_defs '
ProjectionInfo.ParseProj4String: command 'R_A' not understood in '+proj=vandg +lon_0=0 +x_0=0 +y_0=0 +R_A +ellps=WGS84 +datum=WGS84 +units=m +no_defs '
ProjectionInfo.ParseProj4String: command 'R_A' not understood in '+proj=mill +lat_0=0 +lon_0=0 +x_0=0 +y_0=0 +R_A +a=6371000 +b=6371000 +units=m +no_defs '
ProjectionInfo.ParseProj4String: command 'R_A' not understood in '+proj=vandg +lon_0=0 +x_0=0 +y_0=0 +R_A +a=6371000 +b=6371000 +units=m +no_defs '

Any suggestion would be really appriciated, at the moment I can't use dotSpatial for that reason.

Versions:

DotSpatial.Projections 0.11.9.6
DotSpatial.Data  0.11.9.6
DotSpatial.Topology 0.11.9.6