Error: "Projection Cassini is not supported."

Topics: Algorithms, General Topics, Italiano, SharpMap Project, SharpMap v0.9 / v1.x
Sep 15, 2015 at 10:41 AM
Hello all,
I use this prj file for my project:

"PROJCS[""Cassini"",GEOGCS[""GCS_WGS_1984"",DATUM[""D_unknown"",SPHEROID[""WGS84"",6378137,298.257223563]],PRIMEM[""Greenwich"",0],UNIT[""Degree"",0.017453292519943295]],PROJECTION[""Cassini""],PARAMETER[""latitude_of_origin"",41.924403],PARAMETER[""central_meridian"",12.452129],PARAMETER[""false_easting"",0],PARAMETER[""false_northing"",0],UNIT[""Meter"",1],PARAMETER[""scale_factor"",1.0]]"

I know that "Cassini" projection is not in this list: https://sharpmap.codeplex.com/wikipage?title=Which%20projections%20are%20supported

My question is this: There is a way for use Cassini projection in Sharpmap?
Coordinator
Sep 15, 2015 at 11:32 AM
Try to replace "Cassini" with "Cassini_Soldner"
Sep 15, 2015 at 12:17 PM
Ok,
with "Cassini_Soldner" instead "Cassini" i fix .net error, but I don't see nothing on the map.

Do you think this code is ok?
...
Dim gfp As New SharpMap.Data.Providers.GeometryFeatureProvider(fdt)
        Dim LayerPoligoni = New SharpMap.Layers.VectorLayer("poligoni", gfp)




        Dim ctFact As New ProjNet.CoordinateSystems.Transformations.CoordinateTransformationFactory()
        Dim cFac As New ProjNet.CoordinateSystems.CoordinateSystemFactory()
        Dim wkt As String = "PROJCS[""Cassini_Soldner"",GEOGCS[""GCS_WGS_1984"",DATUM[""D_unknown"",SPHEROID[""WGS84"",6378137,298.257223563]],PRIMEM[""Greenwich"",0],UNIT[""Degree"",0.017453292519943295]],PROJECTION[""Cassini_Soldner""],PARAMETER[""latitude_of_origin"",41.924403],PARAMETER[""central_meridian"",12.452129],PARAMETER[""false_easting"",0],PARAMETER[""false_northing"",0],UNIT[""Meter"",1],PARAMETER[""scale_factor"",1.0]]"


        Dim g1 As ICoordinateSystem = ProjNet.CoordinateSystems.GeographicCoordinateSystem.WGS84
        Dim g2 As ICoordinateSystem = cFac.CreateFromWkt(wkt)

        LayerPoligoni.CoordinateTransformation = ctFact.CreateFromCoordinateSystems(g1, g2)
        LayerPoligoni.ReverseCoordinateTransformation = ctFact.CreateFromCoordinateSystems(g2, g1)

        MapBox1.Map.Layers.Add(LayerPoligoni)
        MapBox1.Refresh()
Sep 15, 2015 at 12:57 PM
Now work fine:

I replace only

Dim g1 As ICoordinateSystem = ProjNet.CoordinateSystems.GeographicCoordinateSystem.WGS84

with

Dim g1 As ICoordinateSystem = ProjNet.CoordinateSystems.ProjectedCoordinateSystem.WebMercator

thanks FObermaier!



Maurizio80 wrote:
Ok,
with "Cassini_Soldner" instead "Cassini" i fix .net error, but I don't see nothing on the map.

Do you think this code is ok?
...
Dim gfp As New SharpMap.Data.Providers.GeometryFeatureProvider(fdt)
        Dim LayerPoligoni = New SharpMap.Layers.VectorLayer("poligoni", gfp)




        Dim ctFact As New ProjNet.CoordinateSystems.Transformations.CoordinateTransformationFactory()
        Dim cFac As New ProjNet.CoordinateSystems.CoordinateSystemFactory()
        Dim wkt As String = "PROJCS[""Cassini_Soldner"",GEOGCS[""GCS_WGS_1984"",DATUM[""D_unknown"",SPHEROID[""WGS84"",6378137,298.257223563]],PRIMEM[""Greenwich"",0],UNIT[""Degree"",0.017453292519943295]],PROJECTION[""Cassini_Soldner""],PARAMETER[""latitude_of_origin"",41.924403],PARAMETER[""central_meridian"",12.452129],PARAMETER[""false_easting"",0],PARAMETER[""false_northing"",0],UNIT[""Meter"",1],PARAMETER[""scale_factor"",1.0]]"


        Dim g1 As ICoordinateSystem = ProjNet.CoordinateSystems.GeographicCoordinateSystem.WGS84
        Dim g2 As ICoordinateSystem = cFac.CreateFromWkt(wkt)

        LayerPoligoni.CoordinateTransformation = ctFact.CreateFromCoordinateSystems(g1, g2)
        LayerPoligoni.ReverseCoordinateTransformation = ctFact.CreateFromCoordinateSystems(g2, g1)

        MapBox1.Map.Layers.Add(LayerPoligoni)
        MapBox1.Refresh()