Changeset b39b19b in osmose-backend


Ignore:
Timestamp:
Jun 25, 2014 11:36:11 PM (5 years ago)
Author:
Frédéric Rodrigo <fred.rodrigo@…>
Branches:
master
Children:
29d4cb0
Parents:
99cc108
git-author:
Frédéric Rodrigo <fred.rodrigo@…> (21/06/2014 17:24:05)
git-committer:
Frédéric Rodrigo <fred.rodrigo@…> (25/06/2014 23:36:11)
Message:

Add python docs for merge

File:
1 edited

Legend:

Unmodified
Added
Removed
  • analysers/Analyser_Merge.py

    r0e152b9 rb39b19b  
    242242class CSV: 
    243243    def __init__(self, separator = ',', null = '', header = True, quote = '"', csv = True): 
     244        """ 
     245        Describe the CSV file format, mainly for postgres COPY command in order to load data, but also for other thing, like load header. 
     246        Setting param as None disable parameter into the COPY command. 
     247        @param separator: one char separator 
     248        @param null: string loaded à NULL 
     249        @param header: CSV have header row 
     250        @param quote: one char string delimiter 
     251        @param csv: load file as CSV on COPY command 
     252        """ 
    244253        self.separator = separator 
    245254        self.null = null 
     
    250259class Source: 
    251260    def __init__(self, url = None, name = None, encoding = "utf-8", file = None, csv = CSV()): 
     261        """ 
     262        Describe the source file. 
     263        @param url: remote URL of source file 
     264        @param name: official name of the data set 
     265        @param encoding: file charset encoding 
     266        @param file: file name in storage 
     267        @param csv: the CSV format description 
     268        """ 
    252269        self.url = url 
    253270        self.name = name 
     
    259276    def __init__(self, x = ("NULL",), y = ("NULL",), srid = 4326, table = None, create = None, 
    260277            filter = None, select = {}, where = lambda res: True, xFunction = lambda i: i, yFunction = lambda i: i): 
     278        """ 
     279        Describ the conversion of data set loaded with COPY into the database into an other table more usable for processing. 
     280        @param x: the name of x column, as or converted to longitude, can be a SQL expression formatted as ("SQL CODE",) 
     281        @param y: the name of y column, as or converted to latitude, can be a SQL expression formatted as ("SQL CODE",) 
     282        @param srid: the projection of x and y coordinate 
     283        @param table: the data base table name for load data into, generated automatically by default 
     284        @param create: the data base table description, generated by default from CSV header 
     285        @param filter: lambda expression applied on text file before loading 
     286        @param select: dict reformatted as SQL to filter row CSV import before conversion, prefer this as the where param 
     287        @param where: lambda expression taking row as dict and returning boolean to determine whether or not inserting the row into the table 
     288        @param xFunction: lambda expression for convert x content column before reprojection, identity by default 
     289        @param yFunction: lambda expression for convert y content column before reprojection, identity by default 
     290        """ 
    261291        self.x = x 
    262292        self.y = y 
     
    272302class Select: 
    273303    def __init__(self, types = [], tags = {}): 
     304        """ 
     305        On witch OSM we try to join data set. 
     306        @param types: object types, array of "relations", "ways" and "nodes" 
     307        @param tags: dict of tags or array of dicts, array mean "OR" 
     308        """ 
    274309        self.types = types 
    275310        self.tags = tags 
     
    277312class Generate: 
    278313    def __init__(self, static = {}, mapping = {}, text = lambda tags, fields: {}): 
     314        """ 
     315        How result error file is build. 
     316        @param static: dict of tags apply as is 
     317        @param mapping: dict of tags, if value is string then data set column value is take, else lambda 
     318        @param text: lambda return string, describe this error 
     319        """ 
    279320        self.static = static 
    280321        self.mapping = mapping 
     
    283324class Mapping: 
    284325    def __init__(self, select = Select(), osmRef = "NULL", conflationDistance = None, extraJoin = None, generate = Generate()): 
     326        """ 
     327        How data is mapped with OSM data. 
     328        @param select: fetch OSM data, see Select 
     329        @param osmRef: the osm key for join data on reference 
     330        @param conflationDistance: if no osmRef, do do conflation, use this threshold 
     331        @param extraJoin: additional key condition to join on 
     332        @param generate: build the result, see Generate 
     333        """ 
    285334        self.select = select 
    286335        self.osmRef = osmRef 
Note: See TracChangeset for help on using the changeset viewer.