I am having some problems getting the row values from the CSV file below
CSV
minzoom, maxzoom
0,5
5,10
10,18
My Code :
i = 0
for line in open("C:/Marine/lookup/distinct_lookup_scales.csv"):
i = i + 1
if (i > 1): #Skip header
print("Line: " + line)
#csv_row = line.split(',')
minzoom = str(line[0])
maxzoom = str(line[2])
print("Minzoom:" + minzoom)
print("Maxzoom:" + maxzoom)
readShpFile(minzoom, maxzoom)
The values returned for minzoom and maxzoom has been
0 5
5 1
1 ,
I had used line split but reverted to trying to get items from the line Not sure if that was the best approach
minzoom, maxzoom = line.split(',')? Indexing doesn't work, as the zoom can be more than 10 which means you need two characters instead of one and you' may need to shift the max zoom location.