<commit_before>Meteor.startup(function() {
	IntersectionsYX._ensureIndex({"coordinate":"2dsphere"});
	CornerPoints._ensureIndex({"coordinate":"2dsphere"});
	
	if (Locations.find().count() == 0) {
		// list of all of the files containing location data
		var locFiles = [
			locations_admission,
			locations_arts,
			locations_athletics,
			locations_dorms,
			locations_east,
			locations_ibs,
			locations_mandelHellerLibrary,
			locations_massellChapels,
			locations_oldSt,
			locations_parking,
			locations_presidential,
			locations_scienceComplex,
			locations_transport,
			locations_usdan,
			locations_artinstallations,
			locations_rooms
		];
		
		locFiles.forEach(function(locFile) {
			locFile.forEach(function(location) {
				Locations.insert(location);
				
				var c = null;
				if (location.coordinates.type == "Point") {
					c = location.coordinates.coordinates;
				}
				else {
					// use first entrance
					c = location.coordinates.coordinates[0][0];
				}
				CornerPoints.insert({"coordinate":{"type":"Point","coordinates":[c[1],c[0]]},"name":location.name}); // need to flip x and y for geojson
				
			});
		});		
	}
	
	if (Intersections.find().count() == 0) {
		var intersectFiles = [
			points_centralCampus,
			points_lowerDorms,
			points_massellchapels,
			points_southcampus,
			points_gym,
			points_admin, 
			points_science,
			points_northrabb,
			points_mandelquad,
			points_library,
			points_usdan,
			points_east,
			points_grad,
			points_ibs,
			points_rooms
		];

		
		intersectFiles.forEach(function(intersectFile) {
			intersectFile.forEach(function(point) {
				if (point.singlepoint){
					point.type = "entrance";
					// the single point's entrance is always the same as its location coordinate
					point.coordinate = Locations.findOne({"id":point.id.replace('_e01','')}).coordinates;
				}
				
				Intersections.insert(point);
			
				var flipped = {"type":"Point","coordinates":[point.coordinate.coordinates[1],point.coordinate.coordinates[0]]};
			
				IntersectionsYX.insert({"id":point.id,"coordinate":flipped,"type":point.type,"getTo":point.getTo});
				
			});
		});
	}
	
	if (Paths.find().count() == 0) {
		var pathFiles = [
			paths_massellchapels,
			paths_lowerDorms, 
			paths_southcampus,	
			paths_gym,
			paths_admin, 
			paths_science,
			paths_northrabb,
			paths_mandelquad,
			paths_library,
			paths_east,
			paths_usdan,
			paths_grad,
			paths_ibs,
			paths_bernstein,
			paths_rooms
		];
		
		pathFiles.forEach(function(pathFile) {
			pathFile.forEach(function(path) {
				//console.log("path###############");
				//console.log(Intersections.findOne({"id":path.start}));
				//console.log(Intersections.findOne({"id":path.end}));
				Meteor.call("distance",
					{"x":Intersections.findOne({"id":path.start}).coordinate.coordinates[0],"y":Intersections.findOne({"id":path.start}).coordinate.coordinates[1]},
					{"x":Intersections.findOne({"id":path.end}).coordinate.coordinates[0],"y":Intersections.findOne({"id":path.end}).coordinate.coordinates[1]},
					function(error,data) {
						if (error) {
							console.log(error);
						}
						else {
							path.distance = data;
							Paths.insert(path);
							// console.log(path);	
						}
				});<commit_msg>check path coordinates<commit_after>Meteor.startup(function() {
	IntersectionsYX._ensureIndex({"coordinate":"2dsphere"});
	CornerPoints._ensureIndex({"coordinate":"2dsphere"});
	
	if (Locations.find().count() == 0) {
		// list of all of the files containing location data
		var locFiles = [
			locations_admission,
			locations_arts,
			locations_athletics,
			locations_dorms,
			locations_east,
			locations_ibs,
			locations_mandelHellerLibrary,
			locations_massellChapels,
			locations_oldSt,
			locations_parking,
			locations_presidential,
			locations_scienceComplex,
			locations_transport,
			locations_usdan,
			locations_artinstallations,
			locations_rooms
		];
		
		locFiles.forEach(function(locFile) {
			locFile.forEach(function(location) {
				Locations.insert(location);
				
				var c = null;
				if (location.coordinates.type == "Point") {
					c = location.coordinates.coordinates;
				}
				else {
					// use first entrance
					c = location.coordinates.coordinates[0][0];
				}
				CornerPoints.insert({"coordinate":{"type":"Point","coordinates":[c[1],c[0]]},"name":location.name}); // need to flip x and y for geojson
				
			});
		});		
	}
	
	if (Intersections.find().count() == 0) {
		var intersectFiles = [
			points_centralCampus,
			points_lowerDorms,
			points_massellchapels,
			points_southcampus,
			points_gym,
			points_admin, 
			points_science,
			points_northrabb,
			points_mandelquad,
			points_library,
			points_usdan,
			points_east,
			points_grad,
			points_ibs,
			points_rooms
		];

		
		intersectFiles.forEach(function(intersectFile) {
			intersectFile.forEach(function(point) {
				if (point.singlepoint){
					point.type = "entrance";
					// the single point's entrance is always the same as its location coordinate
					point.coordinate = Locations.findOne({"id":point.id.replace('_e01','')}).coordinates;
				}
				
				Intersections.insert(point);
			
				var flipped = {"type":"Point","coordinates":[point.coordinate.coordinates[1],point.coordinate.coordinates[0]]};
			
				IntersectionsYX.insert({"id":point.id,"coordinate":flipped,"type":point.type,"getTo":point.getTo});
				
			});
		});
	}
	
	if (Paths.find().count() == 0) {
		var pathFiles = [
			paths_massellchapels,
			paths_lowerDorms, 
			paths_southcampus,	
			paths_gym,
			paths_admin, 
			paths_science,
			paths_northrabb,
			paths_mandelquad,
			paths_library,
			paths_east,
			paths_usdan,
			paths_grad,
			paths_ibs,
			paths_bernstein,
			paths_rooms
		];
		
		pathFiles.forEach(function(pathFile) {
			pathFile.forEach(function(path) {
				console.log("path###############");
				console.log(Intersections.findOne({"id":path.start}));
				console.log(Intersections.findOne({"id":path.end}));
				Meteor.call("distance",
					{"x":Intersections.findOne({"id":path.start}).coordinate.coordinates[0],"y":Intersections.findOne({"id":path.start}).coordinate.coordinates[1]},
					{"x":Intersections.findOne({"id":path.end}).coordinate.coordinates[0],"y":Intersections.findOne({"id":path.end}).coordinate.coordinates[1]},
					function(error,data) {
						if (error) {
							console.log(error);
						}
						else {
							path.distance = data;
							Paths.insert(path);
							// console.log(path);	
						}
				});
{'fraction_non_alphanumeric': 0.14592009871972852, 'fraction_numerical': 0.005244485577664661, 'mean_word_length': 3.8065233506300964, 'pattern_counts': {'":': 46, '<': 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': '303656', 'n_tokens_mistral': 2778, 'n_tokens_neox': 2113, 'n_words': 284}