Econtrado fallo falta reproyectar datos

Elena/develop
Elena 2022-03-28 21:46:48 +02:00
parent 00182b5260
commit 835fbf3f96
4 changed files with 45 additions and 3 deletions

View File

@ -110,6 +110,18 @@ namespace OliviaAddInPro.Helper
return geomsal; 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 //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 se cancela o no es una feature class lo que se ha abierto devuelve null
//si no, devuelve la featureclass directamente abierta //si no, devuelve la featureclass directamente abierta

View File

@ -68,9 +68,19 @@ namespace OliviaAddInPro.Services
ErrStr = "No se ha podido generar geometría de los ámbitos" + com.ConsultaAmbs + ErrStr; ErrStr = "No se ha podido generar geometría de los ámbitos" + com.ConsultaAmbs + ErrStr;
return false; return false;
} }
//crea el filtro de exportación
//mira spatialreference de los datos de entrada //mira spatialreference de los datos de entrada
spatRef = geom_export.SpatialReference; 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); filtroEspacial = HelperGdb.CreateFiler(com.ConsultaAmbs, geom_export);
if (filtroEspacial == null) if (filtroEspacial == null)
{ {
@ -191,6 +201,20 @@ 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 //Hace el filtro con la geometría final
filtroEspacial = HelperGdb.CreateFiler(String.Empty, geom_export); filtroEspacial = HelperGdb.CreateFiler(String.Empty, geom_export);
if (filtroEspacial == null) if (filtroEspacial == null)

View File

@ -19,7 +19,7 @@
<ComboBox Margin="10,5,9.6,0" <ComboBox Margin="10,5,9.6,0"
ItemsSource="{Binding Path=Fields}" Name="comboBoxFields" SelectedItem="{Binding Path=SelField, Mode = TwoWay}" SelectedIndex="{Binding Path=SelIndx, Mode = TwoWay}" SelectionChanged="comboBoxFields_SelectionChanged"/> ItemsSource="{Binding Path=Fields}" Name="comboBoxFields" SelectedItem="{Binding Path=SelField, Mode = TwoWay}" SelectedIndex="{Binding Path=SelIndx, Mode = TwoWay}" SelectionChanged="comboBoxFields_SelectionChanged"/>
<Label Margin="15,0,0,0" Content="Atributo"/> <Label Margin="15,0,0,0" Content="Atributo"/>
<ListBox Margin="10,5,9.6,0" Height="127" ItemsSource="{Binding Path=Attributes}" Name="listBoxAttributes" SelectionMode="{Binding SelMode}"/> <ListBox Margin="10,5,9.6,0" Height="127" ItemsSource="{Binding Path=Attributes}" Name="listBoxAttributes" SelectionMode="{Binding SelMode}" MouseDoubleClick="listBoxAttributes_MouseDoubleClick"/>
<Button Margin="167,25,9.6,0" Content="Aceptar" Opacity="0.75" Click="Button_Click"/> <Button Margin="167,25,9.6,0" Content="Aceptar" Opacity="0.75" Click="Button_Click"/>
</StackPanel> </StackPanel>
</controls:ProWindow> </controls:ProWindow>

View File

@ -77,5 +77,11 @@ namespace OliviaAddInPro.View
else else
DialogResult = false; DialogResult = false;
} }
private void listBoxAttributes_MouseDoubleClick(object sender, MouseButtonEventArgs e)
{
ok = true;
Close();
}
} }
} }