MapWindow 4 - Desktop Application : MapWindow Discussion Forum
Attachments: ShapefileConvertFromProjStringToWgs84.cs (1.7 KB)
Dear map window team, i found this projection in mapwindow database: Monte Mario / Italy zone 2 (also known as Gauss Boaga Fuso Est) epsg code 3004 +proj=tmerc +lat_0=0 +lon_0=15 +k=0.9996 +x_0=2520000 +y_0=0 +ellps=intl +units=m +towgs84=-104.1,-49.1,-9.9,0.971,
Gauss Boaga Projection
Posted by:
M.VISINTIN ()
Date: June 15, 2012 02:09AM
Dear map window team,
i found this projection in mapwindow database:
Monte Mario / Italy zone 2 (also known as Gauss Boaga Fuso Est)
epsg code 3004
+proj=tmerc +lat_0=0 +lon_0=15 +k=0.9996 +x_0=2520000 +y_0=0 +ellps=intl +units=m +towgs84=-104.1,-49.1,-9.9,0.971,-2.917,0.714,-11.68
To reproject my shapefile i need to use this string:
+proj=tmerc +lat_0=0 +lon_0=15 +k=0.999600 +x_0=2520000 +y_0=0 +ellps=intl +units=m +towgs84=-128.6633,-30.2694,-6.12,-1.05572,-2.6951,-2.28808,-16.9352
is it possible to configure the re-projection function to use these parameters?
Thanks
Edited 1 time(s). Last edit at 06/15/2012 02:18AM by M.VISINTIN.
i found this projection in mapwindow database:
Monte Mario / Italy zone 2 (also known as Gauss Boaga Fuso Est)
epsg code 3004
+proj=tmerc +lat_0=0 +lon_0=15 +k=0.9996 +x_0=2520000 +y_0=0 +ellps=intl +units=m +towgs84=-104.1,-49.1,-9.9,0.971,-2.917,0.714,-11.68
To reproject my shapefile i need to use this string:
+proj=tmerc +lat_0=0 +lon_0=15 +k=0.999600 +x_0=2520000 +y_0=0 +ellps=intl +units=m +towgs84=-128.6633,-30.2694,-6.12,-1.05572,-2.6951,-2.28808,-16.9352
is it possible to configure the re-projection function to use these parameters?
Thanks
Edited 1 time(s). Last edit at 06/15/2012 02:18AM by M.VISINTIN.
Re: Gauss Boaga Projection
Posted by:
pmeems ()
Date: June 15, 2012 03:19AM
Do you mean you have a shapefile in EPSG:3004 and want to convert it to something else?
Or do you need to convert it to EPSG:3004?
In the first case I think the reprojection uses your prj file. You might need to add you string as an dialect to the database.
Why the difference in the +towgs84 part. Is the string we have now in the database incorrect?
--
Paul
--
Don't forget to read the new documentation: www.mapwindow.org/documentation/mapwingis4.8
Join us Google+: MapWindow GIS Google+ Community
Join the MapWindow Group on LinkedIn! LinkedIn - MapWindow Group
Download the latest beta installer at:
tinyurl.com/mwMonthly 32-Bit
tinyurl.com/mwMonthlyx64 64-Bit
Follow me on Twitter MapWindow_nl to read when a new installer is published.
---
Paul Meems
The Netherlands
[www.bontepaarden.nl]
Release manager, configuration manager and
forum moderator of MapWindow GIS
Owner of MapWindow.nl - Support for
Dutch speaking users: www.mapwindow.nl
*******
Everything I say or write is my personal opinion and
not the opinion of the company I work for.
*******
View my profile on LinkedIn
Or do you need to convert it to EPSG:3004?
In the first case I think the reprojection uses your prj file. You might need to add you string as an dialect to the database.
Why the difference in the +towgs84 part. Is the string we have now in the database incorrect?
--
Paul
--
Don't forget to read the new documentation: www.mapwindow.org/documentation/mapwingis4.8
Join us Google+: MapWindow GIS Google+ Community
Join the MapWindow Group on LinkedIn! LinkedIn - MapWindow Group
Download the latest beta installer at:
tinyurl.com/mwMonthly 32-Bit
tinyurl.com/mwMonthlyx64 64-Bit
Follow me on Twitter MapWindow_nl to read when a new installer is published.
---
Paul Meems
The Netherlands
[www.bontepaarden.nl]
Release manager, configuration manager and
forum moderator of MapWindow GIS
Owner of MapWindow.nl - Support for
Dutch speaking users: www.mapwindow.nl
*******
Everything I say or write is my personal opinion and
not the opinion of the company I work for.
*******
View my profile on LinkedIn
Re: Gauss Boaga Projection
Posted by:
M.VISINTIN ()
Date: June 15, 2012 04:31AM
Dear Paul,
I need to convert a 3004 shapefile to wgs84.
To do that nominally i should use the standard mapWindow re-projection definition but, for my region (Friuli Venezia Giulia) we have a more precise roto-translation set of parameters:
towgs84=-128.6633,-30.2694,-6.12,-1.05572,-2.6951,-2.28808,-16.9352 .
To use that set have I to add them as a dialect?
After that they are automatically used to reproject my shapefile to wgs84?
Thanks,
Matteo
I need to convert a 3004 shapefile to wgs84.
To do that nominally i should use the standard mapWindow re-projection definition but, for my region (Friuli Venezia Giulia) we have a more precise roto-translation set of parameters:
towgs84=-128.6633,-30.2694,-6.12,-1.05572,-2.6951,-2.28808,-16.9352 .
To use that set have I to add them as a dialect?
After that they are automatically used to reproject my shapefile to wgs84?
Thanks,
Matteo
Re: Gauss Boaga Projection
Posted by:
pmeems ()
Date: June 15, 2012 05:50AM
To reproject we use the GDAL library with the Proj4 library.
The reproject tool in the toolbox uses the project of the shapefile you want to project.
I'm not sure what projection string is used when you add your string as a dialect.
You could try that option.
If you want to reproject a shapefile and pass the input and output projection you need to write a small script and use Utils.ReprojectShapefile(). Here's the documentation: [www.mapwindow.org]
Let us know your progress.
Thanks,
Paul
--
Don't forget to read the new documentation: www.mapwindow.org/documentation/mapwingis4.8
Join us Google+: MapWindow GIS Google+ Community
Join the MapWindow Group on LinkedIn! LinkedIn - MapWindow Group
Download the latest beta installer at:
tinyurl.com/mwMonthly 32-Bit
tinyurl.com/mwMonthlyx64 64-Bit
Follow me on Twitter MapWindow_nl to read when a new installer is published.
---
Paul Meems
The Netherlands
[www.bontepaarden.nl]
Release manager, configuration manager and
forum moderator of MapWindow GIS
Owner of MapWindow.nl - Support for
Dutch speaking users: www.mapwindow.nl
*******
Everything I say or write is my personal opinion and
not the opinion of the company I work for.
*******
View my profile on LinkedIn
The reproject tool in the toolbox uses the project of the shapefile you want to project.
I'm not sure what projection string is used when you add your string as a dialect.
You could try that option.
If you want to reproject a shapefile and pass the input and output projection you need to write a small script and use Utils.ReprojectShapefile(). Here's the documentation: [www.mapwindow.org]
Let us know your progress.
Thanks,
Paul
--
Don't forget to read the new documentation: www.mapwindow.org/documentation/mapwingis4.8
Join us Google+: MapWindow GIS Google+ Community
Join the MapWindow Group on LinkedIn! LinkedIn - MapWindow Group
Download the latest beta installer at:
tinyurl.com/mwMonthly 32-Bit
tinyurl.com/mwMonthlyx64 64-Bit
Follow me on Twitter MapWindow_nl to read when a new installer is published.
---
Paul Meems
The Netherlands
[www.bontepaarden.nl]
Release manager, configuration manager and
forum moderator of MapWindow GIS
Owner of MapWindow.nl - Support for
Dutch speaking users: www.mapwindow.nl
*******
Everything I say or write is my personal opinion and
not the opinion of the company I work for.
*******
View my profile on LinkedIn
Re: Gauss Boaga Projection
Posted by:
M.VISINTIN ()
Date: June 18, 2012 02:32AM
This is my script.
Do you think it is correct?
[Edit: Added code tags for better reading]
Edited 1 time(s). Last edit at 06/18/2012 04:17AM by pmeems.
Do you think it is correct?
using MapWindow.Interfaces;
using MapWinGIS;
using System.Windows.Forms;
using System;
using System.IO;
public class ShapefileConvertFromProjStringToWgs84
{
public const string FileName = "test.shp";
public const string ShpFolder = @"C:\shp";
public const string Proj4ConversionString = "+proj=tmerc +lat_0=0 +lon_0=15 +k=0.999600 +x_0=2520000 +y_0=0 +ellps=intl +units=m " +
"+towgs84=-128.6633,-30.2694,-6.12,-1.05572,-2.6951,-2.28808,-16.9352";
public static void ScriptMain( IMapWin m_MapWin )
{
string fullName = Path.Combine( ShpFolder, FileName );
if( !File.Exists( fullName ) )
{
MessageBox.Show( "Failed to open file: " + fullName );
return;
}
Shapefile sf = new Shapefile();
if( sf.Open( fullName, null ) )
{
MessageBox.Show( "Shapefile loaded." );
GeoProjection gb = new GeoProjection();
gb.ImportFromProj4( Proj4ConversionString );
MessageBox.Show( "Projection loaded: " + gb.Name );
GeoProjection wgs84 = new GeoProjection();
wgs84.ImportFromEPSG( 4326 ); // WGS84
MessageBox.Show( "Projection loaded: " + wgs84.Name );
Shapefile outSf = new Shapefile();
string fileNameWithoutExt = Path.GetFileNameWithoutExtension( fullName );
string outFullName = Path.Combine( ShpFolder, fileNameWithoutExt + "_WGS84.shp" );
Utils utils = new Utils();
outSf = utils.ReprojectShapefile( sf, gb, wgs84 );
if( outSf.SaveAs( outFullName, null ) )
MessageBox.Show( "Shapefile saved." );
else
MessageBox.Show( "Conversion failed." );
}
else
{
MessageBox.Show( "Failed to open file: " + fullName );
return;
}
}
}
[Edit: Added code tags for better reading]
Edited 1 time(s). Last edit at 06/18/2012 04:17AM by pmeems.
Attachments: ShapefileConvertFromProjStringToWgs84.cs (1.7 KB)
Re: Gauss Boaga Projection
Posted by:
pmeems ()
Date: June 18, 2012 04:18AM
The script seems OK to me.
Isn't it working?
--
Paul
--
Don't forget to read the new documentation: www.mapwindow.org/documentation/mapwingis4.8
Join us Google+: MapWindow GIS Google+ Community
Join the MapWindow Group on LinkedIn! LinkedIn - MapWindow Group
Download the latest beta installer at:
tinyurl.com/mwMonthly 32-Bit
tinyurl.com/mwMonthlyx64 64-Bit
Follow me on Twitter MapWindow_nl to read when a new installer is published.
---
Paul Meems
The Netherlands
[www.bontepaarden.nl]
Release manager, configuration manager and
forum moderator of MapWindow GIS
Owner of MapWindow.nl - Support for
Dutch speaking users: www.mapwindow.nl
*******
Everything I say or write is my personal opinion and
not the opinion of the company I work for.
*******
View my profile on LinkedIn
Isn't it working?
--
Paul
--
Don't forget to read the new documentation: www.mapwindow.org/documentation/mapwingis4.8
Join us Google+: MapWindow GIS Google+ Community
Join the MapWindow Group on LinkedIn! LinkedIn - MapWindow Group
Download the latest beta installer at:
tinyurl.com/mwMonthly 32-Bit
tinyurl.com/mwMonthlyx64 64-Bit
Follow me on Twitter MapWindow_nl to read when a new installer is published.
---
Paul Meems
The Netherlands
[www.bontepaarden.nl]
Release manager, configuration manager and
forum moderator of MapWindow GIS
Owner of MapWindow.nl - Support for
Dutch speaking users: www.mapwindow.nl
*******
Everything I say or write is my personal opinion and
not the opinion of the company I work for.
*******
View my profile on LinkedIn
Sorry, only registered users may post in this forum.


