From d7e0a0d4ce0bf907ca653122bd714dbe2256ef7c Mon Sep 17 00:00:00 2001 From: Sylvie Lamy-Thepaut Date: Thu, 12 Oct 2023 15:45:21 +0100 Subject: [PATCH] Opencharts : adding cache files for opencharts Projections , wind and symbol --- src/decoders/TileDecoder.cc | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/src/decoders/TileDecoder.cc b/src/decoders/TileDecoder.cc index 4731b58c..1244c10a 100644 --- a/src/decoders/TileDecoder.cc +++ b/src/decoders/TileDecoder.cc @@ -68,6 +68,7 @@ string TileDecoder::positions() { } if (mode_ == "opencharts" ) out << parent << "/opencharts-wind-" << grid_ << ".nc"; + else out << parent << "/wind-" << grid_ << "-" << projection() << "-z" + tostring(z_) << ".nc"; @@ -175,7 +176,6 @@ void TileDecoder::customisedPoints(const Transformation& transformation, const s CustomisedPointsList& out, bool all) { string path = positions(); Timer timer("Tile", path); - #ifdef HAVE_NETCDF Netcdf netcdf(path, "index"); @@ -235,15 +235,16 @@ void TileDecoder::customisedPoints(const Transformation& transformation, const s double i = *b; if (i != 0) { - if (lon > 180) - lon -= 360; + if ( mode_ != "opencharts") { + if (lon > 180) + lon -= 360; + } latitudes.push_back(lat); longitudes.push_back(lon); index.push_back(i); } } - { vector uc; uc.reserve(index.size()); @@ -265,6 +266,7 @@ void TileDecoder::customisedPoints(const Transformation& transformation, const s point->insert(make_pair("y_component", *vx)); out.push_back(point); point->tile(true); + ux++; vx++; lat++; @@ -341,8 +343,10 @@ PointsHandler& TileDecoder::points(const Transformation& t, bool) { double i = *b; if (i != 0) { - if (lon > 180) - lon -= 360; + if ( mode_ != "opencharts") { + if (lon > 180) + lon -= 360; + } latitudes.push_back(lat); longitudes.push_back(lon); index.push_back(i);