Skip to content

Commit

Permalink
ADMIN1 BOUNDARIES - only plot regions in Italy MAGP-1214
Browse files Browse the repository at this point in the history
Change admin1 shapefiles (lines instead of polygons) and removed shape files not needed anymore
  • Loading branch information
StephanSiemen committed Nov 26, 2019
1 parent d0ec9f3 commit 2c156ba
Show file tree
Hide file tree
Showing 25 changed files with 19 additions and 12 deletions.

This file was deleted.

Binary file removed share/magics/10m/ne_10m_admin_1_states_provinces.shp
Binary file not shown.
Binary file removed share/magics/10m/ne_10m_admin_1_states_provinces.shx
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
4.1.0
Binary file not shown.
Binary file not shown.
Binary file not shown.

This file was deleted.

Binary file not shown.
1 change: 0 additions & 1 deletion share/magics/110m/ne_110m_admin_1_states_provinces.prj

This file was deleted.

Binary file removed share/magics/110m/ne_110m_admin_1_states_provinces.sbn
Binary file not shown.
Binary file removed share/magics/110m/ne_110m_admin_1_states_provinces.sbx
Binary file not shown.
Binary file not shown.
Binary file removed share/magics/110m/ne_110m_admin_1_states_provinces.shx
Binary file not shown.

This file was deleted.

Binary file not shown.

This file was deleted.

Binary file not shown.
Binary file not shown.
2 changes: 1 addition & 1 deletion src/common/GeoRectangularProjection.cc
Original file line number Diff line number Diff line change
Expand Up @@ -499,7 +499,7 @@ void GeoRectangularProjection::coastSetting(map<string, string>& setting, double
setting["boundaries"] = resol + "/ne_" + resol + "_admin_0_boundary_lines_land";

//! \note Administraive borders hardcoded to 10m resolution (low res version do not contain all info)
setting["administrative_boundaries"] = "10m/ne_10m_admin_1_states_provinces";
setting["administrative_boundaries"] = "10m/ne_10m_admin_1_states_provinces_lines";

MagLog::dev() << "GeoRectangularProjection::coastSetting[" << abswidth << ", " << absheight << "]->" << ratio
<< " resol: " << resol << endl;
Expand Down
2 changes: 1 addition & 1 deletion src/common/PolarStereographicProjection.cc
Original file line number Diff line number Diff line change
Expand Up @@ -821,7 +821,7 @@ void PolarStereographicProjection::coastSetting(map<string, string>& setting, do
setting["boundaries"] = resol + "/ne_" + resol + "_admin_0_boundary_lines_land";

//! \note Administraive borders hardcoded to 10m resolution (low res version do not contain all info)
setting["administrative_boundaries"] = "10m/ne_10m_admin_1_states_provinces";
setting["administrative_boundaries"] = "10m/ne_10m_admin_1_states_provinces_lines";

MagLog::dev() << "GeoRectangularProjection::coastSetting[" << abswidth << ", " << absheight << "]->" << ratio
<< " resol: " << resol << endl;
Expand Down
4 changes: 2 additions & 2 deletions src/common/Proj4Projection.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1180,10 +1180,10 @@ void Proj4Projection::coastSetting(map<string, string>& setting, double abswidth
setting["coast"] = resol + "/ne_" + resol + "_coastline";
setting["rivers"] = resol + "/ne_" + resol + "_rivers_lake_centerlines";
setting["boundaries"] = resol + "/ne_" + resol + "_admin_0_boundary_lines_land";
setting["administrative_boundaries"] = resol + "/ne_" + resol + "_admin_1_states_provinces";
// setting["administrative_boundaries"] = resol + "/ne_" + resol + "_admin_1_states_provinces";

//! \note Administraive borders hardcoded to 10m resolution (low res version do not contain all info)
setting["administrative_boundaries"] = "10m/ne_10m_admin_1_states_provinces";
setting["administrative_boundaries"] = "10m/ne_10m_admin_1_states_provinces_lines";
}

void Proj4Projection::visit(MetaDataVisitor& visitor, double left, double top, double width, double height,
Expand Down
15 changes: 13 additions & 2 deletions src/decoders/ShapeDecoder.cc
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,7 @@ void ShapeDecoder::customisedPoints(const std::set<string>&, CustomisedPointsLis
}

/*
Read boundaries ...
\sa Boundaries::operator()
*/
Expand Down Expand Up @@ -187,8 +188,18 @@ void ShapeDecoder::decode(const Transformation& transformation, const string& fi
for (vector<string>::const_iterator val = values.begin(); val != values.end(); ++val) {
string ss = s.substr(0, val->length());
if (magCompare(*val, ss)) {
add = true;
MagLog::debug() << "Found " << ss << endl;
if (magCompare(ss,"ITA")) {
MagLog::debug() << "Enter special case for regions in Italy MAGP-1214" << endl;
map<string, int>::iterator index_class = attributes.find("featurecla");
string type = DBFReadStringAttribute(hDBF, i, index_class->second);
map<string, int>::iterator index = filter.empty() ? attributes.end() : attributes.find(filter);
if(magCompare(type,"Admin-1 boundary")){
add = false;
}
else add = true;
}
else add = true;
// MagLog::debug() << "Found " << ss << endl;
break;
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/visualisers/CoastPlotting.cc
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,7 @@ void CoastPlotting::operator()(DrawingVisitor& parent) {
coast_.clear();
ocean_.clear();

coastSet_["administrative_boundaries"] = "10m/ne_10m_admin_1_states_provinces";
coastSet_["administrative_boundaries"] = "10m/ne_10m_admin_1_states_provinces_lines";

if (magCompare(NoCoastPlottingAttributes::resolution_, "high") ||
magCompare(NoCoastPlottingAttributes::resolution_, "full")) {
Expand Down

0 comments on commit 2c156ba

Please sign in to comment.