src/Generic/icews/ICEWSOutputWriter.cpp
// add event location data (latitude, longitude, etc.) to ICEWSEventData struct

add event location data (latitude, longitude, etc.) to ICEWSEventData struct
add event location data ( latitude longitude etc . ) to ICEWSEventData struct
void ICEWSOutputWriter::extractEventLocationData(ProperNounActorMention_ptr locationActor, ICEWSEventData& eventData) {
	if (locationActor && locationActor->isResolvedGeo())
	{
		Symbol countrycode = locationActor->getGeoResolution()->countrycode;
		if(!countrycode.is_null())
			eventData.location_country_code = countrycode.to_string();
		else
			throw UnexpectedInputException("ICEWSEventMention::extractLocationData", 
					"Event location ActorMention has null country code: ", 
					countrycode.to_debug_string());
		if(locationActor->getGeoResolution()->latitude != std::numeric_limits<float>::quiet_NaN()) 
			eventData.location_latitude = boost::lexical_cast<std::wstring>(locationActor->getGeoResolution()->latitude);
		if(locationActor->getGeoResolution()->longitude != std::numeric_limits<float>::quiet_NaN()) 
			eventData.location_longitude = boost::lexical_cast<std::wstring>(locationActor->getGeoResolution()->longitude);
		Symbol cityname = locationActor->getGeoResolution()->cityname;
		if (!cityname.is_null())
			eventData.location_name = cityname.to_string();
	}
}
void ICEWSOutputWriter :: extractEventLocationData ( ProperNounActorMention_ptr locationActor , ICEWSEventData & eventData ) { if ( locationActor && locationActor -> isResolvedGeo ( ) ) { Symbol countrycode = locationActor -> getGeoResolution ( ) -> countrycode ; if ( ! countrycode . is_null ( ) ) eventData . location_country_code = countrycode . to_string ( ) ; else throw UnexpectedInputException ( " " , " " , countrycode . to_debug_string ( ) ) ; if ( locationActor -> getGeoResolution ( ) -> latitude != std :: numeric_limits < float > :: quiet_NaN ( ) ) eventData . location_latitude = boost :: lexical_cast < std :: wstring > ( locationActor -> getGeoResolution ( ) -> latitude ) ; if ( locationActor -> getGeoResolution ( ) -> longitude != std :: numeric_limits < float > :: quiet_NaN ( ) ) eventData . location_longitude = boost :: lexical_cast < std :: wstring > ( locationActor -> getGeoResolution ( ) -> longitude ) ; Symbol cityname = locationActor -> getGeoResolution ( ) -> cityname ; if ( ! cityname . is_null ( ) ) eventData . location_name = cityname . to_string ( ) ; } }
add event location data (latitude, longitude, etc.)
add event location data ( latitude longitude etc . )
// add country code to data, must be present
 // if latitude / longitude are NaN, leave these fields as empty string
 // add city name for geo, if null leave as empty string
