本文整理汇总了Java中com.esri.ges.core.geoevent.GeoEvent.setField方法的典型用法代码示例。如果您正苦于以下问题:Java GeoEvent.setField方法的具体用法?Java GeoEvent.setField怎么用?Java GeoEvent.setField使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.esri.ges.core.geoevent.GeoEvent
的用法示例。
在下文中一共展示了GeoEvent.setField方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: createLine2PtGeoevent
import com.esri.ges.core.geoevent.GeoEvent; //导入方法依赖的package包/类
private GeoEvent createLine2PtGeoevent(GeoEvent event, MapGeometry outGeo, Date ts) throws MessagingException, FieldException
{
GeoEventCreator creator = messaging.createGeoEventCreator();
GeoEvent msg = creator.create(outDef, definition.getUri().toString());
for(FieldDefinition fd: event.getGeoEventDefinition().getFieldDefinitions())
{
if(fd.getTags().contains("GEOMETRY"))
{
msg.setGeometry(outGeo);
}
else
{
msg.setField(fd.getName(), event.getField(fd.getName()));
}
msg.setField("TIMESTAMP", ts);
}
return msg;
}
示例2: convertToGeoEvent
import com.esri.ges.core.geoevent.GeoEvent; //导入方法依赖的package包/类
public GeoEvent convertToGeoEvent(GeoEventCreator geoEventCreator, String gedName, String gedOwner)
{
try
{
GeoEvent geoEvent = geoEventCreator.create( gedName, gedOwner );
geoEvent.setField( MESSAGE_ID_KEY, id );
geoEvent.setField( TYPE_KEY, type );
geoEvent.setField( SUBJECT_KEY, subject );
geoEvent.setField( MESSAGE_TIME_KEY, messageTime );
geoEvent.setField( MESSAGE_FROM_KEY, messageFrom );
geoEvent.setField( MESSAGE_TO_KEY, messageTo );
geoEvent.setField( STATUS_KEY, status );
geoEvent.setField( MESSAGE_BODY_KEY, messageBody );
geoEvent.setField( CALLBACK_KEY, callback );
return geoEvent;
}
catch( Exception e )
{
throw new RuntimeException( e );
}
}
示例3: createGeoEvent
import com.esri.ges.core.geoevent.GeoEvent; //导入方法依赖的package包/类
@Override
public GeoEvent createGeoEvent(Message message, String ownerId, Uri uri)
{
try
{
GeoEvent geoEvent = geoEventCreator.create( msgGEDName, msgGEDOwner );
geoEvent.setField( Message.MESSAGE_ID_KEY, message.getId() );
geoEvent.setField( Message.TYPE_KEY, message.getType() );
geoEvent.setField( Message.SUBJECT_KEY, message.getSubject() );
geoEvent.setField( Message.MESSAGE_TIME_KEY, message.getMessageTime() );
geoEvent.setField( Message.MESSAGE_FROM_KEY, message.getMessageFrom() );
geoEvent.setField( Message.MESSAGE_TO_KEY, message.getMessageTo() );
geoEvent.setField( Message.STATUS_KEY, message.getStatus() );
geoEvent.setField( Message.MESSAGE_BODY_KEY, message.getMessageBody() );
geoEvent.setField( Message.CALLBACK_KEY, message.getCallback() );
geoEvent.setProperty(GeoEventPropertyName.TYPE, "event");
geoEvent.setProperty(GeoEventPropertyName.OWNER_ID, ownerId);
geoEvent.setProperty(GeoEventPropertyName.OWNER_URI, uri);
return geoEvent;
}
catch( Exception e )
{
throw new RuntimeException( e );
}
}
示例4: createGeoEvent
import com.esri.ges.core.geoevent.GeoEvent; //导入方法依赖的package包/类
@Override
public GeoEvent createGeoEvent(Route route, String ownerId, Uri uri)
{
try
{
GeoEvent geoEvent = geoEventCreator.create( routeGEDName, routeGEDOwner );
geoEvent.setGeometry( route.getShape() );
geoEvent.setField( RouteResource.ROUTE_NAME_KEY, route.getRouteName() );
geoEvent.setField( RouteResource.VEHICLE_NAME_KEY, route.getVehicleName() );
geoEvent.setField( RouteResource.DRIVER_NAME_KEY, route.getDriverName() );
geoEvent.setField( RouteResource.PASSENGER_NAME_KEY, route.getPassengerName() );
geoEvent.setField( RouteResource.LAST_UPDATED_KEY, route.getLastUpdated() );
geoEvent.setField( RouteResource.ROUTE_START_KEY, route.getRouteStart() );
geoEvent.setField( RouteResource.ROUTE_END_KEY, route.getRouteEnd() );
geoEvent.setField( RouteResource.DISPATCH_ACK_KEY, route.getDispatchAck() );
geoEvent.setField( RouteResource.SHAPE_KEY, route.getShape() );
geoEvent.setProperty(GeoEventPropertyName.TYPE, "event");
geoEvent.setProperty(GeoEventPropertyName.OWNER_ID, ownerId);
geoEvent.setProperty(GeoEventPropertyName.OWNER_URI, uri);
return geoEvent;
}
catch( Exception e )
{
throw new RuntimeException( e );
}
}
示例5: createGeoEventForAoi
import com.esri.ges.core.geoevent.GeoEvent; //导入方法依赖的package包/类
private GeoEvent createGeoEventForAoi( Aoi aoi)
{
try
{
GeoEvent geoEvent = geoEventCreator.create( geofenceGEDName, geofenceGEDOwner );
// All of our Aoi's only have one geometry.
Geometry geom = aoi.getGeometries().get( 0 );
geoEvent.setGeometry( geom );
geoEvent.setField( GeoFenceResource.GEOFENCE_ID_KEY, aoi.getId() );
geoEvent.setField( GeoFenceResource.CATEGORY_KEY, aoi.getCategory() );
geoEvent.setField( GeoFenceResource.GEOFENCE_NAME_KEY, aoi.getName() );
geoEvent.setField( GeoFenceResource.ACTIVE_KEY, Boolean.toString( aoi.isActive() ) );
geoEvent.setField( GeoFenceResource.SHAPE_KEY, geom.toJson() );
return geoEvent;
}
catch( Exception e )
{
throw new RuntimeException( e );
}
}
示例6: translate
import com.esri.ges.core.geoevent.GeoEvent; //导入方法依赖的package包/类
@Override
public void translate(GeoEvent geoEvent, String[] data) throws FieldException
{
int i = 1;
geoEvent.setField(i++, toTime(data[1], null));
geoEvent.setField(i++, toPoint(data[2], data[4], "N".equals(data[3]), "E".equals(data[5])));
geoEvent.setField(i++, convertToShort(data[6]));
geoEvent.setField(i++, convertToShort(data[7]));
geoEvent.setField(i++, convertToDouble(data[8]));
geoEvent.setField(i++, convertToDouble(data[9]));
geoEvent.setField(i++, data[10]);
geoEvent.setField(i++, convertToDouble(data[11]));
geoEvent.setField(i++, data[12]);
geoEvent.setField(i++, data[13]);
geoEvent.setField(i++, data[14].split("\\*")[0]);
}
示例7: translate
import com.esri.ges.core.geoevent.GeoEvent; //导入方法依赖的package包/类
@Override
public void translate(GeoEvent geoEvent, String[] data) throws FieldException
{
int i = 1;
geoEvent.setField(i++, toTime(data[1], data[9]));
geoEvent.setField(i++, toPoint(data[3], data[5], "N".equals(data[4]), "E".equals(data[6])));
geoEvent.setField(i++, data[2]);
geoEvent.setField(i++, convertToDouble(data[7]));
geoEvent.setField(i++, convertToDouble(data[8]));
geoEvent.setField(i++, convertToDouble(data[10]));
if(data.length==12)
geoEvent.setField(i++, data[11].split("\\*")[0]);
else
{
geoEvent.setField(i++, data[11]);
geoEvent.setField(i++, data[12].split("\\*")[0]);
}
}
示例8: createVertexGeoevent
import com.esri.ges.core.geoevent.GeoEvent; //导入方法依赖的package包/类
private GeoEvent createVertexGeoevent(GeoEvent event, MapGeometry outGeo, double dist, long time, double timeFromStartMinutes, Integer increment) throws MessagingException, FieldException
{
Date ts = new Date(time);
Double distOnLine = dist;
GeoEvent msg = geoEventCreator.create(outDef, definition.getUri().toString());
for(FieldDefinition fd: event.getGeoEventDefinition().getFieldDefinitions())
{
if(fd.getTags().contains("GEOMETRY"))
{
msg.setGeometry(outGeo);
}
else if(fd.getTags().contains("TRACK_ID"))
{
String trackid = event.getTrackId() + "_" + increment.toString();
msg.setField("TRACK_ID", trackid);
}
else
{
msg.setField(fd.getName(), event.getField(fd.getName()));
}
}
msg.setField("TIMESTAMP", ts);
msg.setField("TIME_FROM_START", timeFromStartMinutes);
msg.setField("DISTANCE_ON_LINE", distOnLine);
msg.setProperty(GeoEventPropertyName.TYPE, "event");
msg.setProperty(GeoEventPropertyName.OWNER_ID, getId());
msg.setProperty(GeoEventPropertyName.OWNER_URI,
definition.getUri());
return msg;
}
示例9: createIncrementalPointGeoevent
import com.esri.ges.core.geoevent.GeoEvent; //导入方法依赖的package包/类
private GeoEvent createIncrementalPointGeoevent(GeoEvent event, MapGeometry outGeo, Date timestart, Integer increment) throws MessagingException, FieldException
{
long multiplier = increment+1;
long timeFromStart = timeInterval*multiplier;
long incrementTime = timestart.getTime() + (timeFromStart);
double timeFromStartMinutes = timeFromStart/60000.0;
Double distOnLine = distInterval*multiplier;
Date ts = new Date(incrementTime);
GeoEvent msg = geoEventCreator.create(outDef, definition.getUri().toString());
for(FieldDefinition fd: event.getGeoEventDefinition().getFieldDefinitions())
{
if(fd.getTags().contains("GEOMETRY"))
{
msg.setGeometry(outGeo);
}
else if(fd.getTags().contains("TRACK_ID"))
{
String trackid = event.getTrackId() + "_" + increment.toString();
msg.setField("TRACK_ID", trackid);
}
else
{
msg.setField(fd.getName(), event.getField(fd.getName()));
}
}
msg.setField("TIMESTAMP", ts);
msg.setField("TIME_FROM_START", timeFromStartMinutes);
msg.setField("DISTANCE_ON_LINE", distOnLine);
msg.setProperty(GeoEventPropertyName.TYPE, "event");
msg.setProperty(GeoEventPropertyName.OWNER_ID, getId());
msg.setProperty(GeoEventPropertyName.OWNER_URI,
definition.getUri());
return msg;
}
示例10: populateGeoEvent
import com.esri.ges.core.geoevent.GeoEvent; //导入方法依赖的package包/类
/**
* The populateGeoEvent method does the following things:
* <ol>
* <li>Creates a copy of the incoming GeoEvent using the {@link GeoEventCreator}.</li>
* <li>Check's the GeoEvent's Geometry (it make sure it exists) and creates an extent from it.</li>
* <li>Adds the fields <code>MinX</code>, <code>MinY</code>, <code>MaxX</code>, <code>MaxY</code></li> to the GeoEvent using the Geometry's extent.
* <li>Optionally, adds the Geometry's extent center point as well.</li>
* </ol>
*
* @param geoEvent The incoming GeoEvent to be augmented
* @param edOut the augmented GeoEventDefinition
* @return the augmented GeoEvent
*
* @throws MessagingException if the incoming GeoEvent cannot be augmented.
*
* @see GeoEvent
* @see GeoEventDefinition
*/
private GeoEvent populateGeoEvent(GeoEvent geoEvent, GeoEventDefinition edOut) throws MessagingException
{
GeoEvent outGeoEvent = geoEventCreator.create(edOut.getGuid(), new Object[] { geoEvent.getAllFields(), (addCenterPoint) ? new Object[5] : new Object[4] });
outGeoEvent.setProperty(GeoEventPropertyName.TYPE, geoEvent.getProperty(GeoEventPropertyName.TYPE));
outGeoEvent.setProperty(GeoEventPropertyName.OWNER_ID, geoEvent.getProperty(GeoEventPropertyName.OWNER_ID));
outGeoEvent.setProperty(GeoEventPropertyName.OWNER_URI, geoEvent.getProperty(GeoEventPropertyName.OWNER_URI));
MapGeometry geometry = geoEvent.getGeometry();
if (geometry != null)
{
Envelope2D boundingBox = new Envelope2D();
geometry.getGeometry().queryEnvelope2D(boundingBox);
try
{
outGeoEvent.setField("MinX", boundingBox.xmin);
outGeoEvent.setField("MinY", boundingBox.ymin);
outGeoEvent.setField("MaxX", boundingBox.xmax);
outGeoEvent.setField("MaxY", boundingBox.ymax);
if (addCenterPoint)
{
Point centerPt = new Point(boundingBox.getCenter());
outGeoEvent.setField("CenterPoint", new MapGeometry(centerPt, geometry.getSpatialReference()));
}
}
catch (FieldException error)
{
LOGGER.error("ERROR_SETTING_EXTENT_FIELDS", error.getMessage());
LOGGER.info(error.getMessage(), error);
}
}
else
LOGGER.debug("GEOMETRY_EMPTY_MSG");
return outGeoEvent;
}
示例11: clearPlan
import com.esri.ges.core.geoevent.GeoEvent; //导入方法依赖的package包/类
@Override
public GeoEvent clearPlan(GeoEvent geoEvent, String agsConnectionName, String path, String featureService, String stopLayer, String routeLayer, String vehicleLayer, String geofenceLayer, String alertLayer)
{
stopsManager.clearAllStops(agsConnectionName, path, featureService, stopLayer, geofenceLayer);
routeManager.clearAllRouteFeatures(agsConnectionName, path, featureService, routeLayer);
vehiclesManager.clearAllVehicleFeatures(agsConnectionName, path, featureService, vehicleLayer);
alertsManager.clearAllAlertFeatures(agsConnectionName, path, featureService, alertLayer);
autoArrivalDepartureManager.clearIncidents();
GeoEvent newGeoEvent = (GeoEvent) geoEvent.clone(null);
try
{
newGeoEvent.setField(STATUS_FIELD, PlanStatus.Successful.toString());
}
catch (FieldException e)
{
log.error(e.getStackTrace());
try
{
newGeoEvent.setField(STATUS_FIELD, PlanStatus.Failed.toString());
}
catch (FieldException e1)
{
log.error(e1.getStackTrace());
}
}
return newGeoEvent;
}
示例12: createGeoEvent
import com.esri.ges.core.geoevent.GeoEvent; //导入方法依赖的package包/类
@Override
public GeoEvent createGeoEvent(Vehicle vehicle, String ownerId, Uri uri)
{
if( geoEventCreator == null )
{
geoEventCreator = messaging.createGeoEventCreator();
if( geoEventCreator == null )
{
throw new RuntimeException( "Could not instantiate a GeoEventCreator." );
}
}
GeoEvent event;
try
{
event = geoEventCreator.create( vehicleGEDName, vehicleGEDOwner );
event.setField( VehicleResource.LAST_UPDATED_KEY, vehicle.getLastUpdated() );
event.setField( VehicleResource.DEVICE_ID_KEY, vehicle.getDeviceId() );
event.setField( VehicleResource.DEVICE_TYPE_KEY, vehicle.getDeviceType() );
event.setField( VehicleResource.VEHICLE_NAME_KEY, vehicle.getVehicleName() );
event.setField( VehicleResource.VEHICLE_GROUP_NAME_KEY, vehicle.getVehicleGroupName() );
event.setField( VehicleResource.CAPACITY_KEY, vehicle.getCapacity() );
event.setField( VehicleResource.SPECIALTIES_KEY, vehicle.getSpecialties() );
event.setField( VehicleResource.FIXED_COST_KEY, vehicle.getFixedCost() );
event.setField( VehicleResource.FUEL_ECONOMY_KEY, vehicle.getFuelEconomy() );
event.setField( VehicleResource.FUEL_TYPE_KEY, vehicle.getFuelType() );
event.setField( VehicleResource.SPEED_KEY, vehicle.getSpeed() );
event.setField( VehicleResource.PANIC_KEY, vehicle.getPanic() );
event.setField( VehicleResource.NOTE_KEY, vehicle.getNote() );
event.setField( "shape", vehicle.getLocation().toJson() );
event.setGeometry( vehicle.getLocation() );
event.setProperty(GeoEventPropertyName.TYPE, "event");
event.setProperty(GeoEventPropertyName.OWNER_ID, ownerId);
event.setProperty(GeoEventPropertyName.OWNER_URI, uri);
}
catch( Exception e )
{
throw new RuntimeException( e );
}
return event;
}
示例13: process
import com.esri.ges.core.geoevent.GeoEvent; //导入方法依赖的package包/类
@Override
public GeoEvent process(GeoEvent geoEvent) throws Exception
{
GeoEvent newGeoEvent = null;
if(geoEvent.getField(REQUEST_ID_FIELD) == null )
{
log.error("Request ID is not available in the GeoEvent.");
return null;
}
String requestId = (String)geoEvent.getField(REQUEST_ID_FIELD);
if(!geoEvent.getGeoEventDefinition().getName().equals(planManager.getPlanCommandGeoEventDefinition().getName()))
return null;
if(geoEvent.getField(planManager.getPlanCommandActionField()).equals(planManager.getPlanCommandActionClear()))
newGeoEvent = planManager.clearPlan(geoEvent, agsConnectionName, path, featureService, stopLayer, routeLayer, vehicleLayer, geofenceLayer, alertLayer);
else if(geoEvent.getField(planManager.getPlanCommandActionField()).equals(planManager.getPlanCommandActionGet()))
newGeoEvent = planManager.getPlan();
else if(geoEvent.getField(planManager.getPlanCommandActionField()).equals(planManager.getPlanCommandActionReload()))
newGeoEvent = planManager.reloadPlan(agsConnectionName, path, featureService, stopLayer, routeLayer, vehicleLayer, alertLayer);
else if(geoEvent.getField(planManager.getPlanCommandActionField()).equals(planManager.getPlanCommandActionLoad()))
{
//planManager.clearPlan(geoEvent, agsConnectionName, path, featureService, stopLayer, routeLayer, vehicleLayer, geofenceLayer, alertLayer);
newGeoEvent = planManager.loadPlan(geoEvent);
}
if(newGeoEvent.getGeoEventDefinition().getFieldDefinition(REQUEST_ID_FIELD) != null)
newGeoEvent.setField(REQUEST_ID_FIELD, requestId);
return newGeoEvent;
}
示例14: translate
import com.esri.ges.core.geoevent.GeoEvent; //导入方法依赖的package包/类
@Override
public void translate(GeoEvent geoEvent, String[] data) throws FieldException
{
int i = 1;
geoEvent.setField(i++, toTime(data[5], null));
geoEvent.setField(i++, toPoint(data[1], data[3], "N".equals(data[2]), "E".equals(data[4])));
geoEvent.setField(i++, data[6].split("\\*")[0]);
}
示例15: run
import com.esri.ges.core.geoevent.GeoEvent; //导入方法依赖的package包/类
@Override
public void run()
{
while (!messages.isEmpty())
{
String[] data = new String(messages.remove(0)).split(",");
if (data.length > 0)
{
String gedName = "NMEA" + data[0];
if (translators.containsKey(gedName))
{
try
{
NMEAMessageTranslator translator = translators.get(gedName);
translator.validate(data);
GeoEvent geoEvent = geoEventCreator.create(((AdapterDefinition) definition).getGeoEventDefinition(gedName).getGuid());
geoEvent.setField(0, channelId);
translator.translate(geoEvent, data);
geoEventListener.receive(geoEvent);
}
catch (Exception error)
{
LOGGER.error("TRANSLATION_ERROR", error.getMessage());
LOGGER.info(error.getMessage(), error);
}
}
}
}
}