Ignore:
Timestamp:
08/06/07 14:47:23 (12 years ago)
Author:
domlowe
Message:

Fixed problem with relative paths in CSML documents

File:
1 edited

Legend:

Unmodified
Added
Removed
  • TI02-CSML/trunk/csml/API/csmlContainer.py

    r2387 r2567  
    44    '''CSMLContainer object is used to hold features before generating a CSML document. This is useful because it allows you to subset several features sequentially then build a single CSML document containing all the subsetted features ''' 
    55     
    6     def __init__(self,csmlpath='myfile.xml',docID='none',metadata='unspecified'): 
    7         self.csmlpath=csmlpath 
     6    def __init__(self,outputdir, csmlname='myfile.xml',docID='none',metadata='unspecified'): 
     7        self.outputdir =outputdir 
     8        self.csmlname=csmlname 
    89        ''' Initialise CSML Dataset and FeatureCollection and populate with basic Metadata''' 
    910        ''' 
     
    7071        strCSML=csml.parser_extra.PrettyPrint(csmlout) 
    7172        strCSML=csml.parser_extra.removeInlineNS(strCSML) 
    72         f=open(self.csmlpath,'w') 
     73        csml.csmllibs.csmlextra.checkDirExists(self.outputdir) 
     74        filepath=self.outputdir + '/' + self.csmlname 
     75        f=open(filepath,'w') 
    7376        f.write(strCSML) 
    7477        f.close() 
    75         self.containerContents.append(self.csmlpath) 
     78        self.containerContents.append(self.csmlname) 
    7679        for ncfile in self.ncfiles: 
    7780            self.containerContents.append(ncfile) 
Note: See TracChangeset for help on using the changeset viewer.