@@ -241,7 +241,7 @@ void metdata::load_from_netcdf(const std::string& path, const triangulation::bou
241
241
242
242
SPDLOG_DEBUG (" Initializing datastructure" );
243
243
244
- std::vector<std::tuple< float , float >> xy;
244
+
245
245
auto e = _nc->get_z ();
246
246
247
247
// #pragma omp parallel for
@@ -321,12 +321,12 @@ void metdata::load_from_netcdf(const std::string& path, const triangulation::bou
321
321
322
322
_dD_tree.insert ( boost::make_tuple (Kernel::Point_2 (s->x (),s->y ()),s) );
323
323
324
- xy. emplace_back (longitude, latitude);
324
+
325
325
}
326
326
}
327
327
SPDLOG_DEBUG (" Done initializing datastructure" );
328
- gis::xy2shp (xy, " forcing_points.shp " , _mesh_proj4);
329
- SPDLOG_DEBUG (" This rank is using # grid cells = {}" , xy .size ());
328
+
329
+ SPDLOG_DEBUG (" This rank is using # grid cells = {}" , _stations .size ());
330
330
if ( skipped == _nstations)
331
331
{
332
332
CHM_THROW_EXCEPTION (forcing_error,
@@ -825,4 +825,15 @@ std::vector< std::shared_ptr<station>>& metdata::stations()
825
825
bool metdata::is_multipart_nc ()
826
826
{
827
827
return _is_multipart_nc;
828
+ }
829
+
830
+ void metdata::write_stations_to_shp (const std::string& fname)
831
+ {
832
+ std::vector<std::tuple<float , float >> xy;
833
+ for (auto itr: _stations)
834
+ {
835
+ if (itr)
836
+ xy.emplace_back (itr->x (), itr->y ());
837
+ }
838
+ gis::xy2shp (xy, fname, _mesh_proj4);
828
839
}
0 commit comments