00001 /****************************************************************************** 00002 * $Id: ogr_p.h,v 1.11 2006/11/28 00:00:35 tamas Exp $ 00003 * 00004 * Project: OpenGIS Simple Features Reference Implementation 00005 * Purpose: Some private helper functions and stuff for OGR implementation. 00006 * Author: Frank Warmerdam, warmerdam@pobox.com 00007 * 00008 ****************************************************************************** 00009 * Copyright (c) 1999, 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 * $Log: ogr_p.h,v $ 00031 * Revision 1.11 2006/11/28 00:00:35 tamas 00032 * RFC 6: Geometry and Feature Style as OGR Special Fields 00033 * 00034 * Revision 1.10 2006/03/31 17:44:20 fwarmerdam 00035 * header updates 00036 * 00037 * Revision 1.9 2005/10/16 01:59:06 cfis 00038 * Added declaration for OGRGeneralCmdLineProcessor to ogr_p.h, and included it into ogr2ogr. Also changed call to CPL_DLL from CPL_STDCALL 00039 * 00040 * Revision 1.8 2005/07/20 01:43:51 fwarmerdam 00041 * upgraded OGR geometry dimension handling 00042 * 00043 * Revision 1.7 2001/11/01 17:01:28 warmerda 00044 * pass output buffer into OGRMakeWktCoordinate 00045 * 00046 * Revision 1.6 1999/11/18 19:02:20 warmerda 00047 * expanded tabs 00048 * 00049 * Revision 1.5 1999/09/13 02:27:33 warmerda 00050 * incorporated limited 2.5d support 00051 * 00052 * Revision 1.4 1999/07/29 17:30:38 warmerda 00053 * avoid geometry dependent stuff if ogr_geometry.h not included 00054 * 00055 * Revision 1.3 1999/07/07 04:23:07 danmo 00056 * Fixed typo in #define _OGR_..._H_INCLUDED line 00057 * 00058 * Revision 1.2 1999/05/20 14:36:04 warmerda 00059 * added well known text parsing prototypes 00060 * 00061 * Revision 1.1 1999/03/29 21:21:10 warmerda 00062 * New 00063 * 00064 */ 00065 00066 #ifndef _OGR_P_H_INCLUDED 00067 #define _OGR_P_H_INCLUDED 00068 00069 /* -------------------------------------------------------------------- */ 00070 /* Include the common portability library ... lets us do lots */ 00071 /* of stuff easily. */ 00072 /* -------------------------------------------------------------------- */ 00073 00074 #include "cpl_string.h" 00075 #include "cpl_conv.h" 00076 00077 #ifdef CPL_MSB 00078 # define OGR_SWAP(x) (x == wkbNDR) 00079 #else 00080 # define OGR_SWAP(x) (x == wkbXDR) 00081 #endif 00082 00083 /* -------------------------------------------------------------------- */ 00084 /* helper function for parsing well known text format vector objects.*/ 00085 /* -------------------------------------------------------------------- */ 00086 00087 #ifdef _OGR_GEOMETRY_H_INCLUDED 00088 #define OGR_WKT_TOKEN_MAX 64 00089 00090 const char CPL_DLL * OGRWktReadToken( const char * pszInput, char * pszToken ); 00091 00092 const char CPL_DLL * OGRWktReadPoints( const char * pszInput, 00093 OGRRawPoint **ppaoPoints, 00094 double **ppadfZ, 00095 int * pnMaxPoints, 00096 int * pnReadPoints ); 00097 00098 void CPL_DLL OGRMakeWktCoordinate( char *, double, double, double, int ); 00099 #endif 00100 00101 00102 /* General utility option processing. */ 00103 int CPL_DLL OGRGeneralCmdLineProcessor( int nArgc, char ***ppapszArgv, int nOptions ); 00104 00105 /************************************************************************/ 00106 /* Support for special attributes (feature query and selection) */ 00107 /************************************************************************/ 00108 CPL_C_START 00109 #include "swq.h" 00110 CPL_C_END 00111 00112 #define SPF_FID 0 00113 #define SPF_OGR_GEOMETRY 1 00114 #define SPF_OGR_STYLE 2 00115 #define SPF_OGR_GEOM_WKT 3 00116 #define SPECIAL_FIELD_COUNT 4 00117 00118 extern char* SpecialFieldNames[SPECIAL_FIELD_COUNT]; 00119 extern swq_field_type SpecialFieldTypes[SPECIAL_FIELD_COUNT]; 00120 00121 #endif /* ndef _OGR_P_H_INCLUDED */