Intentando buscar fallo
parent
89ae0cce42
commit
94b1b7c56b
|
|
@ -144,7 +144,7 @@ namespace OliviaAddInPro.Helper
|
||||||
}
|
}
|
||||||
public static ArcGIS.Core.Geometry.SpatialReference GetSpatRefSync(string ftclassName)
|
public static ArcGIS.Core.Geometry.SpatialReference GetSpatRefSync(string ftclassName)
|
||||||
{
|
{
|
||||||
FeatureClass fc = GetFtClassFromShp(ftclassName).Result;
|
FeatureClass fc = GetFtClassSync(ftclassName);
|
||||||
if (fc == null)
|
if (fc == null)
|
||||||
return null;
|
return null;
|
||||||
ArcGIS.Core.Geometry.SpatialReference spatref = null;
|
ArcGIS.Core.Geometry.SpatialReference spatref = null;
|
||||||
|
|
@ -1025,6 +1025,29 @@ namespace OliviaAddInPro.Helper
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Reproyecta la geometría dada a la spatial reference, si son diferentes
|
||||||
|
*/
|
||||||
|
public static ArcGIS.Core.Geometry.Geometry ReproyectaGeom(ArcGIS.Core.Geometry.Geometry geom, ArcGIS.Core.Geometry.SpatialReference spatref)
|
||||||
|
{
|
||||||
|
ArcGIS.Core.Geometry.Geometry geomSal = null;
|
||||||
|
try
|
||||||
|
{
|
||||||
|
if (geom == null)
|
||||||
|
return null;
|
||||||
|
if (geom.SpatialReference == null)
|
||||||
|
return geom;
|
||||||
|
if (geom.SpatialReference.Equals(spatref))
|
||||||
|
return geom;
|
||||||
|
geomSal = GeometryEngine.Instance.Project(geom, spatref);
|
||||||
|
return geomSal;
|
||||||
|
}
|
||||||
|
catch
|
||||||
|
{
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Forma la envolvente convexa, el mínimo polígono,
|
* Forma la envolvente convexa, el mínimo polígono,
|
||||||
* que contiene los ámbitos para exportar, a partir de ahí la red navegable ampliando a un buffer
|
* que contiene los ámbitos para exportar, a partir de ahí la red navegable ampliando a un buffer
|
||||||
|
|
|
||||||
|
|
@ -108,6 +108,9 @@ namespace OliviaAddInPro.Model
|
||||||
[Browsable(false)]
|
[Browsable(false)]
|
||||||
public string path_data { get; set; }
|
public string path_data { get; set; }
|
||||||
|
|
||||||
|
[Browsable(false)]
|
||||||
|
public string path_cfg_aux { get; set; }
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
#region FILTROS_LIMP
|
#region FILTROS_LIMP
|
||||||
[Browsable(false)]
|
[Browsable(false)]
|
||||||
|
|
|
||||||
|
|
@ -408,7 +408,7 @@ namespace OliviaAddInPro.Model
|
||||||
public static void IniDefault()
|
public static void IniDefault()
|
||||||
{
|
{
|
||||||
var c = ConfigServ.Serv.Leer();
|
var c = ConfigServ.Serv.Leer();
|
||||||
Paths.PathCfg = "";
|
Paths.PathCfg = c.path_cfg_aux;
|
||||||
Paths.PathWork = c.path_work;
|
Paths.PathWork = c.path_work;
|
||||||
Paths.PathExeOlivia = c.path_exe;
|
Paths.PathExeOlivia = c.path_exe;
|
||||||
Paths.PathManualOlivia = c.path_manual;
|
Paths.PathManualOlivia = c.path_manual;
|
||||||
|
|
|
||||||
|
|
@ -56,6 +56,8 @@ namespace OliviaAddInPro.Services
|
||||||
res.path_manual = pon_path_absoluto(res.path_manual, res.path_work);
|
res.path_manual = pon_path_absoluto(res.path_manual, res.path_work);
|
||||||
res.path_temp = pon_path_absoluto(res.path_temp, res.path_work);
|
res.path_temp = pon_path_absoluto(res.path_temp, res.path_work);
|
||||||
res.path_data = pon_path_absoluto(res.path_data, res.path_work);
|
res.path_data = pon_path_absoluto(res.path_data, res.path_work);
|
||||||
|
res.path_cfg_aux = @"%dir_work%cfg.ini";
|
||||||
|
res.path_cfg_aux = pon_path_absoluto(res.path_cfg_aux, res.path_work);
|
||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -65,6 +67,7 @@ namespace OliviaAddInPro.Services
|
||||||
conf.path_manual = pon_path_relativo(conf.path_manual, conf.path_work);
|
conf.path_manual = pon_path_relativo(conf.path_manual, conf.path_work);
|
||||||
conf.path_temp = pon_path_relativo(conf.path_temp, conf.path_work);
|
conf.path_temp = pon_path_relativo(conf.path_temp, conf.path_work);
|
||||||
conf.path_data = pon_path_relativo(conf.path_data, conf.path_work);
|
conf.path_data = pon_path_relativo(conf.path_data, conf.path_work);
|
||||||
|
conf.path_cfg_aux = pon_path_relativo(conf.path_cfg_aux, conf.path_work);
|
||||||
|
|
||||||
conf.PathGdbGen = pon_path_relativo(conf.PathGdbGen, conf.path_work);
|
conf.PathGdbGen = pon_path_relativo(conf.PathGdbGen, conf.path_work);
|
||||||
conf.PathSimbVSM = pon_path_relativo(conf.PathSimbVSM, conf.path_work);
|
conf.PathSimbVSM = pon_path_relativo(conf.PathSimbVSM, conf.path_work);
|
||||||
|
|
@ -78,6 +81,7 @@ namespace OliviaAddInPro.Services
|
||||||
File.WriteAllText(path_cfg, jsonString);
|
File.WriteAllText(path_cfg, jsonString);
|
||||||
|
|
||||||
conf.path_exe = pon_path_absoluto(conf.path_exe, conf.path_work);
|
conf.path_exe = pon_path_absoluto(conf.path_exe, conf.path_work);
|
||||||
|
conf.path_cfg_aux = pon_path_absoluto(conf.path_cfg_aux, conf.path_work);
|
||||||
conf.path_temp = pon_path_absoluto(conf.path_temp, conf.path_work);
|
conf.path_temp = pon_path_absoluto(conf.path_temp, conf.path_work);
|
||||||
conf.path_manual = pon_path_absoluto(conf.path_manual, conf.path_work);
|
conf.path_manual = pon_path_absoluto(conf.path_manual, conf.path_work);
|
||||||
conf.path_data = pon_path_absoluto(conf.path_data, conf.path_work);
|
conf.path_data = pon_path_absoluto(conf.path_data, conf.path_work);
|
||||||
|
|
@ -164,6 +168,7 @@ namespace OliviaAddInPro.Services
|
||||||
c.Path_Eje_via = "";
|
c.Path_Eje_via = "";
|
||||||
c.Path_Gdb_Import = "";
|
c.Path_Gdb_Import = "";
|
||||||
c.Path_Guarda_Csv = "";
|
c.Path_Guarda_Csv = "";
|
||||||
|
c.path_cfg_aux = @"%dir_work%cfg.ini";
|
||||||
/*c.eje_via = "TomTom_Q4_2015___nw";
|
/*c.eje_via = "TomTom_Q4_2015___nw";
|
||||||
c.municipios = "TomTom_Q4_2015___a8";*/
|
c.municipios = "TomTom_Q4_2015___a8";*/
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -89,6 +89,36 @@ namespace OliviaAddInPro.Services
|
||||||
}
|
}
|
||||||
com.ProgrSrc.IncMessage(0, "Exportando geometria");
|
com.ProgrSrc.IncMessage(0, "Exportando geometria");
|
||||||
|
|
||||||
|
//////////////////////////////////////////////////////////////
|
||||||
|
Coordinate2D[] coords = { com.CoordsInstal, com.CoordsPlanta };
|
||||||
|
//Reproyecta las geometrías si es necesario
|
||||||
|
SpatialReference spatref = HelperGdb.GetSpatRefSync(com.CapaElems);
|
||||||
|
if (spatref != null)
|
||||||
|
{
|
||||||
|
if (com.GeomNiv != null)
|
||||||
|
com.GeomNiv = HelperGdb.ReproyectaGeom(com.GeomNiv, spatref);
|
||||||
|
if (com.GeomZon != null)
|
||||||
|
com.GeomZon = HelperGdb.ReproyectaGeom(com.GeomZon, spatref);
|
||||||
|
if (com.GeomRestr != null)
|
||||||
|
com.GeomRestr = HelperGdb.ReproyectaGeom(com.GeomRestr, spatref);
|
||||||
|
//ahora las coordenadas
|
||||||
|
for (int i = 0; i < coords.Length; i++)
|
||||||
|
{
|
||||||
|
if (com.ProgrSrc._ProgrSrc.Getcancelled())
|
||||||
|
{
|
||||||
|
ErrStr = Resource1.String_cancel_progreso;
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
if (!coords[i].IsEmpty && (coords[i].X != 0))
|
||||||
|
{
|
||||||
|
|
||||||
|
MapPoint mp = MapPointBuilderEx.CreateMapPoint(coords[i].X, coords[i].Y, spatref);
|
||||||
|
coords[i].X = mp.X;
|
||||||
|
coords[i].Y = mp.Y;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
//////////////////////////////////////////////////////////////
|
||||||
//Obtiene la geometría que envuelve a los ámbitos
|
//Obtiene la geometría que envuelve a los ámbitos
|
||||||
Geometry geom_export = null;
|
Geometry geom_export = null;
|
||||||
geom_export = GetGeomAmbitsExport();
|
geom_export = GetGeomAmbitsExport();
|
||||||
|
|
@ -225,7 +255,6 @@ namespace OliviaAddInPro.Services
|
||||||
}
|
}
|
||||||
//////////////////////////////////////////////////////////////
|
//////////////////////////////////////////////////////////////
|
||||||
//comprueba si la geometría de exportación contiene a la instalación y a la planta de descarga
|
//comprueba si la geometría de exportación contiene a la instalación y a la planta de descarga
|
||||||
Coordinate2D[] coords = { com.CoordsInstal, com.CoordsPlanta };
|
|
||||||
for (int i = 0; i < coords.Length; i++)
|
for (int i = 0; i < coords.Length; i++)
|
||||||
{
|
{
|
||||||
if (com.ProgrSrc._ProgrSrc.Getcancelled())
|
if (com.ProgrSrc._ProgrSrc.Getcancelled())
|
||||||
|
|
@ -513,10 +542,14 @@ namespace OliviaAddInPro.Services
|
||||||
ErrStr = "No se ha podido generar geometría de los ámbitos" + com.ConsultaAmbs + HelperGdb.OutStr;
|
ErrStr = "No se ha podido generar geometría de los ámbitos" + com.ConsultaAmbs + HelperGdb.OutStr;
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
//geomAux = geomAmbits;
|
if (geomAux == null)
|
||||||
|
geomAux = geomAmbits;
|
||||||
|
else
|
||||||
|
{
|
||||||
geomAux = HelperGdb.IntersectGeom(geomAux, geomAmbits);
|
geomAux = HelperGdb.IntersectGeom(geomAux, geomAmbits);
|
||||||
geomAux = GeometryEngine.Instance.ConvexHull(geomAux);
|
geomAux = GeometryEngine.Instance.ConvexHull(geomAux);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
//le quita las restricciones
|
//le quita las restricciones
|
||||||
if (com.GeomRestr != null)
|
if (com.GeomRestr != null)
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -99,7 +99,7 @@ namespace OliviaAddInPro.Services.LanzaSrv
|
||||||
GeneralDef.EjecGeoParamSep + GeneralDef.GG_port + GeneralDef.EjecGeoParamIgual + OliviaGlob.Conexion.Puerto + " " +
|
GeneralDef.EjecGeoParamSep + GeneralDef.GG_port + GeneralDef.EjecGeoParamIgual + OliviaGlob.Conexion.Puerto + " " +
|
||||||
GeneralDef.EjecGeoParamSep + GeneralDef.GG_tout + GeneralDef.EjecGeoParamIgual + OliviaGlob.Conexion.TiempoOutSocket + " " +
|
GeneralDef.EjecGeoParamSep + GeneralDef.GG_tout + GeneralDef.EjecGeoParamIgual + OliviaGlob.Conexion.TiempoOutSocket + " " +
|
||||||
GeneralDef.EjecGeoParamSep + GeneralDef.GG_pt + GeneralDef.EjecGeoParamIgual + OliviaGlob.Paths.PathTemp + " " +
|
GeneralDef.EjecGeoParamSep + GeneralDef.GG_pt + GeneralDef.EjecGeoParamIgual + OliviaGlob.Paths.PathTemp + " " +
|
||||||
GeneralDef.EjecGeoParamSep + GeneralDef.GG_pcfg + GeneralDef.EjecGeoParamIgual + OliviaGlob.Paths.PathCfg + " ";
|
GeneralDef.EjecGeoParamSep + GeneralDef.GG_pcfg + GeneralDef.EjecGeoParamIgual + OliviaGlob.Paths.PathCfg;
|
||||||
|
|
||||||
pfi = new ProcessStartInfo(OliviaGlob.Paths.PathExeOlivia, args);
|
pfi = new ProcessStartInfo(OliviaGlob.Paths.PathExeOlivia, args);
|
||||||
pfi.UseShellExecute = false;
|
pfi.UseShellExecute = false;
|
||||||
|
|
|
||||||
|
|
@ -11,10 +11,10 @@
|
||||||
ResizeMode="NoResize">
|
ResizeMode="NoResize">
|
||||||
|
|
||||||
<Grid>
|
<Grid>
|
||||||
<Label Content="{Binding TextProceso}" HorizontalAlignment="Left" Margin="76,10,0,0" VerticalAlignment="Top" Width="303" Height="26"/>
|
<Label Content="{Binding TextProceso}" HorizontalAlignment="Left" Margin="30,10,0,0" VerticalAlignment="Top" Width="350" Height="26"/>
|
||||||
<ProgressBar Minimum="0" Maximum="100" HorizontalAlignment="Left" Value="{Binding Progreso, UpdateSourceTrigger=PropertyChanged}" Height="20" Margin="76,40,0,0" VerticalAlignment="Top" Width="303"/>
|
<ProgressBar Minimum="0" Maximum="100" HorizontalAlignment="Left" Value="{Binding Progreso, UpdateSourceTrigger=PropertyChanged}" Height="20" Margin="29,40,0,0" VerticalAlignment="Top" Width="350"/>
|
||||||
|
|
||||||
<Grid HorizontalAlignment="Left" Margin="76,70,0,0" VerticalAlignment="Top" Width="303" Height="70">
|
<Grid HorizontalAlignment="Left" Margin="30,70,0,0" VerticalAlignment="Top" Width="350" Height="70">
|
||||||
<ScrollViewer MaxHeight="70" >
|
<ScrollViewer MaxHeight="70" >
|
||||||
<TextBlock Text="{Binding TextEstado}" TextWrapping="WrapWithOverflow" />
|
<TextBlock Text="{Binding TextEstado}" TextWrapping="WrapWithOverflow" />
|
||||||
</ScrollViewer>
|
</ScrollViewer>
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue