Changeset 881

Show
Ignore:
Timestamp:
02/09/09 14:43:57 (18 months ago)
Author:
artem
Message:

+ sqlite-input-plugin.patch (kunitoki)
+ wkb-sqlite.patch (kunitoki)
+ very preliminary spatial index support (idx_<tablename>_<geometry_field>)

Location:
trunk
Files:
8 added
3 modified

Legend:

Unmodified
Added
Removed
  • trunk/SConstruct

    r878 r881  
    8282            'ogr':     {'default':False,'path':'OGR','inc':'ogrsf_frmts.h','lib':'gdal','cxx':True}, 
    8383            'occi':    {'default':False,'path':'OCCI','inc':'occi.h','lib':'ociei','cxx':True}, 
     84            'sqlite':  {'default':False,'path':'SQLITE','inc':'sqlite3.h','lib':'sqlite3','cxx':False}, 
    8485             
    8586            # plugins without external dependencies 
     
    152153opts.Add(PathVariable('OCCI_INCLUDES', 'Search path for OCCI include files', '/usr/lib/oracle/10.2.0.3/client/include/', PathVariable.PathAccept)) 
    153154opts.Add(PathVariable('OCCI_LIBS', 'Search path for OCCI library files', '/usr/lib/oracle/10.2.0.3/client/'+ LIBDIR_SCHEMA, PathVariable.PathAccept)) 
     155opts.Add(PathVariable('SQLITE_INCLUDES', 'Search path for SQLITE include files', '/usr/include/', PathVariable.PathAccept)) 
     156opts.Add(PathVariable('SQLITE_LIBS', 'Search path for SQLITE library files', '/usr/' + LIBDIR_SCHEMA, PathVariable.PathAccept)) 
    154157 
    155158# Other variables 
     
    609612            env.Append(CXXFLAGS = gcc_cxx_flags + '-O0 -fno-inline %s' % debug_flags) 
    610613        else: 
    611             env.Append(CXXFLAGS = gcc_cxx_flags + '-O%s -finline-functions -Wno-inline %s' % (env['OPTIMIZATION'],ndebug_flags)) 
     614            env.Append(CXXFLAGS = gcc_cxx_flags + '-fast -finline-functions -Wno-inline %s' % (ndebug_flags)) 
    612615     
    613616     
  • trunk/include/mapnik/wkb.hpp

    r557 r881  
    3434    { 
    3535    public: 
    36        static void from_wkb(Feature & feature,const char* wkb, unsigned size, bool multiple_geometries = false); 
     36 
     37       static void from_wkb (Feature & feature, 
     38                             const char* wkb, 
     39                             unsigned size, 
     40                             bool multiple_geometries = false, 
     41                             bool sqlite_format = false); 
    3742    private: 
    3843       geometry_utils(); 
  • trunk/src/wkb.cpp

    r879 r881  
    4242         wkbByteOrder byteOrder_; 
    4343         bool needSwap_; 
     44         bool sqliteFormat_; 
     45 
    4446      public: 
    4547         
     
    5456         }; 
    5557         
    56          wkb_reader(const char* wkb,unsigned size) 
     58         wkb_reader(const char* wkb,unsigned size,bool sqliteFormat = false) 
    5759            : wkb_(wkb), 
    5860              size_(size), 
    5961              pos_(0), 
    60               byteOrder_((wkbByteOrder)wkb_[0]) 
    61          { 
    62             ++pos_; 
    63              
     62              sqliteFormat_(sqliteFormat) 
     63         { 
     64            if (sqliteFormat) 
     65            { 
     66              byteOrder_ = (wkbByteOrder) wkb_[1]; 
     67              pos_ = 39; 
     68            } 
     69            else 
     70            { 
     71              byteOrder_ = (wkbByteOrder) wkb_[0]; 
     72              ++pos_; 
     73            } 
     74 
    6475#ifndef WORDS_BIGENDIAN 
    6576            needSwap_=byteOrder_?wkbXDR:wkbNDR; 
     
    341352   }; 
    342353    
    343    void geometry_utils::from_wkb(Feature & feature,const char* wkb, unsigned size, bool multiple_geometries)  
     354   void geometry_utils::from_wkb(Feature & feature,const char* wkb, unsigned size, bool multiple_geometries, bool sqlite_format)  
    344355   { 
    345       wkb_reader reader(wkb,size); 
     356      wkb_reader reader(wkb,size,sqlite_format); 
    346357      if (multiple_geometries) 
    347358         return reader.read_multi(feature);