ThinkGeo.com    |     Documentation    |     Premium Support

Can i reproject a WmsRasterLayer?

Is it possible to change a projection of a map obtained by WMS in the view?

Hi Joao,
First, we should get the SRS in Capabilities from WMS.

Second, our map in Wpf Edition has no ‘Projection’ property, but we have ‘MapUnit’ property which including ‘Meter’, ‘DecimalDegree’, ‘Feet’ values.
We set the projection for Overlay or Layer, so that they can match with the base map:

        // sets the unit of the map to meters because it is in the Google projection (Spherical Metcator)
        winformsMap1.MapUnit = GeographyUnit.Meter;   

        //Sets the projection parameters to go from Geodetic (EPSG 4326) or decimal degrees to Google Map projection (Spherical Mercator).
        Proj4Projection proj4 = new Proj4Projection();
        proj4.InternalProjectionParametersString = Proj4Projection.GetEpsgParametersString(4326);
        proj4.ExternalProjectionParametersString = Proj4Projection.GetGoogleMapParametersString();
        proj4.Open();

        //Applies the projection to the InMemoryFeatureLayer so that the point in decimal degrees (Longitude/Latitude) can be 
        //match the projection of Google Map.
        pointLayer.FeatureSource.Projection = proj4;

Any question, please let me know.

Thanks,
Emil