- Main Page
- Related Pages
- Classes
- Files
- Directories

- File List
- File Members

# ogr_p.h

    00001 /******************************************************************************
    00002  * $Id: ogr_p.h 27044 2014-03-16 23:41:27Z rouault $
    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  * Copyright (c) 2008-2014, Even Rouault <even dot rouault at mines-paris dot org>
    00011  *
    00012  * Permission is hereby granted, free of charge, to any person obtaining a
    00013  * copy of this software and associated documentation files (the "Software"),
    00014  * to deal in the Software without restriction, including without limitation
    00015  * the rights to use, copy, modify, merge, publish, distribute, sublicense,
    00016  * and/or sell copies of the Software, and to permit persons to whom the
    00017  * Software is furnished to do so, subject to the following conditions:
    00018  *
    00019  * The above copyright notice and this permission notice shall be included
    00020  * in all copies or substantial portions of the Software.
    00021  *
    00022  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
    00023  * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
    00024  * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
    00025  * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
    00026  * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
    00027  * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
    00028  * DEALINGS IN THE SOFTWARE.
    00029  ****************************************************************************/
    00030
    00031 #ifndef OGR_P_H_INCLUDED
    00032 #define OGR_P_H_INCLUDED
    00033
    00034 /* -------------------------------------------------------------------- */
    00035 /*      Include the common portability library ... lets us do lots      */
    00036 /*      of stuff easily.                                                */
    00037 /* -------------------------------------------------------------------- */
    00038
    00039 #include "cpl_string.h"
    00040 #include "cpl_conv.h"
    00041 #include "cpl_minixml.h"
    00042
    00043 #include "ogr_core.h"
    00044 #include "ogr_geometry.h"
    00045
    00046 /* A default name for the default geometry column, instead of '' */
    00047 #define OGR_GEOMETRY_DEFAULT_NON_EMPTY_NAME     "_ogr_geometry_"
    00048
    00049 #ifdef CPL_MSB
    00050 #  define OGR_SWAP(x)   (x == wkbNDR)
    00051 #else
    00052 #  define OGR_SWAP(x)   (x == wkbXDR)
    00053 #endif
    00054
    00055 /* -------------------------------------------------------------------- */
    00056 /*      helper function for parsing well known text format vector objects.*/
    00057 /* -------------------------------------------------------------------- */
    00058
    00059 #ifdef _OGR_GEOMETRY_H_INCLUDED
    00060 #define OGR_WKT_TOKEN_MAX       64
    00061
    00062 const char CPL_DLL * OGRWktReadToken( const char * pszInput, char * pszToken );
    00063
    00064 const char CPL_DLL * OGRWktReadPoints( const char * pszInput,
    00065                                        OGRRawPoint **ppaoPoints,
    00066                                        double **ppadfZ,
    00067                                        int * pnMaxPoints,
    00068                                        int * pnReadPoints );
    00069
    00070 void CPL_DLL OGRMakeWktCoordinate( char *, double, double, double, int );
    00071
    00072 #endif
    00073
    00074 void OGRFormatDouble( char *pszBuffer, int nBufferLen, double dfVal, char chDecimalSep, int nPrecision = 15 );
    00075
    00076 /* -------------------------------------------------------------------- */
    00077 /*      Date-time parsing and processing functions                      */
    00078 /* -------------------------------------------------------------------- */
    00079
    00080 /* Internal use by OGR drivers only, CPL_DLL is just there in case */
    00081 /* they are compiled as plugins  */
    00082 int CPL_DLL OGRGetDayOfWeek(int day, int month, int year);
    00083 int CPL_DLL OGRParseXMLDateTime( const char* pszXMLDateTime,
    00084                                int *pnYear, int *pnMonth, int *pnDay,
    00085                                int *pnHour, int *pnMinute, float* pfSecond, int *pnTZ);
    00086 int CPL_DLL OGRParseRFC822DateTime( const char* pszRFC822DateTime,
    00087                                   int *pnYear, int *pnMonth, int *pnDay,
    00088                                   int *pnHour, int *pnMinute, int *pnSecond, int *pnTZ);
    00089 char CPL_DLL * OGRGetRFC822DateTime(int year, int month, int day,
    00090                                     int hour, int minute, int second, int TZ);
    00091 char CPL_DLL * OGRGetXMLDateTime(int year, int month, int day,
    00092                                  int hour, int minute, int second, int TZFlag);
    00093 char CPL_DLL * OGRGetXML_UTF8_EscapedString(const char* pszString);
    00094
    00095 int OGRCompareDate(   OGRField *psFirstTuple,
    00096                       OGRField *psSecondTuple ); /* used by ogr_gensql.cpp and ogrfeaturequery.cpp */
    00097
    00098 /* General utility option processing. */
    00099 int CPL_DLL OGRGeneralCmdLineProcessor( int nArgc, char ***ppapszArgv, int nOptions );
    00100
    00101 /************************************************************************/
    00102 /*     Support for special attributes (feature query and selection)     */
    00103 /************************************************************************/
    00104 #define SPF_FID 0
    00105 #define SPF_OGR_GEOMETRY 1
    00106 #define SPF_OGR_STYLE 2
    00107 #define SPF_OGR_GEOM_WKT 3
    00108 #define SPF_OGR_GEOM_AREA 4
    00109 #define SPECIAL_FIELD_COUNT 5
    00110
    00111 extern const char* SpecialFieldNames[SPECIAL_FIELD_COUNT];
    00112
    00113 #ifdef _SWQ_H_INCLUDED_
    00114 extern const swq_field_type SpecialFieldTypes[SPECIAL_FIELD_COUNT];
    00115 #endif
    00116
    00117 /************************************************************************/
    00118 /*     Some SRS related stuff, search in SRS data files.                */
    00119 /************************************************************************/
    00120
    00121 OGRErr CPL_DLL OSRGetEllipsoidInfo( int, char **, double *, double *);
    00122
    00123 /* Fast atof function */
    00124 double OGRFastAtof(const char* pszStr);
    00125
    00126 OGRErr CPL_DLL OGRCheckPermutation(int* panPermutation, int nSize);
    00127
    00128 /* GML related */
    00129
    00130 OGRGeometry *GML2OGRGeometry_XMLNode( const CPLXMLNode *psNode,
    00131                                       int bGetSecondaryGeometryOption,
    00132                                       int nRecLevel = 0,
    00133                                       int bIgnoreGSG = FALSE,
    00134                                       int bOrientation = TRUE,
    00135                                       int bFaceHoleNegative = FALSE );
    00136
    00137 /************************************************************************/
    00138 /*                        PostGIS EWKB encoding                         */
    00139 /************************************************************************/
    00140
    00141 OGRGeometry CPL_DLL *OGRGeometryFromEWKB( GByte *pabyWKB, int nLength, int* pnSRID );
    00142 OGRGeometry CPL_DLL *OGRGeometryFromHexEWKB( const char *pszBytea, int* pnSRID );
    00143 char CPL_DLL * OGRGeometryToHexEWKB( OGRGeometry * poGeometry, int nSRSId );
    00144
    00145 /************************************************************************/
    00146 /*                        WKB Type Handling encoding                    */
    00147 /************************************************************************/
    00148
    00149 OGRErr OGRReadWKBGeometryType( unsigned char * pabyData, OGRwkbGeometryType *eGeometryType, OGRBoolean *b3D );
    00150
    00151 #endif /* ndef OGR_P_H_INCLUDED */

Generated for GDAL by 1.7.1.