<commit_before>#!usr/bin/python
'''
Overlay classes and satellite data
'''
import os,csv,json
import utils.gdal_rasterize as gdal_rasterize
from PIL import Image
from functools import partial
from multiprocessing import Pool
from utils.coordinate_converter import CoordConvert
from utils.getImageCoordinates import imageCoordinates
from utils.project import project,projectRev 
from modules.getFeatures import latLon,find_between,find_before
from modules.get_stats import get_stats
from libs.colorlist import colorlist
from libs.foldernames import *

def rasterLayer(i,stats,subpath,size,te):
	'''converts feature geojson to png image'''
	feature=stats[i]
	i+=1
	print "Layer "+str(i)+"/"+str(len(stats))+'\t Processing feature: '+feature
	outFile=subpath+"/f_"+str(i)+".png"
	featureFile =subpath+"/"+featureDataFolder+"/f_"+str(i)+".json" 
	try:
		os.remove(outFile)
	except OSError:
		pass
	gdal_rasterize.rasterize(	\
		featureFile,
		outFile,
		ts=size,		# set resolution
		out_format='PNG',
		init=0,
		te=te,
		burn_values=[200*i])				# set image limits in te

	#make 0s transparent to prepare for merge	
	img = Image.open(outFile)
	img = img.convert("RGBA")
	datas = img.getdata()
	newData = []
	for item in datas:<commit_msg>update for other input files<commit_after>#!usr/bin/python
'''
Overlay classes and satellite data
'''
import os,csv,json
import utils.gdal_rasterize as gdal_rasterize
from PIL import Image
from functools import partial
from multiprocessing import Pool
from utils.coordinate_converter import CoordConvert
from utils.getImageCoordinates import imageCoordinates
from utils.project import project,projectRev 
from modules.getFeatures import latLon,find_between,find_before
from modules.get_stats import get_stats
from libs.colorlist import colorlist
from libs.foldernames import *

def rasterLayer(i,stats,subpath,size,te):
	'''converts feature geojson to png image'''
	feature=stats[i]
	i+=1
	print "Layer "+str(i)+"/"+str(len(stats))+'\t Processing feature: '+feature
	outFile=subpath+"/f_"+str(i)+".png"
	featureFile =subpath+"/"+featureDataFolder+"/f_"+str(i)+".json" 
	try:
		os.remove(outFile)
	except OSError:
		pass
	gdal_rasterize.rasterize(	\
		featureFile,
		outFile,
		ts=size,		# set resolution
		out_format='PNG',
		init=0,
		te=te,
		burn_values=[i])				# set image limits in te

	#make 0s transparent to prepare for merge	
	img = Image.open(outFile)
	img = img.convert("RGBA")
	datas = img.getdata()
	newData = []
	for item in datas:
{'fraction_non_alphanumeric': 0.11254538120209762, 'fraction_numerical': 0.003630496167809601, 'mean_word_length': 5.684636118598383, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4779695', 'n_tokens_mistral': 891, 'n_tokens_neox': 852, 'n_words': 219}