[FWTools] Consuming FWTools utility from other project
David Litvak
dlitvak at consultoresgis.com
Wed May 18 11:44:58 EST 2011
I'm Making a front-end application for using ogr2ogr to upload files to a
PostGIS database
My problem is that when i use the -a_srs, -t_srs or -s_srs... the path for
the proj_lib folder where the EPSG projs are stored is not defined... so i
cant access them...
The application is being made using C#... and the code that calls for the
ogr2ogr program is the following...
{
Process export = new Process();
System.IO.StreamReader sErr;
string err;
export.StartInfo.EnvironmentVariables.Add("PGCLIENTENCODING", "LATIN1");
export.StartInfo.FileName = ".\\Binaries\\ogr2ogr.exe";
export.StartInfo.Arguments = toPostGISObject.getModo()
+ "-skipfailures "
+
toPostGISObject.getSistemaGeografico()
+ "-f \"PostgreSQL\" PG:\"host=" +
toPostGISObject.IP
+ " user=" + toPostGISObject.Usuario
+ " dbname=" +
toPostGISObject.DataBase
+ " password=" +
toPostGISObject.Password
+ " port=" + toPostGISObject.Puerto
+ "\" "
+ getSQL(toPostGISObject.SQL)
+ "\"" + toPostGISObject.Archivo +
"\" "
+ actualTable;
export.StartInfo.UseShellExecute = false;
export.StartInfo.CreateNoWindow = true;
export.StartInfo.RedirectStandardError = true;
export.Start();
sErr = export.StandardError;
export.WaitForExit();
err = sErr.ReadToEnd();
sErr.Close();
export.Close();
}
The function that retrieves me the -a_srs, -s_srs or -t_srs string is
toPostGisObject.getSistemaGeografico()
which returns i.e. "-a_srs EPGS:4326 " when WGS84 is selected at the
Form...
When running the process... it retrieves me the following error:
Failed to process SRS definition: EPGS:4326
Is there any Enviroment variable or anything i have to set for redirecting
the proj_lib path??
Thanks
--
David Litvak
ConsultoresGIS
www.consultoresgis.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.maptools.org/pipermail/fwtools/attachments/20110518/067a527e/attachment.htm
More information about the FWTools
mailing list