spunky
Posts: 20
Joined: Mon Apr 17, 2006 3:48 pm

help to save a correct prj file

Sun May 12, 2013 2:45 am

I want to save a shape for esri and need a prj-file in this format:

PROJCS["Germany_Zone_4",
GEOGCS["GCS_Deutsches_Hauptdreiecksnetz",
DATUM["D_Deutsches_Hauptdreiecksnetz",
SPHEROID["Bessel_1841",6377397.155,299.1528128]],
PRIMEM["Greenwich",0],
UNIT["Degree",0.017453292519943295]],
PROJECTION["Transverse_Mercator"],
PARAMETER["False_Easting",4500000],
PARAMETER["False_Northing",0],
PARAMETER["Central_Meridian",12],
PARAMETER["Scale_Factor",1],
PARAMETER["Latitude_Of_Origin",0],
UNIT["Meter",1]]

I do not know why, but GpsTools saves always in this format:
PROJCS["GpsTools Custom Grid",
GEOGCS["GpsTools Custom Datum",
DATUM["",
PRIMEM["Greenwich",0],
UNIT["Degree",0.017453292519943]],
SPHEROID["",0,0]],
METHOD["Position_Vector"],
PARAMETER["X_Axis_Translation",0],
PARAMETER["Y_Axis_Translation",0],
PARAMETER["Z_Axis_Translation",0],
PARAMETER["X_Axis_Rotation",0],
PARAMETER["Y_Axis_Rotation",0],
PARAMETER["Z_Axis_Rotation",0],
PARAMETER["Scale_Difference",0],
PROJECTION["Transverse_Mercator"],
PARAMETER["False_Easting",500000],
PARAMETER["False_Northing",0],
PARAMETER["Longitude_Of_Origin",0],
PARAMETER["Latitude_Of_Origin",0],
PARAMETER["Standard_Parallel_1",0],
PARAMETER["Standard_Parallel_2",0],
PARAMETER["Scale_Factor",1],
UNIT["Meter",1]]

I use the following code, what is wrong, someone has a ready example?

.
.
.
ShapeFile.Write(shape)

'ShapeFile.DatumGridTemplate.Datum = GpsToolsNET.Datum.DHDN_RAUENBERG
'ShapeFile.DatumGridTemplate.Grid = GpsToolsNET.Grid.DHDN
'ShapeFile.DatumGridTemplate.Datum = GpsToolsNET.Datum.WGS_84
'ShapeFile.DatumGridTemplate.Grid = shape.DatumGridTemplate.Grid

Dim nodeDatumGrid As New GpsToolsNET.Position
nodeDatumGrid.Datum = GpsToolsNET.Datum.DHDN_RAUENBERG
nodeDatumGrid.Grid = GpsToolsNET.Grid.DHDN
nodeDatumGrid.Zone = 4

ShapeFile.DatumGridTemplate = nodeDatumGrid
ShapeFile.DatumGridTemplate.CustomGrid.Datum = nodeDatumGrid.Datum
ShapeFile.DatumGridTemplate.CustomGrid.FalseEasting = 4500000
ShapeFile.DatumGridTemplate.CustomGrid.FalseNorthing = 0
ShapeFile.DatumGridTemplate.CustomGrid.ScaleFactor = 1
ShapeFile.DatumGridTemplate.CustomGrid.LatitudeOfOrigin = 0
ShapeFile.DatumGridTemplate.CustomDatum.ScaleFactor = 1

ShapeFile.WriteProjection()

ShapeFile.Close()

Return to “GpsTools”