OGR
|
00001 /****************************************************************************** 00002 * $Id: ogr_api.h 23638 2011-12-22 21:02:56Z rouault $ 00003 * 00004 * Project: OpenGIS Simple Features Reference Implementation 00005 * Purpose: C API for OGR Geometry, Feature, Layers, DataSource and drivers. 00006 * Author: Frank Warmerdam, warmerdam@pobox.com 00007 * 00008 ****************************************************************************** 00009 * Copyright (c) 2002, Frank Warmerdam 00010 * 00011 * Permission is hereby granted, free of charge, to any person obtaining a 00012 * copy of this software and associated documentation files (the "Software"), 00013 * to deal in the Software without restriction, including without limitation 00014 * the rights to use, copy, modify, merge, publish, distribute, sublicense, 00015 * and/or sell copies of the Software, and to permit persons to whom the 00016 * Software is furnished to do so, subject to the following conditions: 00017 * 00018 * The above copyright notice and this permission notice shall be included 00019 * in all copies or substantial portions of the Software. 00020 * 00021 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS 00022 * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 00023 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL 00024 * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 00025 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 00026 * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 00027 * DEALINGS IN THE SOFTWARE. 00028 ****************************************************************************/ 00029 00030 #ifndef OGR_API_H_INCLUDED 00031 #define OGR_API_H_INCLUDED 00032 00042 #include "ogr_core.h" 00043 00044 CPL_C_START 00045 00046 /* -------------------------------------------------------------------- */ 00047 /* Geometry related functions (ogr_geometry.h) */ 00048 /* -------------------------------------------------------------------- */ 00049 #ifdef DEBUG 00050 typedef struct OGRGeometryHS *OGRGeometryH; 00051 #else 00052 typedef void *OGRGeometryH; 00053 #endif 00054 00055 #ifndef _DEFINED_OGRSpatialReferenceH 00056 #define _DEFINED_OGRSpatialReferenceH 00057 00058 #ifdef DEBUG 00059 typedef struct OGRSpatialReferenceHS *OGRSpatialReferenceH; 00060 typedef struct OGRCoordinateTransformationHS *OGRCoordinateTransformationH; 00061 #else 00062 typedef void *OGRSpatialReferenceH; 00063 typedef void *OGRCoordinateTransformationH; 00064 #endif 00065 00066 #endif 00067 00068 struct _CPLXMLNode; 00069 00070 /* From base OGRGeometry class */ 00071 00072 OGRErr CPL_DLL OGR_G_CreateFromWkb( unsigned char *, OGRSpatialReferenceH, 00073 OGRGeometryH *, int ); 00074 OGRErr CPL_DLL OGR_G_CreateFromWkt( char **, OGRSpatialReferenceH, 00075 OGRGeometryH * ); 00076 OGRErr CPL_DLL OGR_G_CreateFromFgf( unsigned char *, OGRSpatialReferenceH, 00077 OGRGeometryH *, int, int * ); 00078 void CPL_DLL OGR_G_DestroyGeometry( OGRGeometryH ); 00079 OGRGeometryH CPL_DLL OGR_G_CreateGeometry( OGRwkbGeometryType ); 00080 OGRGeometryH CPL_DLL 00081 OGR_G_ApproximateArcAngles( 00082 double dfCenterX, double dfCenterY, double dfZ, 00083 double dfPrimaryRadius, double dfSecondaryAxis, double dfRotation, 00084 double dfStartAngle, double dfEndAngle, 00085 double dfMaxAngleStepSizeDegrees ); 00086 00087 OGRGeometryH CPL_DLL OGR_G_ForceToPolygon( OGRGeometryH ); 00088 OGRGeometryH CPL_DLL OGR_G_ForceToMultiPolygon( OGRGeometryH ); 00089 OGRGeometryH CPL_DLL OGR_G_ForceToMultiPoint( OGRGeometryH ); 00090 OGRGeometryH CPL_DLL OGR_G_ForceToMultiLineString( OGRGeometryH ); 00091 00092 int CPL_DLL OGR_G_GetDimension( OGRGeometryH ); 00093 int CPL_DLL OGR_G_GetCoordinateDimension( OGRGeometryH ); 00094 void CPL_DLL OGR_G_SetCoordinateDimension( OGRGeometryH, int ); 00095 OGRGeometryH CPL_DLL OGR_G_Clone( OGRGeometryH ); 00096 void CPL_DLL OGR_G_GetEnvelope( OGRGeometryH, OGREnvelope * ); 00097 void CPL_DLL OGR_G_GetEnvelope3D( OGRGeometryH, OGREnvelope3D * ); 00098 OGRErr CPL_DLL OGR_G_ImportFromWkb( OGRGeometryH, unsigned char *, int ); 00099 OGRErr CPL_DLL OGR_G_ExportToWkb( OGRGeometryH, OGRwkbByteOrder, unsigned char*); 00100 int CPL_DLL OGR_G_WkbSize( OGRGeometryH hGeom ); 00101 OGRErr CPL_DLL OGR_G_ImportFromWkt( OGRGeometryH, char ** ); 00102 OGRErr CPL_DLL OGR_G_ExportToWkt( OGRGeometryH, char ** ); 00103 OGRwkbGeometryType CPL_DLL OGR_G_GetGeometryType( OGRGeometryH ); 00104 const char CPL_DLL *OGR_G_GetGeometryName( OGRGeometryH ); 00105 void CPL_DLL OGR_G_DumpReadable( OGRGeometryH, FILE *, const char * ); 00106 void CPL_DLL OGR_G_FlattenTo2D( OGRGeometryH ); 00107 void CPL_DLL OGR_G_CloseRings( OGRGeometryH ); 00108 00109 OGRGeometryH CPL_DLL OGR_G_CreateFromGML( const char * ); 00110 char CPL_DLL *OGR_G_ExportToGML( OGRGeometryH ); 00111 char CPL_DLL *OGR_G_ExportToGMLEx( OGRGeometryH, char** papszOptions ); 00112 00113 #if defined(_CPL_MINIXML_H_INCLUDED) 00114 OGRGeometryH CPL_DLL OGR_G_CreateFromGMLTree( const CPLXMLNode * ); 00115 CPLXMLNode CPL_DLL *OGR_G_ExportToGMLTree( OGRGeometryH ); 00116 CPLXMLNode CPL_DLL *OGR_G_ExportEnvelopeToGMLTree( OGRGeometryH ); 00117 #endif 00118 00119 char CPL_DLL *OGR_G_ExportToKML( OGRGeometryH, const char* pszAltitudeMode ); 00120 00121 char CPL_DLL *OGR_G_ExportToJson( OGRGeometryH ); 00122 char CPL_DLL *OGR_G_ExportToJsonEx( OGRGeometryH, char** papszOptions ); 00123 OGRGeometryH CPL_DLL OGR_G_CreateGeometryFromJson( const char* ); 00124 00125 void CPL_DLL OGR_G_AssignSpatialReference( OGRGeometryH, 00126 OGRSpatialReferenceH ); 00127 OGRSpatialReferenceH CPL_DLL OGR_G_GetSpatialReference( OGRGeometryH ); 00128 OGRErr CPL_DLL OGR_G_Transform( OGRGeometryH, OGRCoordinateTransformationH ); 00129 OGRErr CPL_DLL OGR_G_TransformTo( OGRGeometryH, OGRSpatialReferenceH ); 00130 00131 OGRGeometryH CPL_DLL OGR_G_Simplify( OGRGeometryH hThis, double tolerance ); 00132 OGRGeometryH CPL_DLL OGR_G_SimplifyPreserveTopology( OGRGeometryH hThis, double tolerance ); 00133 00134 void CPL_DLL OGR_G_Segmentize(OGRGeometryH hGeom, double dfMaxLength ); 00135 int CPL_DLL OGR_G_Intersects( OGRGeometryH, OGRGeometryH ); 00136 int CPL_DLL OGR_G_Equals( OGRGeometryH, OGRGeometryH ); 00137 /*int CPL_DLL OGR_G_EqualsExact( OGRGeometryH, OGRGeometryH, double );*/ 00138 int CPL_DLL OGR_G_Disjoint( OGRGeometryH, OGRGeometryH ); 00139 int CPL_DLL OGR_G_Touches( OGRGeometryH, OGRGeometryH ); 00140 int CPL_DLL OGR_G_Crosses( OGRGeometryH, OGRGeometryH ); 00141 int CPL_DLL OGR_G_Within( OGRGeometryH, OGRGeometryH ); 00142 int CPL_DLL OGR_G_Contains( OGRGeometryH, OGRGeometryH ); 00143 int CPL_DLL OGR_G_Overlaps( OGRGeometryH, OGRGeometryH ); 00144 00145 OGRGeometryH CPL_DLL OGR_G_Boundary( OGRGeometryH ); 00146 OGRGeometryH CPL_DLL OGR_G_ConvexHull( OGRGeometryH ); 00147 OGRGeometryH CPL_DLL OGR_G_Buffer( OGRGeometryH, double, int ); 00148 OGRGeometryH CPL_DLL OGR_G_Intersection( OGRGeometryH, OGRGeometryH ); 00149 OGRGeometryH CPL_DLL OGR_G_Union( OGRGeometryH, OGRGeometryH ); 00150 OGRGeometryH CPL_DLL OGR_G_UnionCascaded( OGRGeometryH ); 00151 /*OGRGeometryH CPL_DLL OGR_G_PointOnSurface( OGRGeometryH );*/ 00152 /*OGRGeometryH CPL_DLL OGR_G_Polygonize( OGRGeometryH *, int);*/ 00153 /*OGRGeometryH CPL_DLL OGR_G_Polygonizer_getCutEdges( OGRGeometryH *, int);*/ 00154 /*OGRGeometryH CPL_DLL OGR_G_LineMerge( OGRGeometryH );*/ 00155 00156 OGRGeometryH CPL_DLL OGR_G_Difference( OGRGeometryH, OGRGeometryH ); 00157 OGRGeometryH CPL_DLL OGR_G_SymDifference( OGRGeometryH, OGRGeometryH ); 00158 double CPL_DLL OGR_G_Distance( OGRGeometryH, OGRGeometryH ); 00159 double CPL_DLL OGR_G_Length( OGRGeometryH ); 00160 double CPL_DLL OGR_G_Area( OGRGeometryH ); 00161 int CPL_DLL OGR_G_Centroid( OGRGeometryH, OGRGeometryH ); 00162 00163 void CPL_DLL OGR_G_Empty( OGRGeometryH ); 00164 int CPL_DLL OGR_G_IsEmpty( OGRGeometryH ); 00165 int CPL_DLL OGR_G_IsValid( OGRGeometryH ); 00166 /*char CPL_DLL *OGR_G_IsValidReason( OGRGeometryH );*/ 00167 int CPL_DLL OGR_G_IsSimple( OGRGeometryH ); 00168 int CPL_DLL OGR_G_IsRing( OGRGeometryH ); 00169 00170 OGRGeometryH CPL_DLL OGR_G_Polygonize( OGRGeometryH ); 00171 00172 /* backward compatibility (non-standard methods) */ 00173 int CPL_DLL OGR_G_Intersect( OGRGeometryH, OGRGeometryH ); 00174 int CPL_DLL OGR_G_Equal( OGRGeometryH, OGRGeometryH ); 00175 OGRGeometryH CPL_DLL OGR_G_SymmetricDifference( OGRGeometryH, OGRGeometryH ); 00176 double CPL_DLL OGR_G_GetArea( OGRGeometryH ); 00177 OGRGeometryH CPL_DLL OGR_G_GetBoundary( OGRGeometryH ); 00178 00179 /* Methods for getting/setting vertices in points, line strings and rings */ 00180 int CPL_DLL OGR_G_GetPointCount( OGRGeometryH ); 00181 int CPL_DLL OGR_G_GetPoints( OGRGeometryH hGeom, 00182 void* pabyX, int nXStride, 00183 void* pabyY, int nYStride, 00184 void* pabyZ, int nZStride); 00185 double CPL_DLL OGR_G_GetX( OGRGeometryH, int ); 00186 double CPL_DLL OGR_G_GetY( OGRGeometryH, int ); 00187 double CPL_DLL OGR_G_GetZ( OGRGeometryH, int ); 00188 void CPL_DLL OGR_G_GetPoint( OGRGeometryH, int iPoint, 00189 double *, double *, double * ); 00190 void CPL_DLL OGR_G_SetPoint( OGRGeometryH, int iPoint, 00191 double, double, double ); 00192 void CPL_DLL OGR_G_SetPoint_2D( OGRGeometryH, int iPoint, 00193 double, double ); 00194 void CPL_DLL OGR_G_AddPoint( OGRGeometryH, double, double, double ); 00195 void CPL_DLL OGR_G_AddPoint_2D( OGRGeometryH, double, double ); 00196 00197 /* Methods for getting/setting rings and members collections */ 00198 00199 int CPL_DLL OGR_G_GetGeometryCount( OGRGeometryH ); 00200 OGRGeometryH CPL_DLL OGR_G_GetGeometryRef( OGRGeometryH, int ); 00201 OGRErr CPL_DLL OGR_G_AddGeometry( OGRGeometryH, OGRGeometryH ); 00202 OGRErr CPL_DLL OGR_G_AddGeometryDirectly( OGRGeometryH, OGRGeometryH ); 00203 OGRErr CPL_DLL OGR_G_RemoveGeometry( OGRGeometryH, int, int ); 00204 00205 OGRGeometryH CPL_DLL OGRBuildPolygonFromEdges( OGRGeometryH hLinesAsCollection, 00206 int bBestEffort, 00207 int bAutoClose, 00208 double dfTolerance, 00209 OGRErr * peErr ); 00210 00211 OGRErr CPL_DLL OGRSetGenerate_DB2_V72_BYTE_ORDER( 00212 int bGenerate_DB2_V72_BYTE_ORDER ); 00213 00214 int CPL_DLL OGRGetGenerate_DB2_V72_BYTE_ORDER(void); 00215 00216 /* -------------------------------------------------------------------- */ 00217 /* Feature related (ogr_feature.h) */ 00218 /* -------------------------------------------------------------------- */ 00219 00220 #ifdef DEBUG 00221 typedef struct OGRFieldDefnHS *OGRFieldDefnH; 00222 typedef struct OGRFeatureDefnHS *OGRFeatureDefnH; 00223 typedef struct OGRFeatureHS *OGRFeatureH; 00224 typedef struct OGRStyleTableHS *OGRStyleTableH; 00225 #else 00226 typedef void *OGRFieldDefnH; 00227 typedef void *OGRFeatureDefnH; 00228 typedef void *OGRFeatureH; 00229 typedef void *OGRStyleTableH; 00230 #endif 00231 00232 /* OGRFieldDefn */ 00233 00234 OGRFieldDefnH CPL_DLL OGR_Fld_Create( const char *, OGRFieldType ) CPL_WARN_UNUSED_RESULT; 00235 void CPL_DLL OGR_Fld_Destroy( OGRFieldDefnH ); 00236 00237 void CPL_DLL OGR_Fld_SetName( OGRFieldDefnH, const char * ); 00238 const char CPL_DLL *OGR_Fld_GetNameRef( OGRFieldDefnH ); 00239 OGRFieldType CPL_DLL OGR_Fld_GetType( OGRFieldDefnH ); 00240 void CPL_DLL OGR_Fld_SetType( OGRFieldDefnH, OGRFieldType ); 00241 OGRJustification CPL_DLL OGR_Fld_GetJustify( OGRFieldDefnH ); 00242 void CPL_DLL OGR_Fld_SetJustify( OGRFieldDefnH, OGRJustification ); 00243 int CPL_DLL OGR_Fld_GetWidth( OGRFieldDefnH ); 00244 void CPL_DLL OGR_Fld_SetWidth( OGRFieldDefnH, int ); 00245 int CPL_DLL OGR_Fld_GetPrecision( OGRFieldDefnH ); 00246 void CPL_DLL OGR_Fld_SetPrecision( OGRFieldDefnH, int ); 00247 void CPL_DLL OGR_Fld_Set( OGRFieldDefnH, const char *, OGRFieldType, 00248 int, int, OGRJustification ); 00249 int CPL_DLL OGR_Fld_IsIgnored( OGRFieldDefnH hDefn ); 00250 void CPL_DLL OGR_Fld_SetIgnored( OGRFieldDefnH hDefn, int ); 00251 00252 const char CPL_DLL *OGR_GetFieldTypeName( OGRFieldType ); 00253 00254 /* OGRFeatureDefn */ 00255 00256 OGRFeatureDefnH CPL_DLL OGR_FD_Create( const char * ) CPL_WARN_UNUSED_RESULT; 00257 void CPL_DLL OGR_FD_Destroy( OGRFeatureDefnH ); 00258 void CPL_DLL OGR_FD_Release( OGRFeatureDefnH ); 00259 const char CPL_DLL *OGR_FD_GetName( OGRFeatureDefnH ); 00260 int CPL_DLL OGR_FD_GetFieldCount( OGRFeatureDefnH ); 00261 OGRFieldDefnH CPL_DLL OGR_FD_GetFieldDefn( OGRFeatureDefnH, int ); 00262 int CPL_DLL OGR_FD_GetFieldIndex( OGRFeatureDefnH, const char * ); 00263 void CPL_DLL OGR_FD_AddFieldDefn( OGRFeatureDefnH, OGRFieldDefnH ); 00264 OGRErr CPL_DLL OGR_FD_DeleteFieldDefn( OGRFeatureDefnH hDefn, int iField ); 00265 OGRErr CPL_DLL OGR_FD_ReorderFieldDefns( OGRFeatureDefnH hDefn, int* panMap ); 00266 OGRwkbGeometryType CPL_DLL OGR_FD_GetGeomType( OGRFeatureDefnH ); 00267 void CPL_DLL OGR_FD_SetGeomType( OGRFeatureDefnH, OGRwkbGeometryType ); 00268 int CPL_DLL OGR_FD_IsGeometryIgnored( OGRFeatureDefnH ); 00269 void CPL_DLL OGR_FD_SetGeometryIgnored( OGRFeatureDefnH, int ); 00270 int CPL_DLL OGR_FD_IsStyleIgnored( OGRFeatureDefnH ); 00271 void CPL_DLL OGR_FD_SetStyleIgnored( OGRFeatureDefnH, int ); 00272 int CPL_DLL OGR_FD_Reference( OGRFeatureDefnH ); 00273 int CPL_DLL OGR_FD_Dereference( OGRFeatureDefnH ); 00274 int CPL_DLL OGR_FD_GetReferenceCount( OGRFeatureDefnH ); 00275 00276 /* OGRFeature */ 00277 00278 OGRFeatureH CPL_DLL OGR_F_Create( OGRFeatureDefnH ) CPL_WARN_UNUSED_RESULT; 00279 void CPL_DLL OGR_F_Destroy( OGRFeatureH ); 00280 OGRFeatureDefnH CPL_DLL OGR_F_GetDefnRef( OGRFeatureH ); 00281 00282 OGRErr CPL_DLL OGR_F_SetGeometryDirectly( OGRFeatureH, OGRGeometryH ); 00283 OGRErr CPL_DLL OGR_F_SetGeometry( OGRFeatureH, OGRGeometryH ); 00284 OGRGeometryH CPL_DLL OGR_F_GetGeometryRef( OGRFeatureH ); 00285 OGRGeometryH CPL_DLL OGR_F_StealGeometry( OGRFeatureH ); 00286 OGRFeatureH CPL_DLL OGR_F_Clone( OGRFeatureH ); 00287 int CPL_DLL OGR_F_Equal( OGRFeatureH, OGRFeatureH ); 00288 00289 int CPL_DLL OGR_F_GetFieldCount( OGRFeatureH ); 00290 OGRFieldDefnH CPL_DLL OGR_F_GetFieldDefnRef( OGRFeatureH, int ); 00291 int CPL_DLL OGR_F_GetFieldIndex( OGRFeatureH, const char * ); 00292 00293 int CPL_DLL OGR_F_IsFieldSet( OGRFeatureH, int ); 00294 void CPL_DLL OGR_F_UnsetField( OGRFeatureH, int ); 00295 OGRField CPL_DLL *OGR_F_GetRawFieldRef( OGRFeatureH, int ); 00296 00297 int CPL_DLL OGR_F_GetFieldAsInteger( OGRFeatureH, int ); 00298 double CPL_DLL OGR_F_GetFieldAsDouble( OGRFeatureH, int ); 00299 const char CPL_DLL *OGR_F_GetFieldAsString( OGRFeatureH, int ); 00300 const int CPL_DLL *OGR_F_GetFieldAsIntegerList( OGRFeatureH, int, int * ); 00301 const double CPL_DLL *OGR_F_GetFieldAsDoubleList( OGRFeatureH, int, int * ); 00302 char CPL_DLL **OGR_F_GetFieldAsStringList( OGRFeatureH, int ); 00303 GByte CPL_DLL *OGR_F_GetFieldAsBinary( OGRFeatureH, int, int * ); 00304 int CPL_DLL OGR_F_GetFieldAsDateTime( OGRFeatureH, int, int *, int *, int *, 00305 int *, int *, int *, int * ); 00306 00307 void CPL_DLL OGR_F_SetFieldInteger( OGRFeatureH, int, int ); 00308 void CPL_DLL OGR_F_SetFieldDouble( OGRFeatureH, int, double ); 00309 void CPL_DLL OGR_F_SetFieldString( OGRFeatureH, int, const char * ); 00310 void CPL_DLL OGR_F_SetFieldIntegerList( OGRFeatureH, int, int, int * ); 00311 void CPL_DLL OGR_F_SetFieldDoubleList( OGRFeatureH, int, int, double * ); 00312 void CPL_DLL OGR_F_SetFieldStringList( OGRFeatureH, int, char ** ); 00313 void CPL_DLL OGR_F_SetFieldRaw( OGRFeatureH, int, OGRField * ); 00314 void CPL_DLL OGR_F_SetFieldBinary( OGRFeatureH, int, int, GByte * ); 00315 void CPL_DLL OGR_F_SetFieldDateTime( OGRFeatureH, int, 00316 int, int, int, int, int, int, int ); 00317 00318 long CPL_DLL OGR_F_GetFID( OGRFeatureH ); 00319 OGRErr CPL_DLL OGR_F_SetFID( OGRFeatureH, long ); 00320 void CPL_DLL OGR_F_DumpReadable( OGRFeatureH, FILE * ); 00321 OGRErr CPL_DLL OGR_F_SetFrom( OGRFeatureH, OGRFeatureH, int ); 00322 OGRErr CPL_DLL OGR_F_SetFromWithMap( OGRFeatureH, OGRFeatureH, int , int * ); 00323 00324 const char CPL_DLL *OGR_F_GetStyleString( OGRFeatureH ); 00325 void CPL_DLL OGR_F_SetStyleString( OGRFeatureH, const char * ); 00326 void CPL_DLL OGR_F_SetStyleStringDirectly( OGRFeatureH, char * ); 00327 OGRStyleTableH CPL_DLL OGR_F_GetStyleTable( OGRFeatureH ); 00328 void CPL_DLL OGR_F_SetStyleTableDirectly( OGRFeatureH, OGRStyleTableH ); 00329 void CPL_DLL OGR_F_SetStyleTable( OGRFeatureH, OGRStyleTableH ); 00330 00331 /* -------------------------------------------------------------------- */ 00332 /* ogrsf_frmts.h */ 00333 /* -------------------------------------------------------------------- */ 00334 00335 #ifdef DEBUG 00336 typedef struct OGRLayerHS *OGRLayerH; 00337 typedef struct OGRDataSourceHS *OGRDataSourceH; 00338 typedef struct OGRDriverHS *OGRSFDriverH; 00339 #else 00340 typedef void *OGRLayerH; 00341 typedef void *OGRDataSourceH; 00342 typedef void *OGRSFDriverH; 00343 #endif 00344 00345 /* OGRLayer */ 00346 00347 const char CPL_DLL* OGR_L_GetName( OGRLayerH ); 00348 OGRwkbGeometryType CPL_DLL OGR_L_GetGeomType( OGRLayerH ); 00349 OGRGeometryH CPL_DLL OGR_L_GetSpatialFilter( OGRLayerH ); 00350 void CPL_DLL OGR_L_SetSpatialFilter( OGRLayerH, OGRGeometryH ); 00351 void CPL_DLL OGR_L_SetSpatialFilterRect( OGRLayerH, 00352 double, double, double, double ); 00353 OGRErr CPL_DLL OGR_L_SetAttributeFilter( OGRLayerH, const char * ); 00354 void CPL_DLL OGR_L_ResetReading( OGRLayerH ); 00355 OGRFeatureH CPL_DLL OGR_L_GetNextFeature( OGRLayerH ); 00356 OGRErr CPL_DLL OGR_L_SetNextByIndex( OGRLayerH, long ); 00357 OGRFeatureH CPL_DLL OGR_L_GetFeature( OGRLayerH, long ); 00358 OGRErr CPL_DLL OGR_L_SetFeature( OGRLayerH, OGRFeatureH ); 00359 OGRErr CPL_DLL OGR_L_CreateFeature( OGRLayerH, OGRFeatureH ); 00360 OGRErr CPL_DLL OGR_L_DeleteFeature( OGRLayerH, long ); 00361 OGRFeatureDefnH CPL_DLL OGR_L_GetLayerDefn( OGRLayerH ); 00362 OGRSpatialReferenceH CPL_DLL OGR_L_GetSpatialRef( OGRLayerH ); 00363 int CPL_DLL OGR_L_GetFeatureCount( OGRLayerH, int ); 00364 OGRErr CPL_DLL OGR_L_GetExtent( OGRLayerH, OGREnvelope *, int ); 00365 int CPL_DLL OGR_L_TestCapability( OGRLayerH, const char * ); 00366 OGRErr CPL_DLL OGR_L_CreateField( OGRLayerH, OGRFieldDefnH, int ); 00367 OGRErr CPL_DLL OGR_L_DeleteField( OGRLayerH, int iField ); 00368 OGRErr CPL_DLL OGR_L_ReorderFields( OGRLayerH, int* panMap ); 00369 OGRErr CPL_DLL OGR_L_ReorderField( OGRLayerH, int iOldFieldPos, int iNewFieldPos ); 00370 OGRErr CPL_DLL OGR_L_AlterFieldDefn( OGRLayerH, int iField, OGRFieldDefnH hNewFieldDefn, int nFlags ); 00371 OGRErr CPL_DLL OGR_L_StartTransaction( OGRLayerH ); 00372 OGRErr CPL_DLL OGR_L_CommitTransaction( OGRLayerH ); 00373 OGRErr CPL_DLL OGR_L_RollbackTransaction( OGRLayerH ); 00374 int CPL_DLL OGR_L_Reference( OGRLayerH ); 00375 int CPL_DLL OGR_L_Dereference( OGRLayerH ); 00376 int CPL_DLL OGR_L_GetRefCount( OGRLayerH ); 00377 OGRErr CPL_DLL OGR_L_SyncToDisk( OGRLayerH ); 00378 GIntBig CPL_DLL OGR_L_GetFeaturesRead( OGRLayerH ); 00379 const char CPL_DLL *OGR_L_GetFIDColumn( OGRLayerH ); 00380 const char CPL_DLL *OGR_L_GetGeometryColumn( OGRLayerH ); 00381 OGRStyleTableH CPL_DLL OGR_L_GetStyleTable( OGRLayerH ); 00382 void CPL_DLL OGR_L_SetStyleTableDirectly( OGRLayerH, OGRStyleTableH ); 00383 void CPL_DLL OGR_L_SetStyleTable( OGRLayerH, OGRStyleTableH ); 00384 OGRErr CPL_DLL OGR_L_SetIgnoredFields( OGRLayerH, const char** ); 00385 00386 /* OGRDataSource */ 00387 00388 void CPL_DLL OGR_DS_Destroy( OGRDataSourceH ); 00389 const char CPL_DLL *OGR_DS_GetName( OGRDataSourceH ); 00390 int CPL_DLL OGR_DS_GetLayerCount( OGRDataSourceH ); 00391 OGRLayerH CPL_DLL OGR_DS_GetLayer( OGRDataSourceH, int ); 00392 OGRLayerH CPL_DLL OGR_DS_GetLayerByName( OGRDataSourceH, const char * ); 00393 OGRErr CPL_DLL OGR_DS_DeleteLayer( OGRDataSourceH, int ); 00394 OGRSFDriverH CPL_DLL OGR_DS_GetDriver( OGRDataSourceH ); 00395 OGRLayerH CPL_DLL OGR_DS_CreateLayer( OGRDataSourceH, const char *, 00396 OGRSpatialReferenceH, OGRwkbGeometryType, 00397 char ** ); 00398 OGRLayerH CPL_DLL OGR_DS_CopyLayer( OGRDataSourceH, OGRLayerH, const char *, 00399 char ** ); 00400 int CPL_DLL OGR_DS_TestCapability( OGRDataSourceH, const char * ); 00401 OGRLayerH CPL_DLL OGR_DS_ExecuteSQL( OGRDataSourceH, const char *, 00402 OGRGeometryH, const char * ); 00403 void CPL_DLL OGR_DS_ReleaseResultSet( OGRDataSourceH, OGRLayerH ); 00404 int CPL_DLL OGR_DS_Reference( OGRDataSourceH ); 00405 int CPL_DLL OGR_DS_Dereference( OGRDataSourceH ); 00406 int CPL_DLL OGR_DS_GetRefCount( OGRDataSourceH ); 00407 int CPL_DLL OGR_DS_GetSummaryRefCount( OGRDataSourceH ); 00408 OGRErr CPL_DLL OGR_DS_SyncToDisk( OGRDataSourceH ); 00409 OGRStyleTableH CPL_DLL OGR_DS_GetStyleTable( OGRDataSourceH ); 00410 void CPL_DLL OGR_DS_SetStyleTableDirectly( OGRDataSourceH, OGRStyleTableH ); 00411 void CPL_DLL OGR_DS_SetStyleTable( OGRDataSourceH, OGRStyleTableH ); 00412 00413 /* OGRSFDriver */ 00414 00415 const char CPL_DLL *OGR_Dr_GetName( OGRSFDriverH ); 00416 OGRDataSourceH CPL_DLL OGR_Dr_Open( OGRSFDriverH, const char *, int ) CPL_WARN_UNUSED_RESULT; 00417 int CPL_DLL OGR_Dr_TestCapability( OGRSFDriverH, const char * ); 00418 OGRDataSourceH CPL_DLL OGR_Dr_CreateDataSource( OGRSFDriverH, const char *, 00419 char ** ) CPL_WARN_UNUSED_RESULT; 00420 OGRDataSourceH CPL_DLL OGR_Dr_CopyDataSource( OGRSFDriverH, OGRDataSourceH, 00421 const char *, char ** ) CPL_WARN_UNUSED_RESULT; 00422 OGRErr CPL_DLL OGR_Dr_DeleteDataSource( OGRSFDriverH, const char * ); 00423 00424 /* OGRSFDriverRegistrar */ 00425 00426 OGRDataSourceH CPL_DLL OGROpen( const char *, int, OGRSFDriverH * ) CPL_WARN_UNUSED_RESULT; 00427 OGRDataSourceH CPL_DLL OGROpenShared( const char *, int, OGRSFDriverH * ) CPL_WARN_UNUSED_RESULT; 00428 OGRErr CPL_DLL OGRReleaseDataSource( OGRDataSourceH ); 00429 void CPL_DLL OGRRegisterDriver( OGRSFDriverH ); 00430 void CPL_DLL OGRDeregisterDriver( OGRSFDriverH ); 00431 int CPL_DLL OGRGetDriverCount(void); 00432 OGRSFDriverH CPL_DLL OGRGetDriver( int ); 00433 OGRSFDriverH CPL_DLL OGRGetDriverByName( const char * ); 00434 int CPL_DLL OGRGetOpenDSCount(void); 00435 OGRDataSourceH CPL_DLL OGRGetOpenDS( int iDS ); 00436 00437 00438 /* note: this is also declared in ogrsf_frmts.h */ 00439 void CPL_DLL OGRRegisterAll(void); 00440 void CPL_DLL OGRCleanupAll(void); 00441 00442 /* -------------------------------------------------------------------- */ 00443 /* ogrsf_featurestyle.h */ 00444 /* -------------------------------------------------------------------- */ 00445 00446 #ifdef DEBUG 00447 typedef struct OGRStyleMgrHS *OGRStyleMgrH; 00448 typedef struct OGRStyleToolHS *OGRStyleToolH; 00449 #else 00450 typedef void *OGRStyleMgrH; 00451 typedef void *OGRStyleToolH; 00452 #endif 00453 00454 /* OGRStyleMgr */ 00455 00456 OGRStyleMgrH CPL_DLL OGR_SM_Create(OGRStyleTableH hStyleTable) CPL_WARN_UNUSED_RESULT; 00457 void CPL_DLL OGR_SM_Destroy(OGRStyleMgrH hSM); 00458 00459 const char CPL_DLL *OGR_SM_InitFromFeature(OGRStyleMgrH hSM, 00460 OGRFeatureH hFeat); 00461 int CPL_DLL OGR_SM_InitStyleString(OGRStyleMgrH hSM, 00462 const char *pszStyleString); 00463 int CPL_DLL OGR_SM_GetPartCount(OGRStyleMgrH hSM, 00464 const char *pszStyleString); 00465 OGRStyleToolH CPL_DLL OGR_SM_GetPart(OGRStyleMgrH hSM, int nPartId, 00466 const char *pszStyleString); 00467 int CPL_DLL OGR_SM_AddPart(OGRStyleMgrH hSM, OGRStyleToolH hST); 00468 int CPL_DLL OGR_SM_AddStyle(OGRStyleMgrH hSM, const char *pszStyleName, 00469 const char *pszStyleString); 00470 00471 /* OGRStyleTool */ 00472 00473 OGRStyleToolH CPL_DLL OGR_ST_Create(OGRSTClassId eClassId) CPL_WARN_UNUSED_RESULT; 00474 void CPL_DLL OGR_ST_Destroy(OGRStyleToolH hST); 00475 00476 OGRSTClassId CPL_DLL OGR_ST_GetType(OGRStyleToolH hST); 00477 00478 OGRSTUnitId CPL_DLL OGR_ST_GetUnit(OGRStyleToolH hST); 00479 void CPL_DLL OGR_ST_SetUnit(OGRStyleToolH hST, OGRSTUnitId eUnit, 00480 double dfGroundPaperScale); 00481 00482 const char CPL_DLL *OGR_ST_GetParamStr(OGRStyleToolH hST, int eParam, int *bValueIsNull); 00483 int CPL_DLL OGR_ST_GetParamNum(OGRStyleToolH hST, int eParam, int *bValueIsNull); 00484 double CPL_DLL OGR_ST_GetParamDbl(OGRStyleToolH hST, int eParam, int *bValueIsNull); 00485 void CPL_DLL OGR_ST_SetParamStr(OGRStyleToolH hST, int eParam, const char *pszValue); 00486 void CPL_DLL OGR_ST_SetParamNum(OGRStyleToolH hST, int eParam, int nValue); 00487 void CPL_DLL OGR_ST_SetParamDbl(OGRStyleToolH hST, int eParam, double dfValue); 00488 const char CPL_DLL *OGR_ST_GetStyleString(OGRStyleToolH hST); 00489 00490 int CPL_DLL OGR_ST_GetRGBFromString(OGRStyleToolH hST, const char *pszColor, 00491 int *pnRed, int *pnGreen, int *pnBlue, 00492 int *pnAlpha); 00493 00494 /* OGRStyleTable */ 00495 00496 OGRStyleTableH CPL_DLL OGR_STBL_Create( void ) CPL_WARN_UNUSED_RESULT; 00497 void CPL_DLL OGR_STBL_Destroy( OGRStyleTableH hSTBL ); 00498 int CPL_DLL OGR_STBL_SaveStyleTable( OGRStyleTableH hStyleTable, 00499 const char *pszFilename ); 00500 int CPL_DLL OGR_STBL_LoadStyleTable( OGRStyleTableH hStyleTable, 00501 const char *pszFilename ); 00502 const char CPL_DLL *OGR_STBL_Find( OGRStyleTableH hStyleTable, const char *pszName ); 00503 void CPL_DLL OGR_STBL_ResetStyleStringReading( OGRStyleTableH hStyleTable ); 00504 const char CPL_DLL *OGR_STBL_GetNextStyle( OGRStyleTableH hStyleTable); 00505 const char CPL_DLL *OGR_STBL_GetLastStyleName( OGRStyleTableH hStyleTable); 00506 00507 CPL_C_END 00508 00509 #endif /* ndef OGR_API_H_INCLUDED */