"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "saga-gis/src/saga_core/saga_gui/wksp_map.cpp" between
saga-7.6.2_src.zip and saga-7.6.3_src.zip

About: SAGA (System for Automated Geoscientific Analyses) is a Geographic Information System (GIS) software for geodata processing and analysis. All source codes.

wksp_map.cpp  (saga-7.6.2_src):wksp_map.cpp  (saga-7.6.3_src)
skipping to change at line 608 skipping to change at line 608
20, 0, true 20, 0, true
); );
m_Img_Parms.Add_Bool("NODE_MAP", m_Img_Parms.Add_Bool("NODE_MAP",
"REF" , _TL("Save Georeference (world file)"), "REF" , _TL("Save Georeference (world file)"),
_TL(""), _TL(""),
true true
); );
m_Img_Parms.Add_Bool("NODE_MAP", m_Img_Parms.Add_Bool("NODE_MAP",
"KML" , _TL("Save KML file"), "KML" , _TL("Export Map to Google Earth"),
_TL(""), _TL(""),
true true
); );
m_Img_Parms.Add_Node("", m_Img_Parms.Add_Node("",
"NODE_LEGEND", _TL("Legend"), "NODE_LEGEND", _TL("Legend"),
_TL("") _TL("")
); );
m_Img_Parms.Add_Bool("NODE_LEGEND", m_Img_Parms.Add_Bool("NODE_LEGEND",
skipping to change at line 1602 skipping to change at line 1602
void CWKSP_Map::SaveAs_Image_To_KMZ(int nx, int ny) void CWKSP_Map::SaveAs_Image_To_KMZ(int nx, int ny)
{ {
if( nx < 1 || ny < 1 ) if( nx < 1 || ny < 1 )
{ {
return; return;
} }
//----------------------------------------------------- //-----------------------------------------------------
CSG_Rect Extent(Get_Extent()); CSG_Rect Extent(Get_Extent());
CSG_Parameters P(_TL("Save Map to KMZ")); CSG_Parameters P(_TL("Export Map to Google Earth"));
P.Add_FilePath("", "FILE" , _TL("File" ), _TL(""), CSG_String::Form at("%s|*.kmz|%s|*.*", _TL("KMZ Files"), _TL("All Files")), NULL, true); P.Add_FilePath("", "FILE" , _TL("File" ), _TL(""), CSG_String::Form at("%s|*.kmz|%s|*.*", _TL("KMZ Files"), _TL("All Files")), NULL, true);
P.Add_Double ("", "CELLSIZE", _TL("Cellsize"), _TL(""), SG_Get_Rounded_T o_SignificantFigures(Extent.Get_XRange() / (double)nx, 2), 0., true); P.Add_Double ("", "CELLSIZE", _TL("Cellsize"), _TL(""), SG_Get_Rounded_T o_SignificantFigures(Extent.Get_XRange() / (double)nx, 2), 0., true);
P.Add_Bool ("", "LOAD" , _TL("Load" ), _TL(""), true); P.Add_Bool ("", "LOAD" , _TL("Load" ), _TL(""), true);
if( !DLG_Parameters(&P) || P("CELLSIZE")->asDouble() <= 0. ) if( !DLG_Parameters(&P) || P("CELLSIZE")->asDouble() <= 0. )
{ {
return; return;
} }
wxFileName FileName(P("FILE")->asString()); wxFileName FileName(P("FILE")->asString());
if( !FileName.IsOk() ) if( !FileName.IsOk() )
{ {
FileName.AssignTempFileName("saga_map"); FileName.AssignTempFileName("saga_map");
FileName.SetExt("kmz"); FileName.SetExt("kmz");
if( !FileName.IsOk() ) if( !FileName.IsOk() )
{ {
DLG_Message_Show_Error(_TL("invalid file name"), _TL("Sav e Map to KMZ")); DLG_Message_Show_Error(_TL("invalid file name"), _TL("Exp ort Map to Google Earth"));
return; return;
} }
} }
//----------------------------------------------------- //-----------------------------------------------------
nx = Extent.Get_XRange() / P("CELLSIZE")->asDouble(); nx = Extent.Get_XRange() / P("CELLSIZE")->asDouble();
ny = Extent.Get_YRange() / P("CELLSIZE")->asDouble(); ny = Extent.Get_YRange() / P("CELLSIZE")->asDouble();
wxImage Image(nx, ny); wxImage Image(nx, ny);
skipping to change at line 1655 skipping to change at line 1655
for(int y=0, yy=Map.Get_NY()-1; y<Map.Get_NY(); y++, yy--) for(int y=0, yy=Map.Get_NY()-1; y<Map.Get_NY(); y++, yy--)
{ {
for(int x=0; x<Map.Get_NX(); x++) for(int x=0; x<Map.Get_NX(); x++)
{ {
Map.Set_Value(x, y, SG_GET_RGB(Image.GetRed(x, yy), Image .GetGreen(x, yy), Image.GetBlue(x, yy))); Map.Set_Value(x, y, SG_GET_RGB(Image.GetRed(x, yy), Image .GetGreen(x, yy), Image.GetBlue(x, yy)));
} }
} }
//----------------------------------------------------- //-----------------------------------------------------
bool bResult; CSG_Tool *pTool = SG_Get_Tool_Library_Manager().Create_Tool("io_g rid_image", 2, true);
SG_RUN_TOOL(bResult, "io_grid_image", 2, if( pTool && pTool->Settings_Push()
SG_TOOL_PARAMETER_SET("GRID" , &Map) && pTool->Set_Parameter("GRID" , &Map)
&& SG_TOOL_PARAMETER_SET("FILE" , FileName.GetFullPath() && pTool->Set_Parameter("FILE" , FileName.GetFullPath().wc_str())
.wc_str()) && pTool->Set_Parameter("COLOURING", 4) // rgb coded values
&& SG_TOOL_PARAMETER_SET("COLOURING", 4) // rgb coded valu && pTool->Set_Parameter("OUTPUT" , 2) // kmz file
es && pTool->Execute() && P("LOAD")->asBool() )
&& SG_TOOL_PARAMETER_SET("OUTPUT" , 2) // kmz file
);
if( bResult && P("LOAD")->asBool() )
{ {
Open_Application(FileName.GetFullPath()); Open_Application(FileName.GetFullPath());
} }
SG_Get_Tool_Library_Manager().Delete_Tool(pTool);\
} }
//--------------------------------------------------------- //---------------------------------------------------------
void CWKSP_Map::SaveAs_Image_To_Memory(int nx, int ny) void CWKSP_Map::SaveAs_Image_To_Memory(int nx, int ny)
{ {
if( nx < 1 || ny < 1 ) if( nx < 1 || ny < 1 )
return; return;
CSG_Rect Extent(Get_Extent()); CSG_Rect Extent(Get_Extent());
 End of changes. 6 change blocks. 
14 lines changed or deleted 12 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)