My Project
 All Classes Namespaces Files Functions Variables Enumerations Enumerator Friends Macros
Public Attributes | List of all members
mapdata Struct Reference

Stores a submap of the netcdf GRD data. More...

#include <mapio.h>

Public Attributes

double xcenter
 
double ycenter
 
double * xpts
 
size_t xdimlen
 
double * ypts
 
size_t ydimlen
 
float * z
 
int status
 

Detailed Description

Stores a submap of the netcdf GRD data.

Parameters
xcenterThe X (Easting in meters) center coordinate provided by user
ycenterThe Y (Northing in meters) center coordinate provided by user
xptsA pointer to a 1D array of the easting coordinate variable data
xdimlenThe number of values in x
yptsA pointer to a 1D array of the northing coordinate variable data
ydimlenThe number of values in y
zA pointer to a submap sized (ydimlen, xdimlen)
statusTHe status of the structure

This structure stores a submap retrieved from a GMT GRD file. Functions for working with this file are mapdata_fill and mapdata_free. Here's a code snippet that shows accessing the array:

struct mapdata data
 float *z;
 float value;
 int i, j;
 z = data->z;
 i = data->ydimlen;
 j = data->xdimlen;
 for (i = 0; i < rows; i++) {
 for (j = 0; j < columns; j++) {
 value = z[i * columns + j];
 fprintf(stdout, "%f\t", value);
 }
 fprintf(stdout, "\n");
 }
 

Member Data Documentation

int mapdata::status
double mapdata::xcenter
size_t mapdata::xdimlen
double* mapdata::xpts
double mapdata::ycenter
size_t mapdata::ydimlen
double* mapdata::ypts
float* mapdata::z

The documentation for this struct was generated from the following file: