Commit 369dd3c5 authored by Mario Chirinos's avatar Mario Chirinos

colonias

parent cb736546
This diff is collapsed.
...@@ -7,15 +7,15 @@ import csv ...@@ -7,15 +7,15 @@ import csv
import os import os
import datetime import datetime
#=============================================================================== #===============================================================================
def createDirectories(datafile, cfgfile): def createDirectories(datafile, cfgfile, level1="CVE_ENT", level2="CVE_MUN"):
with open(cfgfile) as cfg_file: with open(cfgfile) as cfg_file:
cfg = json.load(cfg_file) cfg = json.load(cfg_file)
with open(datafile) as csvfile: with open(datafile) as csvfile:
data = csv.DictReader(csvfile, delimiter=',') data = csv.DictReader(csvfile, delimiter=',')
for row in data: for row in data:
mun = row["CVE_MUN"] mun = row[level1]
ent = row["CVE_ENT"] ent = row[level2]
dirname = ent+mun dirname = ent+mun
print(ent) print(ent)
# for k in cfg.keys(): # for k in cfg.keys():
......
...@@ -8,6 +8,7 @@ import csv ...@@ -8,6 +8,7 @@ import csv
def getMinMax(clase): def getMinMax(clase):
polylist = [] polylist = []
for item in os.listdir("."): for item in os.listdir("."):
if os.path.isdir(item): if os.path.isdir(item):
print(item) print(item)
...@@ -23,6 +24,7 @@ def getMinMax(clase): ...@@ -23,6 +24,7 @@ def getMinMax(clase):
values.append(v[clase]) values.append(v[clase])
minval = min(values) minval = min(values)
maxval = max(values) maxval = max(values)
polylist.append({"clave": item, "wkt":wkt, "min":minval, "max":maxval}) polylist.append({"clave": item, "wkt":wkt, "min":minval, "max":maxval})
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment