OGR

ogr_p.h

00001 /******************************************************************************
00002  * $Id: ogr_p.h 20616 2010-09-15 01:20:36Z warmerdam $
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 #ifndef OGR_P_H_INCLUDED
00031 #define OGR_P_H_INCLUDED
00032 
00033 /* -------------------------------------------------------------------- */
00034 /*      Include the common portability library ... lets us do lots      */
00035 /*      of stuff easily.                                                */
00036 /* -------------------------------------------------------------------- */
00037 
00038 #include "cpl_string.h"
00039 #include "cpl_conv.h"
00040 
00041 #include "ogr_core.h"
00042 
00043 #ifdef CPL_MSB 
00044 #  define OGR_SWAP(x)   (x == wkbNDR)
00045 #else
00046 #  define OGR_SWAP(x)   (x == wkbXDR)
00047 #endif
00048 
00049 /* -------------------------------------------------------------------- */
00050 /*      helper function for parsing well known text format vector objects.*/
00051 /* -------------------------------------------------------------------- */
00052 
00053 #ifdef _OGR_GEOMETRY_H_INCLUDED
00054 #define OGR_WKT_TOKEN_MAX       64
00055 
00056 const char CPL_DLL * OGRWktReadToken( const char * pszInput, char * pszToken );
00057 
00058 const char CPL_DLL * OGRWktReadPoints( const char * pszInput,
00059                                        OGRRawPoint **ppaoPoints, 
00060                                        double **ppadfZ,
00061                                        int * pnMaxPoints,
00062                                        int * pnReadPoints );
00063 
00064 void CPL_DLL OGRMakeWktCoordinate( char *, double, double, double, int );
00065 
00066 #endif
00067 
00068 void OGRFormatDouble( char *pszBuffer, int nBufferLen, double dfVal, char chDecimalSep, int nPrecision = 15 );
00069 
00070 /* -------------------------------------------------------------------- */
00071 /*      Date-time parsing and processing functions                      */
00072 /* -------------------------------------------------------------------- */
00073 
00074 /* Internal use by OGR drivers only, CPL_DLL is just there in case */
00075 /* they are compiled as plugins  */
00076 int CPL_DLL OGRGetDayOfWeek(int day, int month, int year);
00077 int CPL_DLL OGRParseXMLDateTime( const char* pszXMLDateTime,
00078                                int *pnYear, int *pnMonth, int *pnDay,
00079                                int *pnHour, int *pnMinute, float* pfSecond, int *pnTZ);
00080 int CPL_DLL OGRParseRFC822DateTime( const char* pszRFC822DateTime,
00081                                   int *pnYear, int *pnMonth, int *pnDay,
00082                                   int *pnHour, int *pnMinute, int *pnSecond, int *pnTZ);
00083 char CPL_DLL * OGRGetRFC822DateTime(int year, int month, int day,
00084                                     int hour, int minute, int second, int TZ);
00085 char CPL_DLL * OGRGetXMLDateTime(int year, int month, int day,
00086                                  int hour, int minute, int second, int TZFlag);
00087 char CPL_DLL * OGRGetXML_UTF8_EscapedString(const char* pszString);
00088 
00089 int OGRCompareDate(   OGRField *psFirstTuple,
00090                       OGRField *psSecondTuple ); /* used by ogr_gensql.cpp and ogrfeaturequery.cpp */
00091 
00092 /* General utility option processing. */
00093 int CPL_DLL OGRGeneralCmdLineProcessor( int nArgc, char ***ppapszArgv, int nOptions );
00094 
00095 /************************************************************************/
00096 /*     Support for special attributes (feature query and selection)     */
00097 /************************************************************************/
00098 #define SPF_FID 0
00099 #define SPF_OGR_GEOMETRY 1
00100 #define SPF_OGR_STYLE 2
00101 #define SPF_OGR_GEOM_WKT 3
00102 #define SPF_OGR_GEOM_AREA 4
00103 #define SPECIAL_FIELD_COUNT 5
00104 
00105 extern const char* SpecialFieldNames[SPECIAL_FIELD_COUNT];
00106 
00107 #ifdef _SWQ_H_INCLUDED_
00108 extern const swq_field_type SpecialFieldTypes[SPECIAL_FIELD_COUNT];
00109 #endif
00110 
00111 /************************************************************************/
00112 /*     Some SRS related stuff, search in SRS data files.                */
00113 /************************************************************************/
00114 
00115 OGRErr CPL_DLL OSRGetEllipsoidInfo( int, char **, double *, double *);
00116 
00117 /* Fast atof function */
00118 double OGRFastAtof(const char* pszStr);
00119 
00120 #endif /* ndef OGR_P_H_INCLUDED */

Generated for GDAL by doxygen 1.7.3.