modo eje de calles

Gerardo/ModosViaje
Gerardo 2024-01-24 11:02:41 +01:00
parent dcc3040cef
commit ec850008c0
3 changed files with 19 additions and 8 deletions

View File

@ -673,7 +673,7 @@ namespace OliviaAddInPro.Helper
public static ArcGIS.Core.Data.SpatialQueryFilter CreateFiler(string consulta, ArcGIS.Core.Geometry.Geometry geom, SpatialRelationship rel = SpatialRelationship.Contains)
{
ArcGIS.Core.Data.SpatialQueryFilter filt = null;
if (geom != null)
if (geom != null && !geom.IsEmpty)
{
SpatialQueryFilter filtSpat = new SpatialQueryFilter
{
@ -1445,7 +1445,7 @@ namespace OliviaAddInPro.Helper
if (!System.IO.Directory.Exists(outpath))
System.IO.Directory.CreateDirectory(outpath);
FeatureClass fc = null;
bool debug = false;
bool debug = true;
/////////////////////////////////////////////////////////
//Prepara una where_clause con las entidades que cumplen el filtro
//Abre la featureclass
@ -1467,7 +1467,11 @@ namespace OliviaAddInPro.Helper
//Añade a la lista los ids que cumplen el filtro espacial
try
{
ids = fc.Select(filter, SelectionType.ObjectID, SelectionOption.Normal).GetObjectIDs().ToList();
var aux = fc.Select(filter, SelectionType.ObjectID, SelectionOption.Normal);
var aux2 = aux.GetObjectIDs();
//ids = fc.Select(filter, SelectionType.ObjectID, SelectionOption.Normal).GetObjectIDs().ToList();
ids = aux2.ToList();
}
catch (Exception ex)
{
@ -1490,6 +1494,8 @@ namespace OliviaAddInPro.Helper
OutStr = "Error al aplicar filtro espacial en exportación: "+ OutStr;
return false;
}
if (debug)
HelperGlobal.ponMsg("Número de líneas a exportar "+ids.Count);
/////////////////////////////////////////////////////////
if (cps.Getcancelled())
{
@ -1499,7 +1505,8 @@ namespace OliviaAddInPro.Helper
//convierte la lista de ids a string para la clause de la forma
//(id1, id2, id3..)
string whereClause = GetWhereClauseFromIds(ids,fc.GetDefinition().GetObjectIDField());
if (debug)
HelperGlobal.ponMsg(whereClause);
///////////////////////////////////////////////////////////
///Exporta
string[] args = { pathLayerIn, outpath, nameShp, whereClause };

View File

@ -253,7 +253,7 @@ namespace OliviaAddInPro.Services
//a todos los ámbitos y la instalación, ampliada un buffer, mayor si hay
//restricciones de circulación
geom_export = HelperGdb.BufferGeom(geom_export, com.BuffExport).Value;
if (geom_export == null)
if (geom_export == null || geom_export.IsEmpty)
{
ErrStr = "Error al añadir buffer a la geometría";
return false;
@ -369,10 +369,13 @@ namespace OliviaAddInPro.Services
ErrStr = Resource1.String_cancel_progreso;
return false;
}
com.ProgrSrc.IncMessage(10, "Termina de exportar red navegable");//60%
com.NombreShpExportNw_C = PREF_NAME_EXPORT_NW_CONJ + fechaHora + EXT_SHP;
OliviaGlob.Paths.PathNW_c = OliviaGlob.Paths.DirData + com.NombreShpExportNw_C;
if (ComunDef.CamposNW.config.revisa_conjunciones)
{
com.ProgrSrc.IncMessage(10, "Revisando conjunciones de la red");//60%
if (!HelperGdb.ExportShp2(OliviaGlob.Paths.PathGdbNw_conj, filtroEspacial, com.NombreShpExportNw_C, OliviaGlob.Paths.DirData, com.ProgrSrc._ProgrSrc, spatRefData, 100))
{
ErrStr = "Error al exportar la red navegable: " + HelperGdb.OutStr;
@ -386,6 +389,7 @@ namespace OliviaAddInPro.Services
}
//prepara campos estandar
com.ProgrSrc.IncMessage(10, "Estandarizando campos de la red");//60%
if (!EstandarizaCamposNW(OliviaGlob.Paths.DirData+com.NombreShpExportNw))
{
ErrStr = "Error al estandarizar campos red navegable: " + HelperGdb.OutStr;

View File

@ -74,7 +74,7 @@ namespace OliviaAddInPro.Services
{
nombFileAmbs = string.Empty;
limp.ConsultaAmbs = DameAmbsConsulta(out nombFileAmbs);
if (string.IsNullOrEmpty(limp.ConsultaAmbs))
if (null==limp.ConsultaAmbs)
{
return false;
}