def __init__(\
                 self, \
                 path = "", \
                 prefix = "", \
                 dbstring = "", \
                 logfile = None, \
                 options = {'g':'geom', 'D':True, 'I':True, 'S':True}, \
                 sep = ',', \
                 text_format = '.txt', \
                 encoding = 'UTF8', \
                 copymode = True, \
                 doclean = True, \
                 subs = {} \
             ):
     self.path = path
     self.prefix = prefix
     self.sqlfile = ""
     self.copymode = copymode
     self.doclean = doclean
     self.encoding = encoding
     self.sep = sep
     self.text_format = text_format
     self.dbstring = dbstring
     self.logfile = logfile
     self.substitutions = subs
     self.found_import_dbfshpfiles = []
     self.found_import_csvtxtfiles = []
     self.sloader = ShpLoader(dbstring = self.dbstring, schema = TEMPSCHEMA, logfile = self.logfile, options = options, doclean = doclean)
     self.ploader = PsqlLoader(dbstring = self.dbstring, logfile=self.logfile)
Example #2
0
 def __init__(self, source = "", prefix = "", dbstring = "", logfile = None,
              options = {'g':'geom', 'D':True, 'I':True, 'S':True}, doclean = True, subs = {}):
     super(ShpImporter, self).__init__(source, dbstring, logfile, doclean, subs)
     self.shapefiles = []
     if isinstance(self.source, list):
         for source in self.source:
             print "Importing source {}".format(source)
             self.prefix = self.get_prefix(source, prefix)
             self.get_shapefiles(source)
     else:
         self.prefix = self.get_prefix(self.source, prefix)
         self.get_shapefiles(source)
         pass
     self.sloader = ShpLoader(dbstring = dbstring, schema = IMPORTSCHEMA,
             logfile = self.logfile, options = options, doclean = doclean)
Example #3
0
 def __init__(self,
              source="",
              prefix="",
              dbstring="",
              logfile=None,
              options={
                  'g': 'geom',
                  'D': True,
                  'I': True,
                  'S': True
              },
              doclean=True):
     super(ShpImporter, self).__init__(source, dbstring, logfile, doclean)
     self.shapefiles = []
     self.prefix = self.get_prefix(prefix)
     self.get_shapefiles()
     self.sloader = ShpLoader(dbstring=dbstring,
                              schema=IMPORTSCHEMA,
                              logfile=self.logfile,
                              options=options,
                              doclean=doclean)