Changeset 13191

Show
Ignore:
Timestamp:
12/02/07 10:12:23 (7 months ago)
Author:
ajolma
Message:

compiles and tests ok, almost all language specifics are in language subdir

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • sandbox/ajolma/swig/include/ColorEntry.i

    r13189 r13191  
    1 %aaa 
    21%rename (ColorEntry) GDALColorEntry; 
    32typedef struct 
  • sandbox/ajolma/swig/include/ColorTable.i

    r13189 r13191  
    6161        return GDALGetPaletteInterpretation(self); 
    6262    } 
    63  
    64 #ifdef SWIGRUBY  
    65 %rename (get_count) GetColorEntryCount;  
    66 #else  
    67 %rename (GetCount) GetColorEntryCount;  
    68 #endif   
    6963   
    70     int GetColorEntryCount() { 
     64    int GetCount() { 
    7165        return GDALGetColorEntryCount(self); 
    7266    } 
  • sandbox/ajolma/swig/include/GCP.i

    r13189 r13191  
    1111%immutable; 
    1212 
    13   GDAL_GCP( double x = 0.0, double y = 0.0, double z = 0.0, 
    14             double pixel = 0.0, double line = 0.0, 
    15             const char *info = "", const char *id = "" ) { 
     13  GDAL_GCP( double x, double y, double z = 0, 
     14            double pixel = 0, double line = 0, 
     15            const char *info = NULL, const char *id = NULL) { 
    1616    GDAL_GCP *self = (GDAL_GCP*) CPLMalloc( sizeof( GDAL_GCP ) ); 
    1717    self->dfGCPX = x; 
     
    3737}; /* GDAL_GCP */ 
    3838%inline %{ 
     39 
     40    GDAL_GCP *new_GDAL_GCP( double x, double y, double z, 
     41                            double pixel, double line, 
     42                            const char *info, const char *id) { 
     43        GDAL_GCP *self = (GDAL_GCP*) CPLMalloc( sizeof( GDAL_GCP ) ); 
     44        self->dfGCPX = x; 
     45        self->dfGCPY = y; 
     46        self->dfGCPZ = z; 
     47        self->dfGCPPixel = pixel; 
     48        self->dfGCPLine = line; 
     49        self->pszInfo =  CPLStrdup( (info == 0) ? "" : info ); 
     50        self->pszId = CPLStrdup( (id==0)? "" : id ); 
     51        return self; 
     52    } 
    3953 
    4054double GDAL_GCP_GCPX_get( GDAL_GCP *h ) { 
     
    8599} 
    86100 
    87  
    88  
    89 /* Duplicate, but transposed names for C# because  
    90 *  the C# module outputs backwards names 
    91 */ 
    92 double GDAL_GCP_get_GCPX( GDAL_GCP *h ) { 
    93   return h->dfGCPX; 
    94 } 
    95 void GDAL_GCP_set_GCPX( GDAL_GCP *h, double val ) { 
    96   h->dfGCPX = val; 
    97 } 
    98 double GDAL_GCP_get_GCPY( GDAL_GCP *h ) { 
    99   return h->dfGCPY; 
    100 } 
    101 void GDAL_GCP_set_GCPY( GDAL_GCP *h, double val ) { 
    102   h->dfGCPY = val; 
    103 } 
    104 double GDAL_GCP_get_GCPZ( GDAL_GCP *h ) { 
    105   return h->dfGCPZ; 
    106 } 
    107 void GDAL_GCP_set_GCPZ( GDAL_GCP *h, double val ) { 
    108   h->dfGCPZ = val; 
    109 } 
    110 double GDAL_GCP_get_GCPPixel( GDAL_GCP *h ) { 
    111   return h->dfGCPPixel; 
    112 } 
    113 void GDAL_GCP_set_GCPPixel( GDAL_GCP *h, double val ) { 
    114   h->dfGCPPixel = val; 
    115 } 
    116 double GDAL_GCP_get_GCPLine( GDAL_GCP *h ) { 
    117   return h->dfGCPLine; 
    118 } 
    119 void GDAL_GCP_set_GCPLine( GDAL_GCP *h, double val ) { 
    120   h->dfGCPLine = val; 
    121 } 
    122 const char * GDAL_GCP_get_Info( GDAL_GCP *h ) { 
    123   return h->pszInfo; 
    124 } 
    125 void GDAL_GCP_set_Info( GDAL_GCP *h, const char * val ) { 
    126   if ( h->pszInfo )  
    127     CPLFree( h->pszInfo ); 
    128   h->pszInfo = CPLStrdup(val); 
    129 } 
    130 const char * GDAL_GCP_get_Id( GDAL_GCP *h ) { 
    131   return h->pszId; 
    132 } 
    133 void GDAL_GCP_set_Id( GDAL_GCP *h, const char * val ) { 
    134   if ( h->pszId )  
    135     CPLFree( h->pszId ); 
    136   h->pszId = CPLStrdup(val); 
    137 } 
    138  
    139101%} //%inline  
    140102 
    141103%apply (IF_FALSE_RETURN_NONE) { (FALSE_IS_ERR) }; 
    142104FALSE_IS_ERR GDALGCPsToGeoTransform( int nGCPs, GDAL_GCP const * pGCPs,  
    143                                      double argout[6], int bApproxOK = 1 );  
     105                                     double argout[6], int bApproxOK );  
    144106%clear (FALSE_IS_ERR); 
  • sandbox/ajolma/swig/include/OGRGeometry.i

    r13189 r13191  
    118118  }  
    119119 
    120   void GetPoint(int iPoint = 0, double argout[3] = NULL) { 
     120  void GetPoint(int iPoint, double argout[3]) { 
    121121    OGR_G_GetPoint( self, iPoint, argout+0, argout+1, argout+2 ); 
    122122  } 
    123123 
    124   void GetPoint_2D(int iPoint = 0, double argout[2] = NULL) { 
     124  void GetPoint_2D(int iPoint, double argout[2]) { 
    125125    OGR_G_GetPoint( self, iPoint, argout+0, argout+1, NULL ); 
    126126  } 
  • sandbox/ajolma/swig/include/cpl.i

    r13189 r13191  
    2929 *****************************************************************************/ 
    3030 
    31  
    32 #ifdef SWIGRUBY 
    33 %rename (push_error_handler) CPLPushErrorHandler; 
    34 %rename (pop_error_handler) CPLPopErrorHandler; 
    35 %rename (error_reset) CPLErrorReset; 
    36 %rename (get_last_error_no) CPLGetLastErrorNo; 
    37 %rename (get_last_error_type) CPLGetLastErrorType; 
    38 %rename (get_last_error_msg) CPLGetLastErrorMsg; 
    39 %rename (push_finder_location) CPLPushFinderLocation; 
    40 %rename (pop_finder_location) CPLPopFinderLocation; 
    41 %rename (finder_clean) CPLFinderClean; 
    42 %rename (find_file) CPLFindFile; 
    43 %rename (read_dir) VSIReadDir; 
    44 %rename (set_config_option) CPLSetConfigOption; 
    45 %rename (get_config_option) CPLGetConfigOption; 
    46 %rename (binary_to_hex) CPLBinaryToHex; 
    47 %rename (hex_to_binary) CPLHexToBinary; 
    48 #else 
    49 %rename (PushErrorHandler) CPLPushErrorHandler; 
    50 %rename (PopErrorHandler) CPLPopErrorHandler; 
    51 %rename (ErrorReset) CPLErrorReset; 
    52 %rename (GetLastErrorNo) CPLGetLastErrorNo; 
    53 %rename (GetLastErrorType) CPLGetLastErrorType; 
    54 %rename (GetLastErrorMsg) CPLGetLastErrorMsg; 
    55 %rename (PushFinderLocation) CPLPushFinderLocation; 
    56 %rename (PopFinderLocation) CPLPopFinderLocation; 
    57 %rename (FinderClean) CPLFinderClean; 
    58 %rename (FindFile) CPLFindFile; 
    59 %rename (ReadDir) VSIReadDir; 
    60 %rename (SetConfigOption) CPLSetConfigOption; 
    61 %rename (GetConfigOption) CPLGetConfigOption; 
    62 %rename (CPLBinaryToHex) CPLBinaryToHex; 
    63 %rename (CPLHexToBinary) CPLHexToBinary; 
    64 #endif 
     31%include cpl_renames.i 
    6532 
    6633void CPLPushErrorHandler( CPLErrorHandler ); 
     
    9562char *CPLBinaryToHex( int nBytes, const GByte *pabyData ); 
    9663GByte *CPLHexToBinary( const char *pszHex, int *pnBytes ); 
    97  
  • sandbox/ajolma/swig/include/exception.i

    r13189 r13191  
    3232 *****************************************************************************/ 
    3333 
     34%inline %{ 
     35  void VeryQuiteErrorHandler(CPLErr eclass, int code, const char *msg ) { 
     36    /* If the error class is CE_Fatal, we want to have a message issued 
     37       because the CPL support code does an abort() before any exception 
     38       can be generated */ 
     39    if (eclass == CE_Fatal ) { 
     40      CPLDefaultErrorHandler(eclass, code, msg ); 
     41    } 
     42  } 
     43 
     44  void UseExceptions() { 
     45    CPLSetErrorHandler( (CPLErrorHandler) VeryQuiteErrorHandler ); 
     46  } 
     47   
     48  void DontUseExceptions() { 
     49    CPLSetErrorHandler( CPLDefaultErrorHandler ); 
     50  } 
     51 
     52  static char const * 
     53    OGRErrMessages( int rc ) { 
     54    switch( rc ) { 
     55    case OGRERR_NONE: 
     56      return "OGR Error: None"; 
     57    case OGRERR_NOT_ENOUGH_DATA: 
     58      return "OGR Error: Not enough data to deserialize"; 
     59    case OGRERR_NOT_ENOUGH_MEMORY: 
     60      return "OGR Error: Not enough memory"; 
     61    case OGRERR_UNSUPPORTED_GEOMETRY_TYPE: 
     62      return "OGR Error: Unsupported geometry type"; 
     63    case OGRERR_UNSUPPORTED_OPERATION: 
     64      return "OGR Error: Unsupported operation"; 
     65    case OGRERR_CORRUPT_DATA: 
     66      return "OGR Error: Corrupt data"; 
     67    case OGRERR_FAILURE: 
     68      return "OGR Error: General Error"; 
     69    case OGRERR_UNSUPPORTED_SRS: 
     70      return "OGR Error: Unsupported SRS"; 
     71    case OGRERR_INVALID_HANDLE: 
     72      return "OGR Error: Invalid handle"; 
     73    default: 
     74      return "OGR Error: Unknown"; 
     75    } 
     76  } 
     77 
     78  void Debug( const char *msg_class, const char *message ) { 
     79    CPLDebug( msg_class, message ); 
     80  } 
     81  void Error( CPLErr msg_class = CE_Failure, int err_code = 0, const char* msg = "error" ) { 
     82    CPLError( msg_class, err_code, msg ); 
     83  } 
     84 
     85  CPLErr PushErrorHandler( char const * pszCallbackName = "CPLQuietErrorHandler" ) { 
     86    CPLErrorHandler pfnHandler = NULL; 
     87    if( EQUAL(pszCallbackName,"CPLQuietErrorHandler") ) 
     88      pfnHandler = CPLQuietErrorHandler; 
     89    else if( EQUAL(pszCallbackName,"CPLDefaultErrorHandler") ) 
     90      pfnHandler = CPLDefaultErrorHandler; 
     91    else if( EQUAL(pszCallbackName,"CPLLoggingErrorHandler") ) 
     92      pfnHandler = CPLLoggingErrorHandler; 
     93 
     94    if ( pfnHandler == NULL ) 
     95      return CE_Fatal; 
     96 
     97    CPLPushErrorHandler( pfnHandler ); 
     98 
     99    return CE_None; 
     100  } 
     101 
     102%} 
     103 
    34104%exception { 
    35105    CPLErrorReset(); 
  • sandbox/ajolma/swig/include/gdal.i

    r13189 r13191  
    2929 *****************************************************************************/ 
    3030 
    31 /* init is language specific */ 
    3231%include gdal_init.i 
    33  
    34 %feature ("compactdefaultargs"); 
    35  
    3632%include gdal_headers.i 
    37 %include cpl_headers.i 
    3833%include gdal_enums.i 
    39  
    4034%include exception.i 
    41  
    42 /* typemaps are language specific */ 
    4335%include gdal_typemaps.i 
    44  
    4536%include cpl.i 
    46  
    47 /* renames are language specific */ 
    4837%include gdal_renames.i 
    49  
    5038%include gdal_global.i 
    51  
    52 /* which classes to use, is language specific */ 
    5339%include gdal_classes.i 
    54  
    55 %include Operations.i 
    56  
    57 /* language specific extensions */ 
    5840%include gdal_extensions.i 
  • sandbox/ajolma/swig/include/gdal_global.i

    r13189 r13191  
    1 const char *GDALVersionInfo( const char *request = "VERSION_NUM" ); 
     1const char *GDALVersionInfo( const char *request ); 
    22 
    33void GDALAllRegister(); 
     
    2121const char *GDALGetPaletteInterpretationName( GDALPaletteInterp ); 
    2222 
    23 const char *GDALDecToDMS( double, const char *, int = 2 ); 
     23const char *GDALDecToDMS( double, const char *, int ); 
    2424 
    2525double GDALPackedDMSToDec( double ); 
     
    2727double GDALDecToPackedDMS( double ); 
    2828 
    29  
    30 #if defined(SWIGCSHARP) 
    31 %newobject CPLParseXMLString; 
    32 #endif 
    3329CPLXMLNode *CPLParseXMLString( char * ); 
    3430 
  • sandbox/ajolma/swig/include/gdal_headers.i

    r13189 r13191  
    1010#include "gdal_alg.h" 
    1111#include "gdalwarper.h" 
     12#include "ogr_core.h" 
    1213 
    1314typedef void GDALMajorObjectShadow; 
  • sandbox/ajolma/swig/include/gdalconst.i

    r13189 r13191  
    2929 *****************************************************************************/ 
    3030 
    31 #ifdef PERL_CPAN_NAMESPACE 
    32 %module "Geo::GDAL::Const" 
    33 #elif defined(SWIGCSHARP) 
    34 %module GdalConst 
    35 #else 
    36 %module gdalconst  
    37 #endif 
    38  
    39 #if defined(SWIGJAVA) 
    40 %include gdalconst_java.i 
    41 #endif 
     31%include gdalconst_init.i 
    4232 
    4333%{ 
  • sandbox/ajolma/swig/include/ogr.i

    r13189 r13191  
    2929 
    3030%include ogr_init.i 
    31  
    32 %feature("compactdefaultargs"); 
    33 %feature("autodoc"); 
    34  
    3531%include ogr_headers.i 
    36 %include cpl_headers.i 
    3732%include ogr_enums.i 
    38  
    3933%include exception.i 
    40  
    41 /* typemaps are language specific */ 
    4234%include gdal_typemaps.i 
    43  
    4435%import osr.i 
    45  
    46 /* renames are language specific */ 
    4736%include ogr_renames.i 
    48  
    4937%include ogr_global.i 
    50  
    5138%include ogr_classes.i 
    52  
    53 /* language specific extensions */ 
    5439%include ogr_extensions.i 
  • sandbox/ajolma/swig/include/ogr_global.i

    r13189 r13191  
    33/* -------------------------------------------------------------------- */ 
    44 
    5 #ifndef SWIGJAVA 
    65%feature( "kwargs" ) CreateGeometryFromWkb; 
     6#ifndef SWIGCSHARP 
     7%apply (int nLen, char *pBuf ) { (int len, void *buffer_ptr)}; 
     8#endif 
    79%newobject CreateGeometryFromWkb; 
    8 #ifndef SWIGCSHARP 
    9 %apply (int nLen, char *pBuf ) { (int len, char *bin_string)}; 
    10 #else 
    11 %apply (void *buffer_ptr) {char *bin_string}; 
    12 #endif 
    1310%inline %{ 
    14   OGRGeometryShadow* CreateGeometryFromWkb( int len, char *bin_string,  
     11  OGRGeometryShadow* CreateGeometryFromWkb( int len, void *buffer_ptr,  
    1512                                            OSRSpatialReferenceShadow *reference=NULL ) { 
    1613    void *geom; 
    17     OGRErr err = OGR_G_CreateFromWkb( (unsigned char *) bin_string
     14    OGRErr err = OGR_G_CreateFromWkb( (unsigned char *) buffer_ptr
    1815                                      reference, 
    1916                                      &geom, 
     
    2724  
    2825%} 
    29 #endif 
    3026#ifndef SWIGCSHARP 
    31 %clear (int len, char *bin_string); 
    32 #else 
    33 %clear (char *bin_string); 
    34 #endif 
    35  
    36 #ifdef SWIGJAVA 
    37 %newobject CreateGeometryFromWkb; 
    38 %feature("kwargs") CreateGeometryFromWkb; 
    39 %inline { 
    40 OGRGeometryShadow* CreateGeometryFromWkb(int nLen, unsigned char *pBuf,  
    41                                             OSRSpatialReferenceShadow *reference=NULL ) { 
    42     void *geom; 
    43     OGRErr err = OGR_G_CreateFromWkb((unsigned char*) pBuf, reference, &geom, nLen); 
    44     if (err != 0 ) { 
    45        CPLError(CE_Failure, err, "%s", OGRErrMessages(err)); 
    46        return NULL; 
    47     } 
    48     return (OGRGeometryShadow*) geom; 
    49   } 
    50 
     27%clear (int len, void *buffer_ptr); 
    5128#endif 
    5229 
     
    11188%} 
    11289 
    113 #ifndef GDAL_BINDINGS 
    11490int OGRGetDriverCount(); 
    115 #endif 
    11691 
    11792int OGRGetOpenDSCount(); 
     
    160135%} 
    161136 
    162 #ifndef GDAL_BINDINGS 
    163137%inline %{ 
    164138OGRDriverShadow* GetDriverByName( char const *name ) { 
     
    170144} 
    171145%} 
    172 #endif 
  • sandbox/ajolma/swig/include/osr.i

    r13189 r13191  
    2929 
    3030%include osr_init.i 
    31  
    32 %feature("compactdefaultargs"); 
    33  
    3431%include osr_headers.i 
    35 %include cpl_headers.i 
    3632%include osr_enums.i 
    37  
    3833%include exception.i 
    39  
    4034%include gdal_typemaps.i 
    41  
     35%include osr_renames.i 
    4236%include osr_global.i 
    43  
    4437%include osr_classes.i 
    45  
    4638%include osr_extensions.i 
  • sandbox/ajolma/swig/include/osr_global.i

    r13189 r13191  
    4040 
    4141#if !defined(SWIGPYTHON) 
    42 %rename (GetProjectionMethods) OPTGetProjectionMethods; 
    4342%apply (char **CSL) {(char **)}; 
    4443char **OPTGetProjectionMethods(); 
    4544%clear (char **); 
    4645 
    47 %rename (GetProjectionMethodParameterList) OPTGetParameterList; 
    4846%apply (char **CSL) {(char **)}; 
    4947char **OPTGetParameterList( char *method, char **username ); 
    5048%clear (char **); 
    5149 
    52 %rename (GetProjectionMethodParamInfo) OPTGetParameterInfo; 
    5350void OPTGetParameterInfo( char *method, char *param, char **usrname, 
    5451                          char **type, double *defaultval ); 
  • sandbox/ajolma/swig/include/osr_headers.i

    r13189 r13191  
    55#include "cpl_string.h" 
    66#include "cpl_conv.h" 
    7  
    87#include "ogr_srs_api.h" 
     8#include "ogr_core.h" 
    99 
    1010typedef void OSRSpatialReferenceShadow; 
    1111typedef void OSRCoordinateTransformationShadow; 
    12  
    1312%} 
  • sandbox/ajolma/swig/include/perl/gdal_classes.i

    r13189 r13191  
    1 %include XMLNode.i 
    21%include MajorObject.i 
    32%include Driver.i 
     
    76%include ColorTable.i 
    87%include RasterAttributeTable.i 
    9  
     8%include Operations.i 
  • sandbox/ajolma/swig/include/perl/gdal_enums.i

    r13189 r13191  
    1 //************************************************************************ 
    2 // 
    3 // Enums. 
    4 // 
    5 //************************************************************************ 
    6  
    7 #ifndef SWIGCSHARP 
    81typedef int CPLErr; 
    92typedef int GDALPaletteInterp; 
     
    125typedef int GDALDataType; 
    136typedef int GDALResampleAlg; 
    14 #else 
    15 /*! Pixel data types */ 
    16 %rename (DataType) GDALDataType; 
    17 typedef enum { 
    18     GDT_Unknown = 0, 
    19     /*! Eight bit unsigned integer */           GDT_Byte = 1, 
    20     /*! Sixteen bit unsigned integer */         GDT_UInt16 = 2, 
    21     /*! Sixteen bit signed integer */           GDT_Int16 = 3, 
    22     /*! Thirty two bit unsigned integer */      GDT_UInt32 = 4, 
    23     /*! Thirty two bit signed integer */        GDT_Int32 = 5, 
    24     /*! Thirty two bit floating point */        GDT_Float32 = 6, 
    25     /*! Sixty four bit floating point */        GDT_Float64 = 7, 
    26     /*! Complex Int16 */                        GDT_CInt16 = 8, 
    27     /*! Complex Int32 */                        GDT_CInt32 = 9, 
    28     /*! Complex Float32 */                      GDT_CFloat32 = 10, 
    29     /*! Complex Float64 */                      GDT_CFloat64 = 11, 
    30     GDT_TypeCount = 12          /* maximum type # + 1 */ 
    31 } GDALDataType; 
    32  
    33 /*! Types of color interpretation for raster bands. */ 
    34 %rename (ColorInterp) GDALColorInterp; 
    35 typedef enum 
    36 { 
    37     GCI_Undefined=0, 
    38     /*! Greyscale */                                      GCI_GrayIndex=1, 
    39     /*! Paletted (see associated color table) */          GCI_PaletteIndex=2, 
    40     /*! Red band of RGBA image */                         GCI_RedBand=3, 
    41     /*! Green band of RGBA image */                       GCI_GreenBand=4, 
    42     /*! Blue band of RGBA image */                        GCI_BlueBand=5, 
    43     /*! Alpha (0=transparent, 255=opaque) */              GCI_AlphaBand=6, 
    44     /*! Hue band of HLS image */                          GCI_HueBand=7, 
    45     /*! Saturation band of HLS image */                   GCI_SaturationBand=8, 
    46     /*! Lightness band of HLS image */                    GCI_LightnessBand=9, 
    47     /*! Cyan band of CMYK image */                        GCI_CyanBand=10, 
    48     /*! Magenta band of CMYK image */                     GCI_MagentaBand=11, 
    49     /*! Yellow band of CMYK image */                      GCI_YellowBand=12, 
    50     /*! Black band of CMLY image */                       GCI_BlackBand=13, 
    51     /*! Y Luminance */                                    GCI_YCbCr_YBand=14, 
    52     /*! Cb Chroma */                                      GCI_YCbCr_CbBand=15, 
    53     /*! Cr Chroma */                                      GCI_YCbCr_CrBand=16, 
    54     /*! Max current value */                              GCI_Max=16 
    55 } GDALColorInterp; 
    56  
    57 /*! Types of color interpretations for a GDALColorTable. */ 
    58 %rename (PaletteInterp) GDALPaletteInterp; 
    59 typedef enum  
    60 { 
    61   /*! Grayscale (in GDALColorEntry.c1) */                      GPI_Gray=0, 
    62   /*! Red, Green, Blue and Alpha in (in c1, c2, c3 and c4) */  GPI_RGB=1, 
    63   /*! Cyan, Magenta, Yellow and Black (in c1, c2, c3 and c4)*/ GPI_CMYK=2, 
    64   /*! Hue, Lightness and Saturation (in c1, c2, and c3) */     GPI_HLS=3 
    65 } GDALPaletteInterp; 
    66  
    67 /*! Flag indicating read/write, or read-only access to data. */ 
    68 %rename (Access) GDALAccess; 
    69 typedef enum { 
    70     /*! Read only (no update) access */ GA_ReadOnly = 0, 
    71     /*! Read/write access. */           GA_Update = 1 
    72 } GDALAccess; 
    73  
    74 /*! Read/Write flag for RasterIO() method */ 
    75 %rename (RWFlag) GDALRWFlag; 
    76 typedef enum { 
    77     /*! Read data */   GF_Read = 0, 
    78     /*! Write data */  GF_Write = 1 
    79 } GDALRWFlag; 
    80  
    81 /*! Warp Resampling Algorithm */ 
    82 %rename (ResampleAlg) GDALResampleAlg; 
    83 typedef enum { 
    84   /*! Nearest neighbour (select on one input pixel) */ GRA_NearestNeighbour=0, 
    85   /*! Bilinear (2x2 kernel) */                         GRA_Bilinear=1, 
    86   /*! Cubic Convolution Approximation (4x4 kernel) */  GRA_Cubic=2, 
    87   /*! Cubic B-Spline Approximation (4x4 kernel) */     GRA_CubicSpline=3, 
    88 } GDALResampleAlg; 
    89  
    90 typedef enum 
    91 { 
    92     CE_None = 0, 
    93     CE_Log = 1, 
    94     CE_Warning = 2, 
    95     CE_Failure = 3, 
    96     CE_Fatal = 4 
    97 } CPLErr; 
    98 #endif 
    99  
  • sandbox/ajolma/swig/include/perl/gdal_extensions.i

    r13189 r13191  
    529529                           int bUseNoData, double dfNoDataValue,  
    530530                           OGRLayerShadow *hLayer, int iIDField, int iElevField, 
    531                            GDALProgressFunc callback = NULL
    532                            void* callback_data = NULL) { 
     531                           GDALProgressFunc callback
     532                           void* callback_data) { 
    533533        return GDALContourGenerate( self, dfContourInterval, dfContourBase, 
    534534                                    nFixedLevelCount, padfFixedLevels, 
  • sandbox/ajolma/swig/include/perl/gdal_init.i

    r13189 r13191  
     1#ifdef PERL_CPAN_NAMESPACE 
    12%module "Geo::GDAL" 
     3#else 
     4%module gdal 
     5#endif 
    26 
    37%init %{ 
  • sandbox/ajolma/swig/include/perl/gdal_typemaps.i

    r13189 r13191  
    742742} 
    743743 
    744 %typemap(arginit, noblock=1) ( void* callback_data=NULL
     744%typemap(arginit, noblock=1) ( void* callback_data
    745745{ 
    746746    SavedEnv saved_env; 
     
    749749} 
    750750 
    751 %typemap(in) (GDALProgressFunc callback = NULL
    752 { 
    753     /* %typemap(in) (GDALProgressFunc callback = NULL) */ 
     751%typemap(in) (GDALProgressFunc callback
     752{ 
     753    /* %typemap(in) (GDALProgressFunc callback) */ 
    754754    if (SvOK($input)) { 
    755755        saved_env.fct = (SV *)$input; 
     
    759759} 
    760760 
    761 %typemap(in) (void* callback_data=NULL
    762 { 
    763     /* %typemap(in) (void* callback_data=NULL) */ 
     761%typemap(in) (void* callback_data
     762{ 
     763    /* %typemap(in) (void* callback_data) */ 
    764764    if (SvOK($input)) 
    765765        saved_env.data = (SV *)$input; 
  • sandbox/ajolma/swig/include/perl/ogr_classes.i

    r13189 r13191  
    66%include OGRFieldDefn.i 
    77%include OGRGeometry.i 
    8  
  • sandbox/ajolma/swig/include/perl/ogr_enums.i

    r13189 r13191  
    1 /************************************************************************/ 
    2 /*                         Enumerated types                             */ 
    3 /************************************************************************/ 
    4  
    5 #ifndef SWIGCSHARP 
    61typedef int OGRwkbByteOrder; 
    72typedef int OGRwkbGeometryType; 
    83typedef int OGRFieldType; 
    94typedef int OGRJustification; 
    10 #else 
    11 %rename (wkbByteOrder) OGRwkbByteOrder; 
    12 typedef enum  
    13 { 
    14     wkbXDR = 0,         /* MSB/Sun/Motoroloa: Most Significant Byte First   */ 
    15     wkbNDR = 1          /* LSB/Intel/Vax: Least Significant Byte First      */ 
    16 } OGRwkbByteOrder; 
    175 
    18 %rename (wkbGeometryType) OGRwkbGeometryType; 
    19 typedef enum  
    20 { 
    21     wkbUnknown = 0,             /* non-standard */ 
    22     wkbPoint = 1,               /* rest are standard WKB type codes */ 
    23     wkbLineString = 2, 
    24     wkbPolygon = 3, 
    25     wkbMultiPoint = 4, 
    26     wkbMultiLineString = 5, 
    27     wkbMultiPolygon = 6, 
    28     wkbGeometryCollection = 7, 
    29     wkbNone = 100,              /* non-standard, for pure attribute records */ 
    30     wkbLinearRing = 101,        /* non-standard, just for createGeometry() */ 
    31     wkbPoint25D = -2147483647,   /* 2.5D extensions as per 99-402 */ 
    32     wkbLineString25D = -2147483646, 
    33     wkbPolygon25D = -2147483645, 
    34     wkbMultiPoint25D = -2147483644, 
    35     wkbMultiLineString25D = -2147483643, 
    36     wkbMultiPolygon25D = -2147483642, 
    37     wkbGeometryCollection25D = -2147483641 
    38 } OGRwkbGeometryType; 
    39  
    40 %rename (FieldType) OGRFieldType; 
    41 typedef enum  
    42 { 
    43   /** Simple 32bit integer */                   OFTInteger = 0, 
    44   /** List of 32bit integers */                 OFTIntegerList = 1, 
    45   /** Double Precision floating point */        OFTReal = 2, 
    46   /** List of doubles */                        OFTRealList = 3, 
    47   /** String of ASCII chars */                  OFTString = 4, 
    48   /** Array of strings */                       OFTStringList = 5, 
    49   /** Double byte string (unsupported) */       OFTWideString = 6, 
    50   /** List of wide strings (unsupported) */     OFTWideStringList = 7, 
    51   /** Raw Binary data */                        OFTBinary = 8, 
    52   /** Date */                                   OFTDate = 9, 
    53   /** Time */                                   OFTTime = 10, 
    54   /** Date and Time */                          OFTDateTime = 11 
    55 } OGRFieldType; 
    56  
    57 %rename (Justification) OGRJustification; 
    58 typedef enum  
    59 { 
    60     OJUndefined = 0, 
    61     OJLeft = 1, 
    62     OJRight = 2 
    63 } OGRJustification; 
    64 #endif 
    65  
    66 #ifndef SWIGCSHARP 
    676%constant wkb25Bit = wkb25DBit; 
    687%constant wkbUnknown = 0; 
     
    12160%constant char *ODrCCreateDataSource   = "CreateDataSource"; 
    12261%constant char *ODrCDeleteDataSource   = "DeleteDataSource"; 
    123 #else 
    124 typedef int OGRErr; 
    12562 
    126 #define OGRERR_NONE                0 
    127 #define OGRERR_NOT_ENOUGH_DATA     1    /* not enough data to deserialize */ 
    128 #define OGRERR_NOT_ENOUGH_MEMORY   2 
    129 #define OGRERR_UNSUPPORTED_GEOMETRY_TYPE 3 
    130 #define OGRERR_UNSUPPORTED_OPERATION 4 
    131 #define OGRERR_CORRUPT_DATA        5 
    132 #define OGRERR_FAILURE             6 
    133 #define OGRERR_UNSUPPORTED_SRS     7 
    134  
    135 #define wkb25DBit 0x80000000 
    136 #define ogrZMarker 0x21125711 
    137  
    138 #define OGRNullFID            -1 
    139 #define OGRUnsetMarker        -21121 
    140  
    141 #define OLCRandomRead          "RandomRead" 
    142 #define OLCSequentialWrite     "SequentialWrite" 
    143 #define OLCRandomWrite         "RandomWrite" 
    144 #define OLCFastSpatialFilter   "FastSpatialFilter" 
    145 #define OLCFastFeatureCount    "FastFeatureCount" 
    146 #define OLCFastGetExtent       "FastGetExtent" 
    147 #define OLCCreateField         "CreateField" 
    148 #define OLCTransactions        "Transactions" 
    149 #define OLCDeleteFeature       "DeleteFeature" 
    150 #define OLCFastSetNextByIndex  "FastSetNextByIndex" 
    151  
    152 #define ODsCCreateLayer        "CreateLayer" 
    153 #define ODsCDeleteLayer        "DeleteLayer" 
    154  
    155 #define ODrCCreateDataSource   "CreateDataSource" 
    156 #define ODrCDeleteDataSource   "DeleteDataSource" 
    157 #endif 
     63%inline %{ 
     64    void OGRGeometryShadow_Move(OGRGeometryShadow *g, double dx, double dy, double dz) { 
     65        int n = OGR_G_GetGeometryCount(g); 
     66        if (n > 0) { 
     67            int i; 
     68            for (i = 0; i < n; i++) { 
     69                OGRGeometryShadow *g = (OGRGeometryShadow*)OGR_G_GetGeometryRef(g, i); 
     70                OGRGeometryShadow_Move(g, dx, dy, dz); 
     71            } 
     72        } else { 
     73            int i; 
     74            for (i = 0; i < OGR_G_GetPointCount(g); i++) { 
     75                double x = OGR_G_GetX(g, i); 
     76                double y = OGR_G_GetY(g, i); 
     77                double z = OGR_G_GetZ(g, i); 
     78                OGR_G_SetPoint(g, i, x+dx, y+dy, z+dz); 
     79            } 
     80        } 
     81    } 
     82%} 
  • sandbox/ajolma/swig/include/perl/ogr_extensions.i

    r13189 r13191  
    2828 
    2929    void Move(double dx, double dy, double dz = 0) { 
    30         int n = OGR_G_GetGeometryCount(self); 
    31         if (n > 0) { 
    32             int i; 
    33             for (i = 0; i < n; i++) { 
    34                 OGRGeometryShadow *g = (OGRGeometryShadow*)OGR_G_GetGeometryRef(self, i); 
    35                 OGRGeometryShadow_Move(g, dx, dy, dz); 
    36             } 
    37         } else { 
    38             int i; 
    39             for (i = 0; i < OGR_G_GetPointCount(self); i++) { 
    40                 double x = OGR_G_GetX(self, i); 
    41                 double y = OGR_G_GetY(self, i); 
    42                 double z = OGR_G_GetZ(self, i); 
    43                 OGR_G_SetPoint(self, i, x+dx, y+dy, z+dz); 
    44             } 
    45         } 
     30        OGRGeometryShadow_Move(self, dx, dy, dz); 
    4631    } 
    4732     
  • sandbox/ajolma/swig/include/perl/osr_enums.i

    r13189 r13191  
     1typedef int OGRErr; 
     2 
    13%constant char *SRS_PT_ALBERS_CONIC_EQUAL_AREA  = SRS_PT_ALBERS_CONIC_EQUAL_AREA; 
    24%constant char *SRS_PT_AZIMUTHAL_EQUIDISTANT    = SRS_PT_AZIMUTHAL_EQUIDISTANT; 
     
    8688%constant double SRS_WGS84_SEMIMAJOR             = SRS_WGS84_SEMIMAJOR; 
    8789%constant double SRS_WGS84_INVFLATTENING         = SRS_WGS84_INVFLATTENING; 
    88  
    89 typedef int OGRErr; 
  • sandbox/ajolma/swig/perl/t/gdal.t

    r13189 r13191  
    329329            { 
    330330                my @gcps = (); 
    331                 push @gcps,new Geo::GDAL::GCP(1.1,2.2); 
    332                 push @gcps,new Geo::GDAL::GCP(2.1,3.2); 
     331                push @gcps,new Geo::GDAL::GCP(1.1,2.2,0,0,0,undef,undef); 
     332                push @gcps,new Geo::GDAL::GCP(2.1,3.2,0,0,0,undef,undef); 
    333333                my $po = "ho ho ho"; 
    334334                $dataset->SetGCPs(\@gcps,$po);