<span class="Apple-style-span" style="border-collapse: collapse; font-family: arial, sans-serif; font-size: 13px; ">I'm Making a front-end application for using ogr2ogr to upload files to a PostGIS database<div><br></div>
<div>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...</div><div><br></div><div>The application is being made using C#... and the code that calls for the ogr2ogr program is the following...</div>
<div><br></div><div><br></div><div>{</div><div><div>Process export = new Process();</div><div>System.IO.StreamReader sErr;</div><div>string err;</div><div><br></div><div>export.StartInfo.EnvironmentVariables.Add("PGCLIENTENCODING", "LATIN1");</div>
<div>export.StartInfo.FileName = ".\\Binaries\\ogr2ogr.exe";</div><div>export.StartInfo.Arguments = toPostGISObject.getModo()</div><div> + "-skipfailures "</div>
<div>
+ toPostGISObject.getSistemaGeografico()</div><div> + "-f \"PostgreSQL\" PG:\"host=" + toPostGISObject.IP</div><div>
+ " user=" + toPostGISObject.Usuario</div>
<div> + " dbname=" + toPostGISObject.DataBase</div><div> + " password=" + toPostGISObject.Password</div><div> + " port=" + toPostGISObject.Puerto + "\" "</div>
<div> + getSQL(toPostGISObject.SQL)</div><div> + "\"" + toPostGISObject.Archivo + "\" "</div><div> + actualTable;</div>
<div><br></div><div>export.StartInfo.UseShellExecute = false;</div><div>export.StartInfo.CreateNoWindow = true;</div><div>export.StartInfo.RedirectStandardError = true;</div><div><br></div><div><br></div><div>export.Start();</div>
<div><br></div><div>sErr = export.StandardError;</div><div><br></div><div>export.WaitForExit();</div><div><br></div><div>err = sErr.ReadToEnd();</div><div>sErr.Close();</div><div>export.Close();</div><div>}</div><div><br>
</div><div><br></div><div>The function that retrieves me the -a_srs, -s_srs or -t_srs string is toPostGisObject.getSistemaGeografico()</div><div>which returns i.e. "-a_srs EPGS:4326 " when WGS84 is selected at the Form...</div>
<div><br></div><div>When running the process... it retrieves me the following error:</div><div> Failed to process SRS definition: EPGS:4326</div><div><br></div><div>Is there any Enviroment variable or anything i have to set for redirecting the proj_lib path??</div>
<div><br></div><div>Thanks</div></div><div><br></div></span><br>-- <br><div>David Litvak</div>
<div> </div>
<div>ConsultoresGIS</div>
<div><a href="http://www.consultoresgis.com/" target="_blank">www.consultoresgis.com</a></div><br>