<commit_before>from typing import Tuple, List, Iterable
from geojson import FeatureCollection


def geojson_iterator(fc: FeatureCollection) -> Iterable[Tuple[Tuple[float, float],Tuple[float, float]]]:
	for edge in fc['features']:
		from_coords = None
		for coordinates in edge['geometry']['coordinates']:
			to_coords = coordinates
			if from_coords:
				yield (([from_coords[0], from_coords[1]]),([to_coords[0], to_coords[1]]))
			from_coords = to_coords


def export_for_matplotlib(edges_iterator: Iterable[Tuple[Tuple[float, float],Tuple[float, float]]])\
		-> Tuple[List[float], List[float]]:
	xlist = []
	ylist = []
	for edge in edges_iterator:
		xlist.append(edge[0][0])
		xlist.append(edge[1][0])
		xlist.append(None)
		ylist.append(edge[0][1])
		ylist.append(edge[1][1])
		ylist.append(None)
	return xlist, ylist
<commit_msg>map plotting now uses UTM coordinates, <commit_after>from setuptools.command.rotate import rotate

import roadmaptools.utm

from typing import Tuple, List, Iterable
from geojson import FeatureCollection

from roadmaptools.utm import TransposedUTM


def geojson_iterator(fc: FeatureCollection) -> Iterable[Tuple[Tuple[float, float],Tuple[float, float]]]:
	for edge in fc['features']:
		from_coords = None
		for coordinates in edge['geometry']['coordinates']:
			to_coords = coordinates
			if from_coords:
				yield (([from_coords[0], from_coords[1]]),([to_coords[0], to_coords[1]]))
			from_coords = to_coords


def export_for_matplotlib(edges_iterator: Iterable[Tuple[Tuple[float, float],Tuple[float, float]]])\
		-> Tuple[List[float], List[float]]:
	xlist = []
	ylist = []
	projection = None
	for edge in edges_iterator:
		if not projection:
			projection = roadmaptools.utm.TransposedUTM.from_gps(edge[0][1], edge[0][0])
		from_coords = roadmaptools.utm.wgs84_to_utm(edge[0][1], edge[0][0], projection)
		to_coords = roadmaptools.utm.wgs84_to_utm(edge[1][1], edge[1][0], projection)
		xlist.append(from_coords[0])
		xlist.append(to_coords[0])
		xlist.append(None)
		ylist.append(from_coords[1])
		ylist.append(to_coords[1])
		ylist.append(None)
	return xlist, ylist

{'fraction_non_alphanumeric': 0.14278914802475012, 'fraction_numerical': 0.017134697762970014, 'mean_word_length': 6.174061433447099, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 7, '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': '4899523', 'n_tokens_mistral': 824, 'n_tokens_neox': 773, 'n_words': 148}