mirror of https://github.com/ecmwf/eccodes.git
560 lines
29 KiB
HTML
560 lines
29 KiB
HTML
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
|
|
<html><head><meta http-equiv="Content-Type" content="text/html;charset=UTF-8">
|
|
<title>grib_api: Iterating on latitude/longitude/values</title>
|
|
<link href="doxygen.css" rel="stylesheet" type="text/css">
|
|
<link href="tabs.css" rel="stylesheet" type="text/css">
|
|
</head><body>
|
|
<!-- Generated by Doxygen 1.5.3 -->
|
|
<div class="tabs">
|
|
<ul>
|
|
<li><a href="index.html"><span>Main Page</span></a></li>
|
|
<li><a href="modules.html"><span>Modules</span></a></li>
|
|
<li><a href="files.html"><span>Files</span></a></li>
|
|
<li><a href="pages.html"><span>Related Pages</span></a></li>
|
|
<li><a href="examples.html"><span>Examples</span></a></li>
|
|
</ul>
|
|
</div>
|
|
<h1>Iterating on latitude/longitude/values</h1><table border="0" cellpadding="0" cellspacing="0">
|
|
<tr><td></td></tr>
|
|
<tr><td colspan="2"><br><h2>Functions</h2></td></tr>
|
|
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="el" href="grib__api_8h.html#8f20a42a04122a55dec71774c70a51c5">grib_iterator</a> * </td><td class="memItemRight" valign="bottom"><a class="el" href="group__iterators.html#gefb1f87110bdce732edc9154cf0e7d58">grib_iterator_new</a> (<a class="el" href="group__grib__handle.html#g309a5ee24f4c730646d3f80ad0ef5f1b">grib_handle</a> *h, unsigned long flags, int *error)</td></tr>
|
|
|
|
<tr><td class="mdescLeft"> </td><td class="mdescRight">Create a new iterator from a handle, using current geometry and values. <a href="#gefb1f87110bdce732edc9154cf0e7d58"></a><br></td></tr>
|
|
<tr><td class="memItemLeft" nowrap align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><a class="el" href="group__iterators.html#g4f73056dbfdda3de0060559b9b39ea34">grib_iterator_next</a> (<a class="el" href="grib__api_8h.html#8f20a42a04122a55dec71774c70a51c5">grib_iterator</a> *i, double *lat, double *lon, double *value)</td></tr>
|
|
|
|
<tr><td class="mdescLeft"> </td><td class="mdescRight">Get the next value from an iterator. <a href="#g4f73056dbfdda3de0060559b9b39ea34"></a><br></td></tr>
|
|
<tr><td class="memItemLeft" nowrap align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><a class="el" href="group__iterators.html#ge33e4a6d3a2222f78ffc43eb7239ce3f">grib_iterator_previous</a> (<a class="el" href="grib__api_8h.html#8f20a42a04122a55dec71774c70a51c5">grib_iterator</a> *i, double *lat, double *lon, double *value)</td></tr>
|
|
|
|
<tr><td class="mdescLeft"> </td><td class="mdescRight">Get the previous value from an iterator. <a href="#ge33e4a6d3a2222f78ffc43eb7239ce3f"></a><br></td></tr>
|
|
<tr><td class="memItemLeft" nowrap align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><a class="el" href="group__iterators.html#g7beddf03a8335d5058a0760929af9b65">grib_iterator_has_next</a> (<a class="el" href="grib__api_8h.html#8f20a42a04122a55dec71774c70a51c5">grib_iterator</a> *i)</td></tr>
|
|
|
|
<tr><td class="mdescLeft"> </td><td class="mdescRight">Test procedure for values in an iterator. <a href="#g7beddf03a8335d5058a0760929af9b65"></a><br></td></tr>
|
|
<tr><td class="memItemLeft" nowrap align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><a class="el" href="group__iterators.html#gb8f3830e919c3c11f11530c08e9956c8">grib_iterator_reset</a> (<a class="el" href="grib__api_8h.html#8f20a42a04122a55dec71774c70a51c5">grib_iterator</a> *i)</td></tr>
|
|
|
|
<tr><td class="mdescLeft"> </td><td class="mdescRight">Test procedure for values in an iterator. <a href="#gb8f3830e919c3c11f11530c08e9956c8"></a><br></td></tr>
|
|
<tr><td class="memItemLeft" nowrap align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><a class="el" href="group__iterators.html#gd46ed73a16af56e6f3b46fe86ee8a759">grib_iterator_delete</a> (<a class="el" href="grib__api_8h.html#8f20a42a04122a55dec71774c70a51c5">grib_iterator</a> *i)</td></tr>
|
|
|
|
<tr><td class="mdescLeft"> </td><td class="mdescRight">Frees an iterator from memory. <a href="#gd46ed73a16af56e6f3b46fe86ee8a759"></a><br></td></tr>
|
|
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="el" href="grib__api_8h.html#1b47558cfe02835ba44213ee4d45fd9b">grib_nearest</a> * </td><td class="memItemRight" valign="bottom"><a class="el" href="group__iterators.html#g4bd616cf0d0c4f5f147f4a207ddc7687">grib_nearest_new</a> (<a class="el" href="group__grib__handle.html#g309a5ee24f4c730646d3f80ad0ef5f1b">grib_handle</a> *h, int *error)</td></tr>
|
|
|
|
<tr><td class="mdescLeft"> </td><td class="mdescRight">Create a new nearest from a handle, using current geometry . <a href="#g4bd616cf0d0c4f5f147f4a207ddc7687"></a><br></td></tr>
|
|
<tr><td class="memItemLeft" nowrap align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><a class="el" href="group__iterators.html#g15043a2482608fb93a0385f3c3e86926">grib_nearest_find</a> (<a class="el" href="grib__api_8h.html#1b47558cfe02835ba44213ee4d45fd9b">grib_nearest</a> *nearest, <a class="el" href="group__grib__handle.html#g309a5ee24f4c730646d3f80ad0ef5f1b">grib_handle</a> *h, double inlat, double inlon, unsigned long flags, double *outlats, double *outlons, double *values, double *distances, int *indexes, size_t *len)</td></tr>
|
|
|
|
<tr><td class="mdescLeft"> </td><td class="mdescRight">Find the 4 nearest points of a latitude longitude point. <a href="#g15043a2482608fb93a0385f3c3e86926"></a><br></td></tr>
|
|
<tr><td class="memItemLeft" nowrap align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><a class="el" href="group__iterators.html#g2b3c0069013e1ad7b3e34f30b4659c15">grib_nearest_delete</a> (<a class="el" href="grib__api_8h.html#1b47558cfe02835ba44213ee4d45fd9b">grib_nearest</a> *nearest)</td></tr>
|
|
|
|
<tr><td class="mdescLeft"> </td><td class="mdescRight">Frees an nearest from memory. <a href="#g2b3c0069013e1ad7b3e34f30b4659c15"></a><br></td></tr>
|
|
<tr><td class="memItemLeft" nowrap align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><a class="el" href="group__iterators.html#g4923d7a2e414c743410f1de71bb9648c">grib_nearest_find_multiple</a> (<a class="el" href="group__grib__handle.html#g309a5ee24f4c730646d3f80ad0ef5f1b">grib_handle</a> *h, int is_lsm, double *inlats, double *inlons, long npoints, double *outlats, double *outlons, double *values, double *distances, int *indexes)</td></tr>
|
|
|
|
<tr><td class="mdescLeft"> </td><td class="mdescRight">Find the nearest point of a set of points whose latitudes and longitudes are given in the inlats, inlons arrays respectively. <a href="#g4923d7a2e414c743410f1de71bb9648c"></a><br></td></tr>
|
|
</table>
|
|
<hr><a name="_details"></a><h2>Detailed Description</h2>
|
|
<hr><h2>Function Documentation</h2>
|
|
<a class="anchor" name="gd46ed73a16af56e6f3b46fe86ee8a759"></a><!-- doxytag: member="grib_api.h::grib_iterator_delete" ref="gd46ed73a16af56e6f3b46fe86ee8a759" args="(grib_iterator *i)" -->
|
|
<div class="memitem">
|
|
<div class="memproto">
|
|
<table class="memname">
|
|
<tr>
|
|
<td class="memname">int grib_iterator_delete </td>
|
|
<td>(</td>
|
|
<td class="paramtype"><a class="el" href="grib__api_8h.html#8f20a42a04122a55dec71774c70a51c5">grib_iterator</a> * </td>
|
|
<td class="paramname"> <em>i</em> </td>
|
|
<td> ) </td>
|
|
<td width="100%"></td>
|
|
</tr>
|
|
</table>
|
|
</div>
|
|
<div class="memdoc">
|
|
|
|
<p>
|
|
Frees an iterator from memory.
|
|
<p>
|
|
<dl compact><dt><b>Parameters:</b></dt><dd>
|
|
<table border="0" cellspacing="2" cellpadding="0">
|
|
<tr><td valign="top"></td><td valign="top"><em>i</em> </td><td>: the iterator </td></tr>
|
|
</table>
|
|
</dl>
|
|
<dl class="return" compact><dt><b>Returns:</b></dt><dd>0 if OK, integer value on error </dd></dl>
|
|
<dl compact><dt><b>Examples: </b></dt><dd>
|
|
<a class="el" href="iterator_8c-example.html#a7">iterator.c</a>, and <a class="el" href="iterator__fortran_8_f-example.html#a2">iterator_fortran.F</a>.</dl>
|
|
</div>
|
|
</div><p>
|
|
<a class="anchor" name="g7beddf03a8335d5058a0760929af9b65"></a><!-- doxytag: member="grib_api.h::grib_iterator_has_next" ref="g7beddf03a8335d5058a0760929af9b65" args="(grib_iterator *i)" -->
|
|
<div class="memitem">
|
|
<div class="memproto">
|
|
<table class="memname">
|
|
<tr>
|
|
<td class="memname">int grib_iterator_has_next </td>
|
|
<td>(</td>
|
|
<td class="paramtype"><a class="el" href="grib__api_8h.html#8f20a42a04122a55dec71774c70a51c5">grib_iterator</a> * </td>
|
|
<td class="paramname"> <em>i</em> </td>
|
|
<td> ) </td>
|
|
<td width="100%"></td>
|
|
</tr>
|
|
</table>
|
|
</div>
|
|
<div class="memdoc">
|
|
|
|
<p>
|
|
Test procedure for values in an iterator.
|
|
<p>
|
|
<dl compact><dt><b>Parameters:</b></dt><dd>
|
|
<table border="0" cellspacing="2" cellpadding="0">
|
|
<tr><td valign="top"></td><td valign="top"><em>i</em> </td><td>: the iterator </td></tr>
|
|
</table>
|
|
</dl>
|
|
<dl class="return" compact><dt><b>Returns:</b></dt><dd>boolean, 1 if the iterator still nave next values, 0 otherwise </dd></dl>
|
|
|
|
</div>
|
|
</div><p>
|
|
<a class="anchor" name="gefb1f87110bdce732edc9154cf0e7d58"></a><!-- doxytag: member="grib_api.h::grib_iterator_new" ref="gefb1f87110bdce732edc9154cf0e7d58" args="(grib_handle *h, unsigned long flags, int *error)" -->
|
|
<div class="memitem">
|
|
<div class="memproto">
|
|
<table class="memname">
|
|
<tr>
|
|
<td class="memname"><a class="el" href="grib__api_8h.html#8f20a42a04122a55dec71774c70a51c5">grib_iterator</a>* grib_iterator_new </td>
|
|
<td>(</td>
|
|
<td class="paramtype"><a class="el" href="group__grib__handle.html#g309a5ee24f4c730646d3f80ad0ef5f1b">grib_handle</a> * </td>
|
|
<td class="paramname"> <em>h</em>, </td>
|
|
</tr>
|
|
<tr>
|
|
<td class="paramkey"></td>
|
|
<td></td>
|
|
<td class="paramtype">unsigned long </td>
|
|
<td class="paramname"> <em>flags</em>, </td>
|
|
</tr>
|
|
<tr>
|
|
<td class="paramkey"></td>
|
|
<td></td>
|
|
<td class="paramtype">int * </td>
|
|
<td class="paramname"> <em>error</em></td><td> </td>
|
|
</tr>
|
|
<tr>
|
|
<td></td>
|
|
<td>)</td>
|
|
<td></td><td></td><td width="100%"></td>
|
|
</tr>
|
|
</table>
|
|
</div>
|
|
<div class="memdoc">
|
|
|
|
<p>
|
|
Create a new iterator from a handle, using current geometry and values.
|
|
<p>
|
|
<dl compact><dt><b>Parameters:</b></dt><dd>
|
|
<table border="0" cellspacing="2" cellpadding="0">
|
|
<tr><td valign="top"></td><td valign="top"><em>h</em> </td><td>: the handle from which the iterator will be created </td></tr>
|
|
<tr><td valign="top"></td><td valign="top"><em>flags</em> </td><td>: flags for future use. </td></tr>
|
|
<tr><td valign="top"></td><td valign="top"><em>error</em> </td><td>: error code </td></tr>
|
|
</table>
|
|
</dl>
|
|
<dl class="return" compact><dt><b>Returns:</b></dt><dd>the new iterator, NULL if no iterator can be created </dd></dl>
|
|
<dl compact><dt><b>Examples: </b></dt><dd>
|
|
<a class="el" href="iterator_8c-example.html#a5">iterator.c</a>, and <a class="el" href="iterator__fortran_8_f-example.html#a0">iterator_fortran.F</a>.</dl>
|
|
</div>
|
|
</div><p>
|
|
<a class="anchor" name="g4f73056dbfdda3de0060559b9b39ea34"></a><!-- doxytag: member="grib_api.h::grib_iterator_next" ref="g4f73056dbfdda3de0060559b9b39ea34" args="(grib_iterator *i, double *lat, double *lon, double *value)" -->
|
|
<div class="memitem">
|
|
<div class="memproto">
|
|
<table class="memname">
|
|
<tr>
|
|
<td class="memname">int grib_iterator_next </td>
|
|
<td>(</td>
|
|
<td class="paramtype"><a class="el" href="grib__api_8h.html#8f20a42a04122a55dec71774c70a51c5">grib_iterator</a> * </td>
|
|
<td class="paramname"> <em>i</em>, </td>
|
|
</tr>
|
|
<tr>
|
|
<td class="paramkey"></td>
|
|
<td></td>
|
|
<td class="paramtype">double * </td>
|
|
<td class="paramname"> <em>lat</em>, </td>
|
|
</tr>
|
|
<tr>
|
|
<td class="paramkey"></td>
|
|
<td></td>
|
|
<td class="paramtype">double * </td>
|
|
<td class="paramname"> <em>lon</em>, </td>
|
|
</tr>
|
|
<tr>
|
|
<td class="paramkey"></td>
|
|
<td></td>
|
|
<td class="paramtype">double * </td>
|
|
<td class="paramname"> <em>value</em></td><td> </td>
|
|
</tr>
|
|
<tr>
|
|
<td></td>
|
|
<td>)</td>
|
|
<td></td><td></td><td width="100%"></td>
|
|
</tr>
|
|
</table>
|
|
</div>
|
|
<div class="memdoc">
|
|
|
|
<p>
|
|
Get the next value from an iterator.
|
|
<p>
|
|
<dl compact><dt><b>Parameters:</b></dt><dd>
|
|
<table border="0" cellspacing="2" cellpadding="0">
|
|
<tr><td valign="top"></td><td valign="top"><em>i</em> </td><td>: the iterator </td></tr>
|
|
<tr><td valign="top"></td><td valign="top"><em>lat</em> </td><td>: on output latitude in degree </td></tr>
|
|
<tr><td valign="top"></td><td valign="top"><em>lon</em> </td><td>: on output longitude in degree </td></tr>
|
|
<tr><td valign="top"></td><td valign="top"><em>value</em> </td><td>: on output value of the point </td></tr>
|
|
</table>
|
|
</dl>
|
|
<dl class="return" compact><dt><b>Returns:</b></dt><dd>positive value if successful, 0 if no more data are available </dd></dl>
|
|
<dl compact><dt><b>Examples: </b></dt><dd>
|
|
<a class="el" href="iterator_8c-example.html#a6">iterator.c</a>, and <a class="el" href="iterator__fortran_8_f-example.html#a1">iterator_fortran.F</a>.</dl>
|
|
</div>
|
|
</div><p>
|
|
<a class="anchor" name="ge33e4a6d3a2222f78ffc43eb7239ce3f"></a><!-- doxytag: member="grib_api.h::grib_iterator_previous" ref="ge33e4a6d3a2222f78ffc43eb7239ce3f" args="(grib_iterator *i, double *lat, double *lon, double *value)" -->
|
|
<div class="memitem">
|
|
<div class="memproto">
|
|
<table class="memname">
|
|
<tr>
|
|
<td class="memname">int grib_iterator_previous </td>
|
|
<td>(</td>
|
|
<td class="paramtype"><a class="el" href="grib__api_8h.html#8f20a42a04122a55dec71774c70a51c5">grib_iterator</a> * </td>
|
|
<td class="paramname"> <em>i</em>, </td>
|
|
</tr>
|
|
<tr>
|
|
<td class="paramkey"></td>
|
|
<td></td>
|
|
<td class="paramtype">double * </td>
|
|
<td class="paramname"> <em>lat</em>, </td>
|
|
</tr>
|
|
<tr>
|
|
<td class="paramkey"></td>
|
|
<td></td>
|
|
<td class="paramtype">double * </td>
|
|
<td class="paramname"> <em>lon</em>, </td>
|
|
</tr>
|
|
<tr>
|
|
<td class="paramkey"></td>
|
|
<td></td>
|
|
<td class="paramtype">double * </td>
|
|
<td class="paramname"> <em>value</em></td><td> </td>
|
|
</tr>
|
|
<tr>
|
|
<td></td>
|
|
<td>)</td>
|
|
<td></td><td></td><td width="100%"></td>
|
|
</tr>
|
|
</table>
|
|
</div>
|
|
<div class="memdoc">
|
|
|
|
<p>
|
|
Get the previous value from an iterator.
|
|
<p>
|
|
<dl compact><dt><b>Parameters:</b></dt><dd>
|
|
<table border="0" cellspacing="2" cellpadding="0">
|
|
<tr><td valign="top"></td><td valign="top"><em>i</em> </td><td>: the iterator </td></tr>
|
|
<tr><td valign="top"></td><td valign="top"><em>lat</em> </td><td>: on output latitude in degree </td></tr>
|
|
<tr><td valign="top"></td><td valign="top"><em>lon</em> </td><td>: on output longitude in degree </td></tr>
|
|
<tr><td valign="top"></td><td valign="top"><em>value</em> </td><td>: on output value of the point* </td></tr>
|
|
</table>
|
|
</dl>
|
|
<dl class="return" compact><dt><b>Returns:</b></dt><dd>positive value if successful, 0 if no more data are available </dd></dl>
|
|
|
|
</div>
|
|
</div><p>
|
|
<a class="anchor" name="gb8f3830e919c3c11f11530c08e9956c8"></a><!-- doxytag: member="grib_api.h::grib_iterator_reset" ref="gb8f3830e919c3c11f11530c08e9956c8" args="(grib_iterator *i)" -->
|
|
<div class="memitem">
|
|
<div class="memproto">
|
|
<table class="memname">
|
|
<tr>
|
|
<td class="memname">int grib_iterator_reset </td>
|
|
<td>(</td>
|
|
<td class="paramtype"><a class="el" href="grib__api_8h.html#8f20a42a04122a55dec71774c70a51c5">grib_iterator</a> * </td>
|
|
<td class="paramname"> <em>i</em> </td>
|
|
<td> ) </td>
|
|
<td width="100%"></td>
|
|
</tr>
|
|
</table>
|
|
</div>
|
|
<div class="memdoc">
|
|
|
|
<p>
|
|
Test procedure for values in an iterator.
|
|
<p>
|
|
<dl compact><dt><b>Parameters:</b></dt><dd>
|
|
<table border="0" cellspacing="2" cellpadding="0">
|
|
<tr><td valign="top"></td><td valign="top"><em>i</em> </td><td>: the iterator </td></tr>
|
|
</table>
|
|
</dl>
|
|
<dl class="return" compact><dt><b>Returns:</b></dt><dd>0 if OK, integer value on error </dd></dl>
|
|
|
|
</div>
|
|
</div><p>
|
|
<a class="anchor" name="g2b3c0069013e1ad7b3e34f30b4659c15"></a><!-- doxytag: member="grib_api.h::grib_nearest_delete" ref="g2b3c0069013e1ad7b3e34f30b4659c15" args="(grib_nearest *nearest)" -->
|
|
<div class="memitem">
|
|
<div class="memproto">
|
|
<table class="memname">
|
|
<tr>
|
|
<td class="memname">int grib_nearest_delete </td>
|
|
<td>(</td>
|
|
<td class="paramtype"><a class="el" href="grib__api_8h.html#1b47558cfe02835ba44213ee4d45fd9b">grib_nearest</a> * </td>
|
|
<td class="paramname"> <em>nearest</em> </td>
|
|
<td> ) </td>
|
|
<td width="100%"></td>
|
|
</tr>
|
|
</table>
|
|
</div>
|
|
<div class="memdoc">
|
|
|
|
<p>
|
|
Frees an nearest from memory.
|
|
<p>
|
|
<dl compact><dt><b>Parameters:</b></dt><dd>
|
|
<table border="0" cellspacing="2" cellpadding="0">
|
|
<tr><td valign="top"></td><td valign="top"><em>nearest</em> </td><td>: the nearest </td></tr>
|
|
</table>
|
|
</dl>
|
|
<dl class="return" compact><dt><b>Returns:</b></dt><dd>0 if OK, integer value on error </dd></dl>
|
|
<dl compact><dt><b>Examples: </b></dt><dd>
|
|
<a class="el" href="nearest_8c-example.html#a7">nearest.c</a>.</dl>
|
|
</div>
|
|
</div><p>
|
|
<a class="anchor" name="g15043a2482608fb93a0385f3c3e86926"></a><!-- doxytag: member="grib_api.h::grib_nearest_find" ref="g15043a2482608fb93a0385f3c3e86926" args="(grib_nearest *nearest, grib_handle *h, double inlat, double inlon, unsigned long flags, double *outlats, double *outlons, double *values, double *distances, int *indexes, size_t *len)" -->
|
|
<div class="memitem">
|
|
<div class="memproto">
|
|
<table class="memname">
|
|
<tr>
|
|
<td class="memname">int grib_nearest_find </td>
|
|
<td>(</td>
|
|
<td class="paramtype"><a class="el" href="grib__api_8h.html#1b47558cfe02835ba44213ee4d45fd9b">grib_nearest</a> * </td>
|
|
<td class="paramname"> <em>nearest</em>, </td>
|
|
</tr>
|
|
<tr>
|
|
<td class="paramkey"></td>
|
|
<td></td>
|
|
<td class="paramtype"><a class="el" href="group__grib__handle.html#g309a5ee24f4c730646d3f80ad0ef5f1b">grib_handle</a> * </td>
|
|
<td class="paramname"> <em>h</em>, </td>
|
|
</tr>
|
|
<tr>
|
|
<td class="paramkey"></td>
|
|
<td></td>
|
|
<td class="paramtype">double </td>
|
|
<td class="paramname"> <em>inlat</em>, </td>
|
|
</tr>
|
|
<tr>
|
|
<td class="paramkey"></td>
|
|
<td></td>
|
|
<td class="paramtype">double </td>
|
|
<td class="paramname"> <em>inlon</em>, </td>
|
|
</tr>
|
|
<tr>
|
|
<td class="paramkey"></td>
|
|
<td></td>
|
|
<td class="paramtype">unsigned long </td>
|
|
<td class="paramname"> <em>flags</em>, </td>
|
|
</tr>
|
|
<tr>
|
|
<td class="paramkey"></td>
|
|
<td></td>
|
|
<td class="paramtype">double * </td>
|
|
<td class="paramname"> <em>outlats</em>, </td>
|
|
</tr>
|
|
<tr>
|
|
<td class="paramkey"></td>
|
|
<td></td>
|
|
<td class="paramtype">double * </td>
|
|
<td class="paramname"> <em>outlons</em>, </td>
|
|
</tr>
|
|
<tr>
|
|
<td class="paramkey"></td>
|
|
<td></td>
|
|
<td class="paramtype">double * </td>
|
|
<td class="paramname"> <em>values</em>, </td>
|
|
</tr>
|
|
<tr>
|
|
<td class="paramkey"></td>
|
|
<td></td>
|
|
<td class="paramtype">double * </td>
|
|
<td class="paramname"> <em>distances</em>, </td>
|
|
</tr>
|
|
<tr>
|
|
<td class="paramkey"></td>
|
|
<td></td>
|
|
<td class="paramtype">int * </td>
|
|
<td class="paramname"> <em>indexes</em>, </td>
|
|
</tr>
|
|
<tr>
|
|
<td class="paramkey"></td>
|
|
<td></td>
|
|
<td class="paramtype">size_t * </td>
|
|
<td class="paramname"> <em>len</em></td><td> </td>
|
|
</tr>
|
|
<tr>
|
|
<td></td>
|
|
<td>)</td>
|
|
<td></td><td></td><td width="100%"></td>
|
|
</tr>
|
|
</table>
|
|
</div>
|
|
<div class="memdoc">
|
|
|
|
<p>
|
|
Find the 4 nearest points of a latitude longitude point.
|
|
<p>
|
|
The flags are provided to speed up the process of searching. If you are sure that the point you are asking for is not changing from a call to another you can use GRIB_NEAREST_SAME_POINT. The same is valid for the grid. Flags can be used together duing an or.<p>
|
|
<dl compact><dt><b>Parameters:</b></dt><dd>
|
|
<table border="0" cellspacing="2" cellpadding="0">
|
|
<tr><td valign="top"></td><td valign="top"><em>nearest</em> </td><td>: nearest structure </td></tr>
|
|
<tr><td valign="top"></td><td valign="top"><em>h</em> </td><td>: handle from which geography and data values are taken </td></tr>
|
|
<tr><td valign="top"></td><td valign="top"><em>inlat</em> </td><td>: latitude of the point to search for </td></tr>
|
|
<tr><td valign="top"></td><td valign="top"><em>inlon</em> </td><td>: longitude of the point to search for </td></tr>
|
|
<tr><td valign="top"></td><td valign="top"><em>flags</em> </td><td>: GRIB_NEAREST_SAME_POINT, GRIB_NEAREST_SAME_GRID </td></tr>
|
|
<tr><td valign="top"></td><td valign="top"><em>outlats</em> </td><td>: returned array of latitudes of the nearest points </td></tr>
|
|
<tr><td valign="top"></td><td valign="top"><em>outlons</em> </td><td>: returned array of longitudes of the nearest points </td></tr>
|
|
<tr><td valign="top"></td><td valign="top"><em>values</em> </td><td>: returned array of data values of the nearest points </td></tr>
|
|
<tr><td valign="top"></td><td valign="top"><em>distances</em> </td><td>: returned array of distances from the nearest points </td></tr>
|
|
<tr><td valign="top"></td><td valign="top"><em>indexes</em> </td><td>: returned array of indexes of the nearest points </td></tr>
|
|
<tr><td valign="top"></td><td valign="top"><em>len</em> </td><td>: size of the arrays </td></tr>
|
|
</table>
|
|
</dl>
|
|
<dl class="return" compact><dt><b>Returns:</b></dt><dd>0 if OK, integer value on error </dd></dl>
|
|
<dl compact><dt><b>Examples: </b></dt><dd>
|
|
<a class="el" href="nearest_8c-example.html#a5">nearest.c</a>.</dl>
|
|
</div>
|
|
</div><p>
|
|
<a class="anchor" name="g4923d7a2e414c743410f1de71bb9648c"></a><!-- doxytag: member="grib_api.h::grib_nearest_find_multiple" ref="g4923d7a2e414c743410f1de71bb9648c" args="(grib_handle *h, int is_lsm, double *inlats, double *inlons, long npoints, double *outlats, double *outlons, double *values, double *distances, int *indexes)" -->
|
|
<div class="memitem">
|
|
<div class="memproto">
|
|
<table class="memname">
|
|
<tr>
|
|
<td class="memname">int grib_nearest_find_multiple </td>
|
|
<td>(</td>
|
|
<td class="paramtype"><a class="el" href="group__grib__handle.html#g309a5ee24f4c730646d3f80ad0ef5f1b">grib_handle</a> * </td>
|
|
<td class="paramname"> <em>h</em>, </td>
|
|
</tr>
|
|
<tr>
|
|
<td class="paramkey"></td>
|
|
<td></td>
|
|
<td class="paramtype">int </td>
|
|
<td class="paramname"> <em>is_lsm</em>, </td>
|
|
</tr>
|
|
<tr>
|
|
<td class="paramkey"></td>
|
|
<td></td>
|
|
<td class="paramtype">double * </td>
|
|
<td class="paramname"> <em>inlats</em>, </td>
|
|
</tr>
|
|
<tr>
|
|
<td class="paramkey"></td>
|
|
<td></td>
|
|
<td class="paramtype">double * </td>
|
|
<td class="paramname"> <em>inlons</em>, </td>
|
|
</tr>
|
|
<tr>
|
|
<td class="paramkey"></td>
|
|
<td></td>
|
|
<td class="paramtype">long </td>
|
|
<td class="paramname"> <em>npoints</em>, </td>
|
|
</tr>
|
|
<tr>
|
|
<td class="paramkey"></td>
|
|
<td></td>
|
|
<td class="paramtype">double * </td>
|
|
<td class="paramname"> <em>outlats</em>, </td>
|
|
</tr>
|
|
<tr>
|
|
<td class="paramkey"></td>
|
|
<td></td>
|
|
<td class="paramtype">double * </td>
|
|
<td class="paramname"> <em>outlons</em>, </td>
|
|
</tr>
|
|
<tr>
|
|
<td class="paramkey"></td>
|
|
<td></td>
|
|
<td class="paramtype">double * </td>
|
|
<td class="paramname"> <em>values</em>, </td>
|
|
</tr>
|
|
<tr>
|
|
<td class="paramkey"></td>
|
|
<td></td>
|
|
<td class="paramtype">double * </td>
|
|
<td class="paramname"> <em>distances</em>, </td>
|
|
</tr>
|
|
<tr>
|
|
<td class="paramkey"></td>
|
|
<td></td>
|
|
<td class="paramtype">int * </td>
|
|
<td class="paramname"> <em>indexes</em></td><td> </td>
|
|
</tr>
|
|
<tr>
|
|
<td></td>
|
|
<td>)</td>
|
|
<td></td><td></td><td width="100%"></td>
|
|
</tr>
|
|
</table>
|
|
</div>
|
|
<div class="memdoc">
|
|
|
|
<p>
|
|
Find the nearest point of a set of points whose latitudes and longitudes are given in the inlats, inlons arrays respectively.
|
|
<p>
|
|
If the flag is_lsm is 1 the nearest land point is returned and the grib passed as handle (h) is considered a land sea mask. The land nearest point is the nearest point with land sea mask value>=0.5. If no nearest land points are found the nearest value is returned. If the flag is_lsm is 0 the nearest point is returned. values, distances, indexes (in the "values" array) for the nearest points (ilons,ilats) are returned.<p>
|
|
<dl compact><dt><b>Parameters:</b></dt><dd>
|
|
<table border="0" cellspacing="2" cellpadding="0">
|
|
<tr><td valign="top"></td><td valign="top"><em>h</em> </td><td>: handle from which geography and data values are taken </td></tr>
|
|
<tr><td valign="top"></td><td valign="top"><em>is_lsm</em> </td><td>: lsm flag (1-> nearest land, 0-> nearest) </td></tr>
|
|
<tr><td valign="top"></td><td valign="top"><em>inlats</em> </td><td>: latitudes of the points to search for </td></tr>
|
|
<tr><td valign="top"></td><td valign="top"><em>inlons</em> </td><td>: longitudes of the points to search for </td></tr>
|
|
<tr><td valign="top"></td><td valign="top"><em>npoints</em> </td><td>: number of points (size of the inlats,inlons,outlats,outlons,values,distances,indexes arrays) </td></tr>
|
|
<tr><td valign="top"></td><td valign="top"><em>outlats</em> </td><td>: returned array of latitudes of the nearest points </td></tr>
|
|
<tr><td valign="top"></td><td valign="top"><em>outlons</em> </td><td>: returned array of longitudes of the nearest points </td></tr>
|
|
<tr><td valign="top"></td><td valign="top"><em>values</em> </td><td>: returned array of data values of the nearest points </td></tr>
|
|
<tr><td valign="top"></td><td valign="top"><em>distances</em> </td><td>: returned array of distances from the nearest points </td></tr>
|
|
<tr><td valign="top"></td><td valign="top"><em>indexes</em> </td><td>: returned array of indexes of the nearest points </td></tr>
|
|
</table>
|
|
</dl>
|
|
<dl class="return" compact><dt><b>Returns:</b></dt><dd>0 if OK, integer value on error </dd></dl>
|
|
|
|
</div>
|
|
</div><p>
|
|
<a class="anchor" name="g4bd616cf0d0c4f5f147f4a207ddc7687"></a><!-- doxytag: member="grib_api.h::grib_nearest_new" ref="g4bd616cf0d0c4f5f147f4a207ddc7687" args="(grib_handle *h, int *error)" -->
|
|
<div class="memitem">
|
|
<div class="memproto">
|
|
<table class="memname">
|
|
<tr>
|
|
<td class="memname"><a class="el" href="grib__api_8h.html#1b47558cfe02835ba44213ee4d45fd9b">grib_nearest</a>* grib_nearest_new </td>
|
|
<td>(</td>
|
|
<td class="paramtype"><a class="el" href="group__grib__handle.html#g309a5ee24f4c730646d3f80ad0ef5f1b">grib_handle</a> * </td>
|
|
<td class="paramname"> <em>h</em>, </td>
|
|
</tr>
|
|
<tr>
|
|
<td class="paramkey"></td>
|
|
<td></td>
|
|
<td class="paramtype">int * </td>
|
|
<td class="paramname"> <em>error</em></td><td> </td>
|
|
</tr>
|
|
<tr>
|
|
<td></td>
|
|
<td>)</td>
|
|
<td></td><td></td><td width="100%"></td>
|
|
</tr>
|
|
</table>
|
|
</div>
|
|
<div class="memdoc">
|
|
|
|
<p>
|
|
Create a new nearest from a handle, using current geometry .
|
|
<p>
|
|
<dl compact><dt><b>Parameters:</b></dt><dd>
|
|
<table border="0" cellspacing="2" cellpadding="0">
|
|
<tr><td valign="top"></td><td valign="top"><em>h</em> </td><td>: the handle from which the iterator will be created </td></tr>
|
|
<tr><td valign="top"></td><td valign="top"><em>error</em> </td><td>: error code </td></tr>
|
|
</table>
|
|
</dl>
|
|
<dl class="return" compact><dt><b>Returns:</b></dt><dd>the new nearest, NULL if no nearest can be created </dd></dl>
|
|
<dl compact><dt><b>Examples: </b></dt><dd>
|
|
<a class="el" href="nearest_8c-example.html#a4">nearest.c</a>.</dl>
|
|
</div>
|
|
</div><p>
|
|
<hr size="1"><address style="text-align: right;"><small>Generated on Tue Sep 22 15:18:22 2009 for grib_api by
|
|
<a href="http://www.doxygen.org/index.html">
|
|
<img src="doxygen.png" alt="doxygen" align="middle" border="0"></a> 1.5.3 </small></address>
|
|
</body>
|
|
</html>
|