view flys-backend/contrib/shpimporter/utils.py @ 2867:6442b30d80ec

The python crosssectiontrack importer now also searches for 'STATION' field to extract the current km. flys-backend/trunk@4373 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author Ingo Weinzierl <ingo.weinzierl@intevation.de>
date Thu, 10 May 2012 06:01:17 +0000
parents 5a654f2e35bc
children 59ca5dab2782
line wrap: on
line source
import os

SHP='.shp'

def findShapefiles(path):
    shapes = []

    for root, dirs, files in os.walk(path):
        if len(files) == 0:
            continue

        print "Processing directory '%s' with %i files " % (root, len(files))

        for f in files:
            idx = f.find(SHP)
            if (idx+len(SHP)) == len(f):
                shapes.append((f.replace(SHP, ''), root + "/" + f))

    return shapes

http://dive4elements.wald.intevation.org