📄 gdal__alg_8h.html
字号:
<td class="paramkey"></td> <td></td> <td class="paramtype">int </td> <td class="paramname"> <em>nFixedLevelCount</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">double * </td> <td class="paramname"> <em>padfFixedLevels</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">int </td> <td class="paramname"> <em>bUseNoData</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">double </td> <td class="paramname"> <em>dfNoDataValue</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">void * </td> <td class="paramname"> <em>hLayer</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">int </td> <td class="paramname"> <em>iIDField</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">int </td> <td class="paramname"> <em>iElevField</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">GDALProgressFunc </td> <td class="paramname"> <em>pfnProgress</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">void * </td> <td class="paramname"> <em>pProgressArg</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 vector contours from raster DEM.<p>This algorithm will generate contours vectors for the input raster band on the requested set of contour levels. The vector contours are written to the passed in OGR vector layer. Also, a NODATA value may be specified to identify pixels that should not be considered in contour line generation.<p>The gdal/apps/gdal_contour.cpp mainline can be used as an example of how to use this function.<p>ALGORITHM RULES<p>For contouring purposes raster pixel values are assumed to represent a point value at the center of the corresponding pixel region. For the purpose of contour generation we virtually connect each pixel center to the values to the left, right, top and bottom. We assume that the pixel value is linearly interpolated between the pixel centers along each line, and determine where (if any) contour lines will appear onlong these line segements. Then the contour crossings are connected.<p>This means that contour lines nodes won't actually be on pixel edges, but rather along vertical and horizontal lines connecting the pixel centers.<p><div class="fragment"><pre class="fragment">General Case: 5 | | 3 -- + ---------------- + -- | | | | | | | | 10 + | |\ | | \ | -- + -+-------------- + -- 12 | 10 | 1Saddle Point: 5 | | 12 -- + -------------+-- + -- | \ | | \| | + | | + | |\ | | \ | -- + -+-------------- + -- 12 | | 1or: 5 | | 12 -- + -------------+-- + -- | __/ | | ___/ | | ___/ __+ | / __/ | +' __/ | | __/ | | ,__/ | -- + -+-------------- + -- 12 | | 1</pre></div><p>Nodata:<p>In the "nodata" case we treat the whole nodata pixel as a no-mans land. We extend the corner pixels near the nodata out to half way and then construct extra lines from those points to the center which is assigned an averaged value from the two nearby points (in this case (12+3+5)/3).<p><div class="fragment"><pre class="fragment"> 5 | | 3 -- + ---------------- + -- | | | | | 6.7 | | +---------+ 3 10 +___ | | \____+ 10 | | -- + -------+ + 12 | 12 (nodata)</pre></div><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>hBand</em> </td><td>The band to read raster data from. The whole band will be processed.</td></tr> <tr><td valign="top"></td><td valign="top"><em>dfContourInterval</em> </td><td>The elevation interval between contours generated.</td></tr> <tr><td valign="top"></td><td valign="top"><em>dfContourBase</em> </td><td>The "base" relative to which contour intervals are applied. This is normally zero, but could be different. To generate 10m contours at 5, 15, 25, ... the ContourBase would be 5.</td></tr> <tr><td valign="top"></td><td valign="top"><em>nFixedLevelCount</em> </td><td>The number of fixed levels. If this is greater than zero, then fixed levels will be used, and ContourInterval and ContourBase are ignored.</td></tr> <tr><td valign="top"></td><td valign="top"><em>padfFixedLevels</em> </td><td>The list of fixed contour levels at which contours should be generated. It will contain FixedLevelCount entries, and may be NULL if fixed levels are disabled (FixedLevelCount = 0).</td></tr> <tr><td valign="top"></td><td valign="top"><em>bUseNoData</em> </td><td>If TRUE the dfNoDataValue will be used.</td></tr> <tr><td valign="top"></td><td valign="top"><em>dfNoDataValue</em> </td><td>the value to use as a "nodata" value. That is, a pixel value which should be ignored in generating contours as if the value of the pixel were not known.</td></tr> <tr><td valign="top"></td><td valign="top"><em>hLayer</em> </td><td>the layer to which new contour vectors will be written. Each contour will have a LINESTRING geometry attached to it. This is really of type OGRLayerH, but void * is used to avoid pulling the ogr_api.h file in here.</td></tr> <tr><td valign="top"></td><td valign="top"><em>iIDField</em> </td><td>if not -1 this will be used as a field index to indicate where a unique id should be written for each feature (contour) written.</td></tr> <tr><td valign="top"></td><td valign="top"><em>iElevField</em> </td><td>if not -1 this will be used as a field index to indicate where the elevation value of the contour should be written.</td></tr> <tr><td valign="top"></td><td valign="top"><em>pfnProgress</em> </td><td>a GDALProgressFunc that may be used to report progress to the user, or to interrupt the algorithm. May be NULL if not required.</td></tr> <tr><td valign="top"></td><td valign="top"><em>pProgressArg</em> </td><td>the callback data for the pfnProgress function.</td></tr> </table></dl><dl class="return" compact><dt><b>Returns:</b></dt><dd>CE_None on success or CE_Failure if an error occurs. </dd></dl></div></div><p><a class="anchor" name="4ec403b75384f0a71130eb009078426f"></a><!-- doxytag: member="gdal_alg.h::GDALCreateApproxTransformer" ref="4ec403b75384f0a71130eb009078426f" args="(GDALTransformerFunc pfnRawTransformer, void *pRawTransformerArg, double dfMaxError)" --><div class="memitem"><div class="memproto"> <table class="memname"> <tr> <td class="memname">void* GDALCreateApproxTransformer </td> <td>(</td> <td class="paramtype"><a class="el" href="gdal__alg_8h.html#9ad4227ec5fd5b70637eeb6996172318">GDALTransformerFunc</a> </td> <td class="paramname"> <em>pfnBaseTransformer</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">void * </td> <td class="paramname"> <em>pBaseTransformArg</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">double </td> <td class="paramname"> <em>dfMaxError</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 an approximating transformer.<p>This function creates a context for an approximated transformer. Basically a high precision transformer is supplied as input and internally linear approximations are computed to generate results to within a defined precision.<p>The approximation is actually done at the point where <a class="el" href="gdal__alg_8h.html#766ccb23b021d30d86908c08ad8d1668">GDALApproxTransform()</a> calls are made, and depend on the assumption that the roughly linear. The first and last point passed in must be the extreme values and the intermediate values should describe a curve between the end points. The approximator transforms and center using the approximate transformer, and then compares the true middle transformed value to a linear approximation based on the end points. If the error is within the supplied threshold then the end points are used to linearly approximate all the values otherwise the inputs points are split into two smaller sets, and the function recursively called till a sufficiently small set of points if found that the linear approximation is OK, or that all the points are exactly computed.<p>This function is very suitable for approximating transformation results from output pixel/line space to input coordinates for warpers that operate on one input scanline at a time. Care should be taken using it in other circumstances as little internal validation is done, in order to keep things fast.<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>pfnBaseTransformer</em> </td><td>the high precision transformer which should be approximated. </td></tr> <tr><td valign="top"></td><td valign="top"><em>pBaseTransformArg</em> </td><td>the callback argument for the high precision transformer. </td></tr> <tr><td valign="top"></td><td valign="top"><em>dfMaxError</em> </td><td>the maximum cartesian error in the "output" space that is to be accepted in the linear approximation.</td></tr> </table></dl><dl class="return" compact><dt><b>Returns:</b></dt><dd>callback pointer suitable for use with <a class="el" href="gdal__alg_8h.html#766ccb23b021d30d86908c08ad8d1668">GDALApproxTransform()</a>. It should be deallocated with <a class="el" href="gdal__alg_8h.html#a8a1fd0719f5405e856e2103b23f1d9c">GDALDestroyApproxTransformer()</a>. </dd></dl></div></div><p><a class="anchor" name="c57c80f7bf6752fac1dff8c2a21a15a3"></a><!-- doxytag: member="gdal_alg.h::GDALCreateGCPTransformer" ref="c57c80f7bf6752fac1dff8c2a21a15a3" args="(int nGCPCount, const GDAL_GCP *pasGCPList, int nReqOrder, int bReversed)" --><div class="memitem"><div class="memproto"> <table class="memname"> <tr> <td class="memname">void* GDALCreateGCPTransformer </td>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -