print "Loading the config settings..." config = ConfigParser() configFile = open("config/seattle_smcity.conf") config.readfp(configFile) configFile.close() # Load the GeoJSON description of the police beats police_beats_geojson = geojson.loads(open("seattle_slides/seattle_police_beats.geojson").read())["features"] # Set up the components data_factory = AwsDataFactory(config) result_queue = MockResultQueue() task_queue = MockTaskQueue() worker = Worker(config, result_queue, task_queue, data_factory) transformer = GeoJsonTransformer(data_factory) geojson = None for iter in range(len(police_beats_geojson)): police_beat = ComplexPolygonStrategyFactory().from_geojson(police_beats_geojson[iter]["geometry"]) # Generate the data set of interest set_id = str(uuid4()) age_limit = datetime.datetime.now() age_limit -= datetime.timedelta(hours=1) age_limit = age_limit.timetuple() bounding_box = police_beat.get_bounding_box() keywords = ["Mayday", "parade"] print "Bounding Box:", bounding_box print "Set ID:", set_id print "Time:", age_limit
print "Loading the config settings..." config = ConfigParser() configFile = open('config/seattle_smcity.conf') config.readfp(configFile) configFile.close() # Load the GeoJSON description of the police beats police_beats_geojson = geojson.loads(open('seattle_slides/seattle_police_beats.geojson').read()) police_beats = ComplexPolygonStrategyFactory().from_geojson(police_beats_geojson['features'][0]['geometry']) # Set up the components data_factory = AwsDataFactory(config) result_queue = MockResultQueue() task_queue = MockTaskQueue() worker = Worker(config, result_queue, task_queue, data_factory) transformer = GeoJsonTransformer(data_factory) # Generate the data set of interest set_id = str(uuid4()) age_limit = datetime.datetime.now() age_limit -= datetime.timedelta(hours=1) age_limit = age_limit.timetuple() bounding_box = police_beats.get_bounding_box() print "Bounding Box:", bounding_box print "Set ID:", set_id print "Time:", age_limit kwargs = { 'num_segments' : 4, 'in_data_set_id' : 'global', 'out_data_set_id' : set_id, 'min_timestamp' : age_limit,
config = ConfigParser() configFile = open('config/qa_smcity.conf') config.readfp(configFile) configFile.close() print "Depickling the congressional districts..." districts = pickle.load(open("manual_tests/ohio_districts_low_res.pickled", "rb")) district_ids = [] geojson = None # Set up the components data_factory = AwsDataFactory(config) result_queue = MockResultQueue() task_queue = MockTaskQueue() worker = Worker(config, result_queue, task_queue, data_factory) transformer = GeoJsonTransformer(data_factory) # Extract the data points inside the time frame and geographic area of interest age_limit = datetime.datetime.now() age_limit += datetime.timedelta(hours=5) - datetime.timedelta(hours=1) age_limit = age_limit.timetuple() for iter in range(len(districts)): print "District", (iter+1) district_ids.append(uuid4()) bounding_box = districts[iter].get_bounding_box() key_words = ['OBAMA', 'POTUS', 'BARACK', 'PRESIDENT', 'PREZ'] kwargs = { 'num_segments' : 10, 'in_data_set_id' : 'global',
# Load the config settings config = ConfigParser() configFile = open('config/qa_smcity.conf') config.readfp(configFile) configFile.close() # Load the GeoJSON description of Franklin county franklin_geojson = geojson.loads(open('manual_tests/franklin.geojson').read()) franklin_county = ComplexPolygonStrategyFactory().from_geojson(franklin_geojson['features'][0]['geometry']) # Set up the components data_factory = AwsDataFactory(config) result_queue = MockResultQueue() task_queue = MockTaskQueue() worker = Worker(config, result_queue, task_queue, data_factory) transformer = GeoJsonTransformer(data_factory) # Generate the data set of interest set_id = str(uuid4()) age_limit = datetime.datetime.now() age_limit += datetime.timedelta(hours=5) - datetime.timedelta(hours=1) age_limit = age_limit.timetuple() bounding_box = franklin_county.get_bounding_box() print "Bounding Box:", bounding_box print "Set ID:", set_id print "Time:", age_limit kwargs = { 'num_segments' : 4, 'in_data_set_id' : 'global', 'out_data_set_id' : set_id, 'min_timestamp' : age_limit,
# Load the config settings config = ConfigParser() configFile = open('config/qa_smcity.conf') config.readfp(configFile) configFile.close() # Load the GeoJSON description of Franklin county franklin_geojson = geojson.loads(open('manual_tests/franklin.geojson').read()) franklin_county = ComplexPolygonStrategyFactory().from_geojson(franklin_geojson['features'][0]['geometry']) # Set up the components data_factory = AwsDataFactory(config) result_queue = MockResultQueue() task_queue = MockTaskQueue() worker = Worker(config, result_queue, task_queue, data_factory) transformer = GeoJsonTransformer(data_factory) # Generate the data set of interest set_id = str(uuid4()) age_limit = datetime.datetime.now() age_limit += datetime.timedelta(hours=5) - datetime.timedelta(minutes=15) age_limit = age_limit.timetuple() bounding_box = franklin_county.get_bounding_box() keywords = ['robbery', 'gun', 'steal', 'crime', 'shooter', 'robber', 'weapon', 'shoota'] print "Bounding Box:", bounding_box print "Set ID:", set_id print "Time:", age_limit kwargs = { 'num_segments' : 4, 'in_data_set_id' : 'global', 'out_data_set_id' : set_id,