TECA
The Toolkit for Extreme Climate Analysis
teca_shape_file_util.h File Reference
#include "teca_config.h"
#include "teca_binary_stream.h"
#include "teca_geometry.h"
#include "teca_mpi.h"
#include <string>
#include <vector>
#include <ostream>
#include <shapefil.h>
Include dependency graph for teca_shape_file_util.h:

Go to the source code of this file.

Functions

TECA_EXPORT const char * teca_shape_file_util::shape_type_name (int shpt)
 Get a string with the name of the shape type. More...
 
TECA_EXPORT std::ostream & teca_shape_file_util::operator<< (std::ostream &os, const SHPObject &obj)
 Send the shape object to the stream in a human readable form. More...
 
template<typename coord_t >
TECA_EXPORT int teca_shape_file_util::load_polygons (const std::string &filename, std::vector< teca_geometry::polygon< coord_t >> &polys, int normalize=0, int verbose=0)
 Read polygons from the given file. More...
 
template<typename coord_t >
TECA_EXPORT int teca_shape_file_util::load_polygons (MPI_Comm comm, const std::string &filename, std::vector< teca_geometry::polygon< coord_t >> &polys, int normalize=0, int verbose=0)
 

Function Documentation

◆ load_polygons() [1/2]

template<typename coord_t >
TECA_EXPORT int teca_shape_file_util::load_polygons ( const std::string &  filename,
std::vector< teca_geometry::polygon< coord_t >> &  polys,
int  normalize = 0,
int  verbose = 0 
)

Read polygons from the given file.

◆ load_polygons() [2/2]

template<typename coord_t >
TECA_EXPORT int teca_shape_file_util::load_polygons ( MPI_Comm  comm,
const std::string &  filename,
std::vector< teca_geometry::polygon< coord_t >> &  polys,
int  normalize = 0,
int  verbose = 0 
)

Read polygons from the given file. MPI rank 0 reads and broadcasts to the other ranks in the job

◆ operator<<()

TECA_EXPORT std::ostream& teca_shape_file_util::operator<< ( std::ostream &  os,
const SHPObject &  obj 
)

Send the shape object to the stream in a human readable form.

◆ shape_type_name()

TECA_EXPORT const char* teca_shape_file_util::shape_type_name ( int  shpt)

Get a string with the name of the shape type.