diff --git a/Helper/HelperGdb.cs b/Helper/HelperGdb.cs index f653010..99ab2e9 100644 --- a/Helper/HelperGdb.cs +++ b/Helper/HelperGdb.cs @@ -110,6 +110,18 @@ namespace OliviaAddInPro.Helper return geomsal; } + /** + * Devuelve el sistema de coordenadas de una capa + */ + public static int GetCoorSys(string ftclasspath) + { + FeatureClass fc = GetFtClass(ftclasspath); + if (fc == null) + return -1; + ArcGIS.Core.Geometry.SpatialReference spatref = fc.GetDefinition().GetSpatialReference(); + return spatref.Wkid; + } + //Dado el tipo de FtClass y una posición inicial abre un diálogo de búsqueda de ftclass //si se cancela o no es una feature class lo que se ha abierto devuelve null //si no, devuelve la featureclass directamente abierta diff --git a/Services/EjecServ.cs b/Services/EjecServ.cs index 824193c..96aa207 100644 --- a/Services/EjecServ.cs +++ b/Services/EjecServ.cs @@ -68,9 +68,19 @@ namespace OliviaAddInPro.Services ErrStr = "No se ha podido generar geometría de los ámbitos" + com.ConsultaAmbs + ErrStr; return false; } - //crea el filtro de exportación + //mira spatialreference de los datos de entrada spatRef = geom_export.SpatialReference; + //AQUÍ COMPARAR SI ES IGUAL QUE SPATREFDEF Y SI NO, REPROYECTAR + if(spatRef.Wkid!=GeneralDef.SpatRefDef) + { + /* + * FALTA HACER + * dame_geom_coords en v2010 + */ + } + + //crea el filtro de exportación filtroEspacial = HelperGdb.CreateFiler(com.ConsultaAmbs, geom_export); if (filtroEspacial == null) { @@ -190,7 +200,21 @@ namespace OliviaAddInPro.Services } } } - + + //mira spatialreference del nw + FeatureClass fc = HelperGdb.GetFtClass(OliviaGlob.Paths.PathGdbNw); + if (fc != null) + { + spatRef = fc.GetDefinition().GetSpatialReference(); + //AQUÍ COMPARAR SI ES IGUAL QUE SPATREFDEF Y SI NO, REPROYECTAR + if (spatRef.Wkid != GeneralDef.SpatRefDef) + { + /* + * FALTA HACER + */ + } + } + //Hace el filtro con la geometría final filtroEspacial = HelperGdb.CreateFiler(String.Empty, geom_export); if (filtroEspacial == null) diff --git a/View/ProWndSelectFields.xaml b/View/ProWndSelectFields.xaml index f5211a7..b88e9e0 100644 --- a/View/ProWndSelectFields.xaml +++ b/View/ProWndSelectFields.xaml @@ -19,7 +19,7 @@