• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Java GeoEventPropertyName类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Java中com.esri.ges.core.geoevent.GeoEventPropertyName的典型用法代码示例。如果您正苦于以下问题:Java GeoEventPropertyName类的具体用法?Java GeoEventPropertyName怎么用?Java GeoEventPropertyName使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



GeoEventPropertyName类属于com.esri.ges.core.geoevent包,在下文中一共展示了GeoEventPropertyName类的14个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: populateGeoEvent

import com.esri.ges.core.geoevent.GeoEventPropertyName; //导入依赖的package包/类
private GeoEvent populateGeoEvent(GeoEvent geoEvent, GeoEventDefinition edOut, Object outputGeometry) throws MessagingException
{
	GeoEvent outGeoEvent;
	if (outputGeometry == null)
		outGeoEvent = geoEventCreator.create(edOut.getGuid(), geoEvent.getAllFields());
	else
		outGeoEvent = geoEventCreator.create(edOut.getGuid(), new Object[] { geoEvent.getAllFields(), outputGeometry });

	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));

	for (Map.Entry<GeoEventPropertyName, Object> property : geoEvent.getProperties())
	{
		if (!outGeoEvent.hasProperty(property.getKey()))
			outGeoEvent.setProperty(property.getKey(), property.getValue());
	}

	return outGeoEvent;
}
 
开发者ID:Esri,项目名称:service-area-calculator-for-geoevent,代码行数:21,代码来源:ServiceAreaCalculator.java


示例2: createGeoEvent

import com.esri.ges.core.geoevent.GeoEventPropertyName; //导入依赖的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 );
  }
}
 
开发者ID:Esri,项目名称:route-monitor-for-geoevent,代码行数:26,代码来源:MessagesManagerImpl.java


示例3: createGeoEvent

import com.esri.ges.core.geoevent.GeoEventPropertyName; //导入依赖的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 );
  }
}
 
开发者ID:Esri,项目名称:route-monitor-for-geoevent,代码行数:27,代码来源:RouteManagerImpl.java


示例4: createVertexGeoevent

import com.esri.ges.core.geoevent.GeoEventPropertyName; //导入依赖的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;
}
 
开发者ID:Esri,项目名称:defense-solutions-proofs-of-concept,代码行数:32,代码来源:IncrementalPointProcessor.java


示例5: createIncrementalPointGeoevent

import com.esri.ges.core.geoevent.GeoEventPropertyName; //导入依赖的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;
}
 
开发者ID:Esri,项目名称:defense-solutions-proofs-of-concept,代码行数:36,代码来源:IncrementalPointProcessor.java


示例6: populateGeoEvent

import com.esri.ges.core.geoevent.GeoEventPropertyName; //导入依赖的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;
}
 
开发者ID:Esri,项目名称:extent-enricher-for-geoevent,代码行数:54,代码来源:GeometryExtentEnricher.java


示例7: createMotionGeoEvent

import com.esri.ges.core.geoevent.GeoEventPropertyName; //导入依赖的package包/类
private GeoEvent createMotionGeoEvent()
{
  GeoEventDefinition edOut;
  GeoEvent geoEventOut = null;
  try
  {
    edOut = lookupAndCreateEnrichedDefinition(this.currentGeoEvent.getGeoEventDefinition());
    if (edOut == null)
    {
      LOGGER.debug("edOut is null");
      return null;
    }
    geoEventOut = geoEventCreator.create(edOut.getGuid(), new Object[] { getCurrentGeoEvent().getAllFields(), createMotionGeoEventFields(currentGeoEvent.getTrackId(), this) });
    if (geometryType.equals("Line"))
    {
      geoEventOut.setGeometry(new MapGeometry(this.lineGeometry, SpatialReference.create(4326)));
    }

    // need to use "event" instead of "message" otherwise the resulting GeoEvent will come back in the process() method
    geoEventOut.setProperty(GeoEventPropertyName.TYPE, "event"); 
    geoEventOut.setProperty(GeoEventPropertyName.OWNER_ID, getId());
    geoEventOut.setProperty(GeoEventPropertyName.OWNER_URI, definition.getUri());
    for (Map.Entry<GeoEventPropertyName, Object> property : getCurrentGeoEvent().getProperties())
    {
      if (!geoEventOut.hasProperty(property.getKey()))
      {
        geoEventOut.setProperty(property.getKey(), property.getValue());
      }
    }
  }
  catch (Exception error)
  {
    LOGGER.error("CREATE_GEOEVENT_FAILED", error.getMessage());
    LOGGER.info(error.getMessage(), error);
  }
  return geoEventOut;
}
 
开发者ID:Esri,项目名称:motion-calculator-for-geoevent,代码行数:38,代码来源:MotionCalculator.java


示例8: createGeoEvent

import com.esri.ges.core.geoevent.GeoEventPropertyName; //导入依赖的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;
}
 
开发者ID:Esri,项目名称:route-monitor-for-geoevent,代码行数:41,代码来源:VehiclesManagerImpl.java


示例9: process

import com.esri.ges.core.geoevent.GeoEventPropertyName; //导入依赖的package包/类
@Override
public GeoEvent process(GeoEvent geoEvent) throws Exception
{
	GeoEvent eventOut = null;
	if (geoEvent != null && geoEventDefinitionManager != null)
	{
		Object result = calculate(geoEvent);
		
		switch (resultDestination)
		{
			case NEW_FIELD:
			{
				GeoEventDefinition edOut = lookup(geoEvent.getGeoEventDefinition());
				GeoEvent geoEventOut = geoEventCreator.create(edOut.getGuid(), new Object[] { geoEvent.getAllFields(), result });
				geoEventOut.setProperty(GeoEventPropertyName.TYPE, "message");
				geoEventOut.setProperty(GeoEventPropertyName.OWNER_ID, getId());
				geoEventOut.setProperty(GeoEventPropertyName.OWNER_URI, definition.getUri());
				for (Map.Entry<GeoEventPropertyName, Object> property : geoEvent.getProperties())
					if (!geoEventOut.hasProperty(property.getKey()))
						geoEventOut.setProperty(property.getKey(), property.getValue());
				eventOut = geoEventOut;
				break;
			}
			case EXISTING_FIELD:
			{
				try
				{
					geoEvent.setField(fieldName, result);
					eventOut = geoEvent;
				}
				catch (FieldException error)
				{
					LOGGER.error("SET_FIELD_ERROR", (result != null ? result.toString() : "null"), fieldName, geoEvent.getGeoEventDefinition().getName(), error.getMessage());
				}
				break;
			}
		}
	}
	return eventOut;
}
 
开发者ID:Esri,项目名称:solutions-geoevent-java,代码行数:41,代码来源:CacheAwareFieldCalculator.java


示例10: process

import com.esri.ges.core.geoevent.GeoEventPropertyName; //导入依赖的package包/类
@Override
public GeoEvent process(GeoEvent evt) throws Exception {
	MapGeometry mapGeo = (MapGeometry) evt.getField(geofld);
	Geometry geo = mapGeo.getGeometry();
	int wkid = mapGeo.getSpatialReference().getID();
	if(wkid != 4326)
	{
		return null;
	}
	if(geo.getType() != Geometry.Type.Point)
	{
		return null;
	}
	Point pt = (Point)geo;
	double[] coords = {pt.getX(), pt.getY()};
	PeGeogcs pegeocs = PeFactory.geogcs(4326);
	String[] mgrsvals = new String[1];
	PeNotationMgrs.geog_to_mgrs(pegeocs, 1, coords, accuracy, false, mgrsvals);
	String mgrs = mgrsvals[0];
	//LL ll = new LL(pt.getX(), pt.getY());
	//ll.setAccuracy(accuracy);
	
	//MGRS2LatLongConverter converter = new MGRS2LatLongConverter();
	//String mgrs = converter.LL2MRGS(ll);
	GeoEventDefinition edOut;
	GeoEventDefinition geoDef = evt.getGeoEventDefinition();
	if((edOut=manager.searchGeoEventDefinition(newdef, getId()))==null)
	{
		edOut = geoDef.augment(fds);
		edOut.setOwner(getId());
		edOut.setName(newdef);
		manager.addGeoEventDefinition(edOut);
	}
	GeoEventCreator  geoEventCreator = messaging.createGeoEventCreator();
	GeoEvent geOut = geoEventCreator.create(edOut.getGuid(), new Object[] {
		evt.getAllFields(), mgrs });
	geOut.setProperty(GeoEventPropertyName.TYPE, "message");
	geOut.setProperty(GeoEventPropertyName.OWNER_ID, getId());
	geOut.setProperty(GeoEventPropertyName.OWNER_ID, definition.getUri());
	return geOut;
}
 
开发者ID:Esri,项目名称:defense-solutions-proofs-of-concept,代码行数:42,代码来源:MGRSProcessor.java


示例11: createGeoEvent

import com.esri.ges.core.geoevent.GeoEventPropertyName; //导入依赖的package包/类
@Override
public GeoEvent createGeoEvent(Stop stop, String ownerId, Uri uri)
{
  try
  {
    GeoEvent geoEvent = geoEventCreator.create(stopGEDName, stopGEDOwner);
    
    Set<String> predefinedTags = stop.getPredefinedKeys();

    for (FieldDefinition fd : geoEvent.getGeoEventDefinition().getFieldDefinitions())
    {
      String name = fd.getName();
      String value = stop.getAttribute(getResourceName(fd, predefinedTags));

      if (value == null)
      {
        geoEvent.setField(name, null);
      }
      else
      {
        switch (fd.getType())
        {
          case Boolean:
            geoEvent.setField(name,  value.equals("true")?true:false );
            break;
          case Date:  
            geoEvent.setField(name,  new Date( Long.parseLong( value ) ) );
            break;
          case Double:
            Double doubleValue = null;
            if( !Validator.isEmpty( value ) )
            {
              doubleValue = Double.parseDouble( value );
            }
            geoEvent.setField(name, doubleValue);
            break;
          case Float:
            Float floatValue = null;
            if( !Validator.isEmpty( value ) )
            {
              floatValue = Float.parseFloat( value );
            }
            geoEvent.setField(name, floatValue);
            break;
          case Integer:
            Integer intValue = null;
            if( !Validator.isEmpty( value ) )
            {
              intValue = Integer.parseInt( value );
            }
            geoEvent.setField(name, intValue);
            break;
          case Long:
            Long longValue = null;
            if( !Validator.isEmpty( value ) )
            {
              longValue = Long.parseLong( value );
            }
            geoEvent.setField(name, longValue);
            break;
          case Geometry:
            geoEvent.setGeometry(stop.getLocation());
            break;
          default:
            geoEvent.setField(name, value);
            break;
        }
      }
    }
    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);
  }

}
 
开发者ID:Esri,项目名称:route-monitor-for-geoevent,代码行数:81,代码来源:StopsManagerImpl.java


示例12: createGeoEvent2

import com.esri.ges.core.geoevent.GeoEventPropertyName; //导入依赖的package包/类
public GeoEvent createGeoEvent2(Stop stop, String ownerId, Uri uri)
{
  try
  {
    GeoEvent geoEvent = geoEventCreator.create(stopGEDName, stopGEDOwner);
    geoEvent.setGeometry( stop.getLocation() );
    geoEvent.setField(StopResource.LAST_UPDATED_KEY, stop.getLastUpdated());
    geoEvent.setField(StopResource.SHAPE_KEY, stop.getLocation().toJson());
    geoEvent.setField(StopResource.STOP_NAME_KEY, stop.getName());
    geoEvent.setField(StopResource.ROUTE_NAME_KEY, stop.getRouteName());
    geoEvent.setField(StopResource.SEQUENCE_NUMBER_KEY, stop.getSequenceNumber());
    geoEvent.setField(StopResource.STATUS_KEY, stop.getStatus().toString() );
    geoEvent.setField(StopResource.TYPE_KEY, stop.getType());
    geoEvent.setField(StopResource.DESCRIPTION_KEY, stop.getDescription());
    geoEvent.setField(StopResource.PICKUP_CAPACITY_KEY, stop.getPickupCapacity());
    geoEvent.setField(StopResource.DELIVERY_CAPACITY_KEY, stop.getDeliveryCapacity());
    geoEvent.setField(StopResource.ADDRESS_KEY, stop.getAddress());
    geoEvent.setField(StopResource.CURB_APPROACH_KEY, stop.getCurbApproach());
    geoEvent.setField(StopResource.CUSTOM_STOP_PROPERTIES_KEY, stop.getCustomProperties());
    geoEvent.setField(StopResource.TIME_WINDOW_START_1_KEY, stop.getTimeWindowStart1());
    geoEvent.setField(StopResource.TIME_WINDOW_END_1_KEY, stop.getTimeWindowEnd1());
    geoEvent.setField(StopResource.TIME_WINDOW_START_2_KEY, stop.getTimeWindowStart2());
    geoEvent.setField(StopResource.TIME_WINDOW_END_2_KEY, stop.getTimeWindowEnd2());
    geoEvent.setField(StopResource.MAX_VIOLATION_KEY, stop.getMaxViolationTime());
    geoEvent.setField(StopResource.SCHEDULED_ARRIVAL_KEY, stop.getScheduledArrival());
    geoEvent.setField(StopResource.PROJECTED_ARRIVAL_KEY, stop.getProjectedArrival());
    geoEvent.setField(StopResource.ACTUAL_ARRIVAL_KEY, stop.getActualArrival());
    geoEvent.setField(StopResource.SCHEDULED_SERVICE_DURATION_KEY, stop.getScheduledServiceDuration());
    geoEvent.setField(StopResource.ACTUAL_SERVICE_DURATION_KEY, stop.getActualServiceDuration());
    geoEvent.setField(StopResource.SCHEDULED_DEPARTURE_KEY, stop.getScheduledDeparture());
    geoEvent.setField(StopResource.PROJECTED_DEPARTURE_KEY, stop.getProjectedDeparture());
    geoEvent.setField(StopResource.ACTUAL_DEPARTURE_KEY, stop.getActualDeparture());
    geoEvent.setField(StopResource.NOTE_KEY, stop.getNote());
    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 );
  }
  
}
 
开发者ID:Esri,项目名称:route-monitor-for-geoevent,代码行数:45,代码来源:StopsManagerImpl.java


示例13: createUpdateRouteGeoEvent

import com.esri.ges.core.geoevent.GeoEventPropertyName; //导入依赖的package包/类
@Override
public GeoEvent createUpdateRouteGeoEvent(String routeName, boolean optimize, boolean commit, String requestId, String ownerId, Uri ownerUri)
{
  GeoEvent geoEvent = null;
  Route route = getRouteByName(routeName);
  if(route == null)
    return null;
  
  List<Stop> stops = stopsManager.getStopsByRouteName(routeName);
  try
  {
    geoEvent = geoEventCreator.create( routeUpdateGEDName, routeGEDOwner );
    List<FieldGroup> routeFieldGroups = new ArrayList<FieldGroup>();
    
    List<String> stopNames = new ArrayList<String>();
    for(int i=0; i<stops.size(); i++)
    {
      if(stops.get(i) != null)
        stopNames.add(stops.get(i).getName());
    }

    FieldGroup fieldGroup = geoEvent.createFieldGroup("route");
    fieldGroup.setField("routeName", routeName);
    fieldGroup.setField("stops", stopNames);
    fieldGroup.setField("optimize", optimize);
    routeFieldGroups.add(fieldGroup);
    
    geoEvent.setField("route", routeFieldGroups);
    geoEvent.setField("commit", commit);
    if(requestId==null)
      requestId = "";
    geoEvent.setField("RequestId", requestId);
    geoEvent.setProperty(GeoEventPropertyName.TYPE, "event");
    geoEvent.setProperty(GeoEventPropertyName.OWNER_ID, ownerId);
    geoEvent.setProperty(GeoEventPropertyName.OWNER_URI, ownerUri);
    
  }
  catch( Exception e )
  {
    throw new RuntimeException( e );
  }
  
  return geoEvent;
}
 
开发者ID:Esri,项目名称:route-monitor-for-geoevent,代码行数:45,代码来源:RouteManagerImpl.java


示例14: process

import com.esri.ges.core.geoevent.GeoEventPropertyName; //导入依赖的package包/类
@Override
public GeoEvent process(GeoEvent geoEvent) throws Exception
{
  String owner = geoEvent.getGeoEventDefinition().getOwner();
  GeoEventDefinition ged = geoEventCreator.getGeoEventDefinitionManager().searchGeoEventDefinition(geoEventName, owner);
  if(ged==null)
  {
    LOG.error("Cannot find the GeoEvent Definition " + geoEventName + " with owner " + owner);
    return null;
  }

  FieldDefinition fieldDef = geoEvent.getGeoEventDefinition().getFieldDefinition(geoEventName);
  if(fieldDef.getType() != FieldType.Group)
  {
    LOG.error("Corresponding field is not a group field.");
    return null;
  }
  List<FieldGroup> fieldGroups = new ArrayList<FieldGroup>();
  if(fieldDef.getCardinality()==FieldCardinality.Many)
  {
    fieldGroups = geoEvent.getFieldGroups(geoEventName);
  }
  else
  {
    fieldGroups.add(geoEvent.getFieldGroup(geoEventName));
  }
  
  for(FieldGroup fg : fieldGroups)
  {
    GeoEvent event = geoEventCreator.create(ged.getGuid());
    for(FieldDefinition fd : ged.getFieldDefinitions())
    {
      event.setField(fd.getName(), fg.getField(fd.getName()));
    }
    event.setProperty(GeoEventPropertyName.TYPE, "event");
    event.setProperty(GeoEventPropertyName.OWNER_ID, getId());
    event.setProperty(GeoEventPropertyName.OWNER_URI, definition.getUri());
    send(event);
  }

  return null;
}
 
开发者ID:Esri,项目名称:route-monitor-for-geoevent,代码行数:43,代码来源:GeoEevntExtractor.java



注:本文中的com.esri.ges.core.geoevent.GeoEventPropertyName类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java LargeObject类代码示例发布时间:2022-05-23
下一篇:
Java TByteStack类代码示例发布时间:2022-05-23
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap