This project is read-only.

Reproject map layer to match the map coordinate system

Jul 11, 2012 at 9:41 AM
Edited Jul 18, 2012 at 11:16 AM

Hi!

I am running DemoMap program and want to match our geometry with Google Satellite map from DotSpatial.Plugins.WebMap. But no success yet.

Spatial Meta Data for our geometry are:
EPSG 2170MGI / Slovenia Grid+proj=tmerc +lat_0=0 +lon_0=15 +k=0.9999 +x_0=500000 +y_0=0 +ellps=bessel +towgs84=577.326,90.129,463.919,5.137,1.474,5.297,2.4232 +units=m +no_defs 

Please for help what data are nesessery for matching our geometry with web maps koordinate system. Is there any way to do this with DotSpatial? Any help or pointers in the right direction would be appreciated! 

regards, vzavec

still need help !

is it a problem of DotSpatial.Projections ?

Jul 19, 2012 at 6:00 PM

Try opening DemoMap, then enable the WebMap layer and finally add your slovenia file. I think it should be reprojected as it is drawn (on the fly) to match the project of the map, which will be WebMercator at that point.

Jul 20, 2012 at 10:27 AM

Mudnug thanks for follow me. Yes Slovenia SHP file with proj file bellow which exactly match with OpenStreet map in DemoMap:

GEOGCS["WGS 84",DATUM["WGS_1984",SPHEROID["WGS 84",6378137,298.257223563,AUTHORITY["EPSG","7030"]],TOWGS84[0,0,0,0,0,0,0],AUTHORITY["EPSG","6326"]],PRIMEM["Greenwich",0,AUTHORITY["EPSG","8901"]],UNIT["degree",0.01745329251994328,AUTHORITY["EPSG","9122"]],AUTHORITY["EPSG","4326"]]

But our user SHP file with GaussKrueger coordinate system do not match at all. I think that these are the data for that user projection:


PROJCS["Slovenia 1996 / Slovene National Grid",GEOGCS["Slovenia 1996",DATUM["D_Slovenia_Geodetic_Datum_1996",SPHEROID["GRS_1980",6378137,298.257222101]],PRIMEM["Greenwich",0],UNIT["Degree",0.017453292519943295]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",15],PARAMETER["scale_factor",0.9999],PARAMETER["false_easting",500000],PARAMETER["false_northing",-5000000],UNIT["Meter",1]]

Are there any steps to match our user data with WebMap layer?

Jul 20, 2012 at 4:26 PM

From my understanding

1) The projection needs to accompany the layer. For example, as a .prj file.

2) The projection needs to be a 'known' projection so that the system knows how to reproject it.

3) The layers need to be added in such a way that reprojection is triggered (which I think you are doing).

 

Of course there could be a bug in the way we reproject a particular system.

Jul 23, 2012 at 10:19 AM

If I set new value for  +y_0  from +y_0=0 to +y_0=-5000000 in NationalGrids.cs file arrise a difference in X direction +370m and in the Y direction +37m. That is the best result for now!

New record in the NationalGrids.cs file is now look like this:             
MGISloveniaGrid = ProjectionInfo.FromProj4String("+proj=tmerc +lat_0=0 +lon_0=15 +k=0.999900 +x_0=500000 +y_0=-5000000 +ellps=bessel +units=m +no_defs "); 

Then I have made this steps:
1. open Google Satellite map in DemoMap2. open my shape file and choose Use Selected transform and ... button to Select a Projection3. choose Projected - NationalGrids and MGISloveniaGrid and Apply and OK4. there is message Projection Mismatch.... and Yes for reproject new layers on the fly...


How to correct that difference? Which data must I supply to minimize this difference?Thanks for your cooperation.
Vojko

Jul 23, 2012 at 8:16 PM

Are you sure you have the correct spatial metadata? http://spatialreference.org/ref/epsg/2170/proj4/