Skip to content

Commit

Permalink
Opencharts : adding cache files for opencharts Projections , wind and…
Browse files Browse the repository at this point in the history
… symbol
  • Loading branch information
sylvielamythepaut committed Oct 12, 2023
1 parent c6e7bc8 commit d7e0a0d
Showing 1 changed file with 10 additions and 6 deletions.
16 changes: 10 additions & 6 deletions src/decoders/TileDecoder.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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";

Expand Down Expand Up @@ -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");

Expand Down Expand Up @@ -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<double> uc;
uc.reserve(index.size());
Expand All @@ -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++;
Expand Down Expand Up @@ -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);
Expand Down

0 comments on commit d7e0a0d

Please sign in to comment.