当前位置: 首页>>代码示例>>Java>>正文


Java GeoEvent.getField方法代码示例

本文整理汇总了Java中com.esri.ges.core.geoevent.GeoEvent.getField方法的典型用法代码示例。如果您正苦于以下问题:Java GeoEvent.getField方法的具体用法?Java GeoEvent.getField怎么用?Java GeoEvent.getField使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在com.esri.ges.core.geoevent.GeoEvent的用法示例。


在下文中一共展示了GeoEvent.getField方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: process

import com.esri.ges.core.geoevent.GeoEvent; //导入方法依赖的package包/类
@Override
public GeoEvent process(GeoEvent ge) throws Exception {
	// Operation phase...
	if (radius == null) {
		radius = (Double) ge.getField(bufferEventFld);
		if (radius == null) {
			Exception e = new Exception("Radius is not defined in geoevent");
			throw (e);
		}
	}
	MapGeometry mapGeo = ge.getGeometry();
	Point eventGeo = (Point) mapGeo.getGeometry();
	double x = eventGeo.getX();
	double y = eventGeo.getY();
	int inwkid = mapGeo.getSpatialReference().getID();
	//int inwkid = eventGeo.getSpatialReference().getWkid();
	Geometry buffer = constructBuffer(x, y, radius,
			units, inwkid, bufferwkid, outwkid);
	
	SpatialReference srOut = SpatialReference.create(outwkid);
	MapGeometry outMapGeo = new MapGeometry(buffer, srOut);
	ge.setGeometry(outMapGeo);
	return ge;
}
 
开发者ID:Esri,项目名称:defense-solutions-proofs-of-concept,代码行数:25,代码来源:BufferProcessor.java

示例2: processGeometry

import com.esri.ges.core.geoevent.GeoEvent; //导入方法依赖的package包/类
protected Object processGeometry(GeoEvent geoevent, String geometryField) throws Exception
{
	MapGeometry geomout = null;
	try
	{
		MapGeometry geom = (MapGeometry) geoevent.getField(geometryField);

		geomout = getAreaAroundPoint(geom);
	}
	catch (Exception e)
	{
		if (geoevent.getTrackId() == null)
			throw new Exception(LOGGER.translate("SERVICE_AREA_UNABLE_ERROR1", e.getMessage()), e);
		else
			throw new Exception(LOGGER.translate("SERVICE_AREA_UNABLE_ERROR2", geoevent.getTrackId(), e.getMessage()), e);
	}
	return geomout;
}
 
开发者ID:Esri,项目名称:service-area-calculator-for-geoevent,代码行数:19,代码来源:ServiceAreaCalculator.java

示例3: createVehicleFromGeoEvent

import com.esri.ges.core.geoevent.GeoEvent; //导入方法依赖的package包/类
private Vehicle createVehicleFromGeoEvent(GeoEvent geoEvent)
{
  DefaultVehicle vehicle = new DefaultVehicle();
  vehicle.setCumulativeMinutes((Double) geoEvent.getField(VehicleResource.CUMULATIVE_MINUTES_KEY));
  vehicle.setDeviceId((String) geoEvent.getField(VehicleResource.DEVICE_ID_KEY));
  vehicle.setDeviceType((String) geoEvent.getField(VehicleResource.DEVICE_TYPE_KEY));
  vehicle.setEventName((String) geoEvent.getField(VehicleResource.EVENT_NAME_KEY));
  vehicle.setLastUpdated((Date) geoEvent.getField(VehicleResource.LAST_UPDATED_KEY));
  Object vehicleLocationObject = geoEvent.getField(VehicleResource.GEOMETRY_KEY);
  if (vehicleLocationObject != null)
  {
    Geometry vehicleLocation = geometryFromAttribute(vehicleLocationObject);
    if (vehicleLocation != null && vehicleLocation instanceof Point)
    {
      vehicle.setLocation((Point) vehicleLocation);
    }
  }
  vehicle.setNextStopSequenceNumber((Integer) geoEvent.getField(VehicleResource.NEXT_STOP_SEQUENCE_NUMBER_KEY));
  vehicle.setPanic((String) geoEvent.getField(VehicleResource.PANIC_KEY));
  vehicle.setSpeed((Double) geoEvent.getField(VehicleResource.SPEED_KEY));
  vehicle.setVehicleGroupName((String) geoEvent.getField(VehicleResource.VEHICLE_GROUP_NAME_KEY));
  vehicle.setVehicleName((String) geoEvent.getField(VehicleResource.VEHICLE_NAME_KEY));
  return vehicle;
}
 
开发者ID:Esri,项目名称:route-monitor-for-geoevent,代码行数:25,代码来源:VehicleProcessor.java

示例4: updateETAForOneStop

import com.esri.ges.core.geoevent.GeoEvent; //导入方法依赖的package包/类
private void updateETAForOneStop(GeoEvent geoEvent) throws Exception
{
  if (geoEventCreator == null && (geoEventCreator = messaging.createGeoEventCreator()) == null)
    return;

  String trackId = (String) geoEvent.getField("TRACK_ID");
  Stop stop = getNextStop(trackId);
  if (stop == null)
  {
    LOG.error( "Couldn't update ETA for track "+trackId+" because the next stop was not found." );
    return;
  }
  calculateETAForNextStop(stop, geoEvent);
  if(stop != null)
    send(stopsManager.createGeoEvent(stop, getId(), definition.getUri()));
}
 
开发者ID:Esri,项目名称:route-monitor-for-geoevent,代码行数:17,代码来源:EtaCalculator.java

示例5: process

import com.esri.ges.core.geoevent.GeoEvent; //导入方法依赖的package包/类
@Override
public GeoEvent process(GeoEvent evt){
	try {
		int inwkid = (Integer) properties.get("wkidin").getValue();
		int outwkid = (Integer) properties.get("wkidout").getValue();
		//int bufferwkid = (Integer) properties.get("wkidbuffer").getValue();
		srIn = SpatialReference.create(inwkid);
		//srBuffer = SpatialReference.create(bufferwkid);
		srOut = SpatialReference.create(outwkid);

		String eventfld = properties.get("polyfld").getValue().toString();
		String[] arr = eventfld.split(":");
		String geostring = (String) evt.getField(arr[1]);

		String format = properties.get("polyformat").getValue().toString();
		com.esri.ges.spatial.Geometry geo = null;
		if (format.equals("Json")) {
			geo = constructJsonGeometry(geostring);
		} else if (format.equals("CAP")) {
			geo = constructCAPGeometry(geostring);
		}
		evt.setGeometry(geo);
		return evt;
	} catch (Exception ex) {
		LOG.error(ex.getMessage());
		LOG.error(ex.getStackTrace());
		return null;
	}
}
 
开发者ID:Esri,项目名称:defense-solutions-proofs-of-concept,代码行数:30,代码来源:PolygonProcessor.java

示例6: process

import com.esri.ges.core.geoevent.GeoEvent; //导入方法依赖的package包/类
@Override
public GeoEvent process(GeoEvent ge) throws Exception {
	String radiusSource = properties.get("radiusSource").getValue().toString();
	double radius;
	if(radiusSource.equals("Constant"))
	{
		radius = (Double)properties.get("radius").getValue();
	}
	else
	{
		String eventfld = properties.get("radiusEvent").getValue().toString();
		String[] arr = eventfld.split(":");
		radius = (Double)ge.getField(arr[1]);
	}
	
	
	String units = properties.get("units").getValue().toString();
	int inwkid = (Integer) properties.get("wkidin").getValue();
	int outwkid = (Integer) properties.get("wkidout").getValue();
	int bufferwkid = (Integer) properties.get("wkidbuffer").getValue();
	com.esri.ges.spatial.Point eventGeo = (com.esri.ges.spatial.Point) ge.getGeometry();
	double x = eventGeo.getX();
	double y = eventGeo.getY();
	com.esri.ges.spatial.Geometry buffer = constructBuffer(x,y,radius,units,inwkid,bufferwkid,outwkid);
	ge.setGeometry(buffer);
	return ge;
}
 
开发者ID:Esri,项目名称:defense-solutions-proofs-of-concept,代码行数:28,代码来源:BufferProcessor.java

示例7: process

import com.esri.ges.core.geoevent.GeoEvent; //导入方法依赖的package包/类
@Override
public GeoEvent process(GeoEvent ge) throws Exception {
	
	if(!ge.getGeoEventDefinition().getTagNames().contains("GEOMETRY"))
	{
		return null;
	}
	inwkid = ge.getGeometry().getSpatialReference().getID();
	if(majAxisSource.equals("Event"))
	{
		majorAxisRadius = (Double)ge.getField(majorAxisField);
	}
	if(minAxisSource.equals("Event"))
	{
		minorAxisRadius = (Double)ge.getField(minorAxisField);
	}
	if(rotSource.equals("Event"))
	{
		rotation=(Double)ge.getField(rotationField);
	}
	
	MapGeometry mapGeo = ge.getGeometry();
	Geometry geo = mapGeo.getGeometry();
	if(!(geo instanceof Point))
	{
		return null;
	}
	Point eventGeo = (Point)geo;
	double x = eventGeo.getX();
	double y = eventGeo.getY();
	double rdeg = GeometryUtility.Geo2Arithmetic(rotation);
	double r = Math.toRadians(rdeg);
	MapGeometry ellipse = constructEllipse(x, y, majorAxisRadius, minorAxisRadius, r, inwkid, procwkid, outwkid);
	ge.setGeometry(ellipse);
	return ge;
}
 
开发者ID:Esri,项目名称:defense-solutions-proofs-of-concept,代码行数:37,代码来源:EllipseProcessor.java

示例8: process

import com.esri.ges.core.geoevent.GeoEvent; //导入方法依赖的package包/类
@Override
public GeoEvent process(GeoEvent ge) throws Exception {
	
	LOG.info("VisibilityProcessor.process starts.................");
			
	double radius;
	if(!ge.getGeoEventDefinition().getTagNames().contains("GEOMETRY"))
	{
		return null;
	}
	srIn=ge.getGeometry().getSpatialReference();
	if(isRadiusConstant)
	{
		radius = radiusConstant;
	}
	else
	{
		
		radius = (Double)ge.getField(radiusEventfld);
	}
	
	double elevation;
	
	if(isElevConstant){
		elevation =elevConstant;
	}
	else
	{
		elevation = (Double)ge.getField(elevEventfld);
	}
	
	LOG.info("Calling ConstructVisibilityRest.................");

	GeoEvent outGeo = ConstructVisibilityRest(ge, gp, is, radius, radiusUnit,  elevation, units_elev, procwkid);
	
	LOG.info("VisibilityProcessor.process ends.................");

	return outGeo;
}
 
开发者ID:Esri,项目名称:defense-solutions-proofs-of-concept,代码行数:40,代码来源:VisibilityProcessor.java

示例9: process

import com.esri.ges.core.geoevent.GeoEvent; //导入方法依赖的package包/类
public GeoEvent process(GeoEvent evt) throws Exception {

		GeoEventDefinition ged = evt.getGeoEventDefinition();
		FieldDefinition fd = ged.getFieldDefinition(aggregateFld);
		if (fd == null)
			return null;
		FieldType type = fd.getType();
		if (!typelist.contains(type)) {
			return null;
		}

		Double val = null;
		if (type == FieldType.Double) {
			val = (Double) evt.getField(aggregateFld);
		} else if (type == FieldType.Integer) {
			val = ((Integer) evt.getField(aggregateFld)) * 1.0;
		} else if (type == FieldType.Long) {
			val = ((Long) evt.getField(aggregateFld)) * 1.0;
		} else if (type == FieldType.Short) {
			val = ((Short) evt.getField(aggregateFld)) * 1.0;
		} else if (type == FieldType.Float) {
			val = ((Float) evt.getField(aggregateFld)) * 1.0;
		}
		if(val == null)
		{
			return null;
		}
		timestamp = System.currentTimeMillis();
		cache.put(timestamp, val);

		return null;
	}
 
开发者ID:Esri,项目名称:defense-solutions-proofs-of-concept,代码行数:33,代码来源:STWAProcessor.java

示例10: convertGeoEventToStop

import com.esri.ges.core.geoevent.GeoEvent; //导入方法依赖的package包/类
public void convertGeoEventToStop( GeoEvent message, Stop stop )
{
  Set<String> predefinedTags = stop.getPredefinedKeys();
  for (FieldDefinition fd :message.getGeoEventDefinition().getFieldDefinitions())
  {
    String name = fd.getName();
    Object value = message.getField(name);
    String resrouceName = getResourceName(fd, predefinedTags);
    
    if(value == null)
    {
      continue;
    }
    String valueToInsert;
    switch(fd.getType())
    {
      case Boolean:
      case Double:
      case Integer:
      case Long:
      case Short:
      case String:
      case Geometry:
        valueToInsert = value.toString();
        break;
      case Date:
        valueToInsert = Long.toString( ((Date)value).getTime() );
        break;
      default:
        valueToInsert = null;
        break; 
      
    }
    stop.setAttribute( resrouceName, valueToInsert );
  }
}
 
开发者ID:Esri,项目名称:route-monitor-for-geoevent,代码行数:37,代码来源:StopsManagerImpl.java

示例11: createVehicleFromGeoEvent

import com.esri.ges.core.geoevent.GeoEvent; //导入方法依赖的package包/类
public Vehicle createVehicleFromGeoEvent(GeoEvent geoEvent)
{
  DefaultVehicle vehicle = new DefaultVehicle();
  vehicle.setCumulativeMinutes((Double) geoEvent.getField(VehicleResource.CUMULATIVE_MINUTES_KEY));
  vehicle.setDeviceId((String) geoEvent.getField(VehicleResource.DEVICE_ID_KEY));
  vehicle.setDeviceType((String) geoEvent.getField(VehicleResource.DEVICE_TYPE_KEY));
  vehicle.setEventName((String) geoEvent.getField(VehicleResource.EVENT_NAME_KEY));
  vehicle.setLastUpdated((Date) geoEvent.getField(VehicleResource.LAST_UPDATED_KEY));
  Object vehicleLocationObject = geoEvent.getField(VehicleResource.GEOMETRY_KEY);
  if (vehicleLocationObject != null)
  {
    Geometry vehicleLocation = geometryFromAttribute(vehicleLocationObject);
    if (vehicleLocation != null && vehicleLocation instanceof Point)
    {
      vehicle.setLocation((Point) vehicleLocation);
    }
  }
  vehicle.setNextStopSequenceNumber((Integer) geoEvent.getField(VehicleResource.NEXT_STOP_SEQUENCE_NUMBER_KEY));
  vehicle.setPanic((String) geoEvent.getField(VehicleResource.PANIC_KEY));
  vehicle.setSpeed((Double) geoEvent.getField(VehicleResource.SPEED_KEY));
  vehicle.setVehicleGroupName((String) geoEvent.getField(VehicleResource.VEHICLE_GROUP_NAME_KEY));
  vehicle.setVehicleName((String) geoEvent.getField(VehicleResource.VEHICLE_NAME_KEY));
  vehicle.setFixedCost((Double) geoEvent.getField(VehicleResource.FIXED_COST_KEY));
  vehicle.setFuelEconomy((Double) geoEvent.getField(VehicleResource.FUEL_ECONOMY_KEY));
  vehicle.setFuelType((String) geoEvent.getField(VehicleResource.FUEL_TYPE_KEY));
  vehicle.setCapacity((String) geoEvent.getField(VehicleResource.CAPACITY_KEY));
  vehicle.setSpecialties((String) geoEvent.getField(VehicleResource.SPECIALTIES_KEY));
  return vehicle;
}
 
开发者ID:Esri,项目名称:route-monitor-for-geoevent,代码行数:30,代码来源:VehiclesManagerImpl.java

示例12: getPointFromField

import com.esri.ges.core.geoevent.GeoEvent; //导入方法依赖的package包/类
private Point getPointFromField( GeoEvent geoEvent, String fieldName )
{
  Object routePointObject = geoEvent.getField( fieldName );
  if( routePointObject != null )
  {
    Geometry routeEndPoint = geometryFromAttribute( routePointObject );
    if( routeEndPoint != null && routeEndPoint instanceof Point )
    {
      return (Point)routeEndPoint;
    }
  }
  return null;
}
 
开发者ID:Esri,项目名称:route-monitor-for-geoevent,代码行数:14,代码来源:RouteManagerImpl.java

示例13: resequence

import com.esri.ges.core.geoevent.GeoEvent; //导入方法依赖的package包/类
@Override
public GeoEvent resequence(GeoEvent geoEvent, String naConnection, String routeSolverPath)
{
  Collection<CalculateParamsWrapper> routes;
  Plan plan = null;
  boolean commit = false;
  try
  {
    routes = convertGeoEventToCalculateParameters(geoEvent);
    //commit = (Boolean)geoEvent.getField("commit");
    
    // TODO: workaround.  json adapter writes Boolean as string.  As a result, the input which uses the same GED could not read Boolean fields.
    // If commit is null, set it to true.
    commit = true;
    if(geoEvent.getField("commit") != null)
      commit = (Boolean)geoEvent.getField("commit");
    
    plan = calculate(routes, naConnection, routeSolverPath, commit);
  }
  catch (Exception e)
  {
    log.error(e);
    return createPlanGeoEvent(null, false, PlanStatus.Failed, e.getMessage());
  }
  
  return createPlanGeoEvent(plan, commit, PlanStatus.Successful, "");
}
 
开发者ID:Esri,项目名称:route-monitor-for-geoevent,代码行数:28,代码来源:RouteManagerImpl.java

示例14: processGeoEvent

import com.esri.ges.core.geoevent.GeoEvent; //导入方法依赖的package包/类
protected GeoEvent processGeoEvent(GeoEvent geoEvent)
{
  String stopName = (String)geoEvent.getField( StopResource.STOP_NAME_KEY );
  Point point = getLocation(geoEvent);
  if(point == null)
    return null;
  
  Aoi aoi = aoiManager.getAoi(stopsManager.getStopsAoiCategory(), stopName);
  if(aoi != null)
  {
    Stop oldStop = stopsManager.getStopByName(stopName);
    if(oldStop != null)
    {
      String newStatus = (String)geoEvent.getField(StopResource.STATUS_KEY);
      if(newStatus != null)
        if(newStatus.equals(StopStatus.AtStop.toString()) || newStatus.equals(StopStatus.Completed.toString())
            || newStatus.equals(StopStatus.Exception.toString()))
            return null;
      if((oldStop.getLocation().getX()==point.getX() && oldStop.getLocation().getY()==point.getY()))
        return null;
      stopsManager.convertGeoEventToStop(geoEvent, oldStop);
      if(oldStop.getStatus()==StopStatus.Canceled)
        return null;
    }
    else
    {
      Stop stop = stopsManager.createStop(stopName);
      stopsManager.convertGeoEventToStop(geoEvent, stop);
      if(stop.getStatus()==StopStatus.Canceled)
        return null;
    }
    aoiManager.deleteAoi(stopsManager.getStopsAoiCategory(), stopName);
  }
  
  if(serviceAreaType.equals(ServiceAreaCalculatorDefinition.SERVICE_AREA_TYPE_BUFFER))
    return createBufferForStop(bufferDistance, stopName, point);
  else
    return createAoiForStop(naConnectionName, path, driveTime, stopName, point);
}
 
开发者ID:Esri,项目名称:route-monitor-for-geoevent,代码行数:40,代码来源:ServiceAreaCalculator.java

示例15: updateETAForAllStops

import com.esri.ges.core.geoevent.GeoEvent; //导入方法依赖的package包/类
private void updateETAForAllStops(GeoEvent geoEvent) throws Exception
{
  if (geoEventCreator == null && (geoEventCreator = messaging.createGeoEventCreator()) == null)
    return;

  String trackId = (String) geoEvent.getField("TRACK_ID");
  List<Stop> stops = getNextStops(trackId);
  Stop stop = stops.get(0);
  
  if (stop == null)
  {
    LOG.error( "Couldn't update ETA for track "+trackId+" because the next stop was not found." );
    return;
  }
  calculateETAForNextStop(stop, geoEvent);
  
  if(stop != null)
  {
    long diff = DateUtil.millisecondsBetween(stop.getProjectedArrival(), stop.getScheduledArrival());
    
    for(int i=1; i<stops.size(); i++)
    {
      if(stops.get(i) != null)
      {
        if(stops.get(i).getScheduledArrival() != null)
          stops.get(i).setProjectedArrival(new Date(stops.get(i).getScheduledArrival().getTime() + diff));
        if(stops.get(i).getScheduledDeparture() != null)
          stops.get(i).setProjectedDeparture(new Date(stops.get(i).getScheduledDeparture().getTime() + diff));
        send(stopsManager.createGeoEvent(stops.get(i), getId(), definition.getUri()));
      }
    }
  }
}
 
开发者ID:Esri,项目名称:route-monitor-for-geoevent,代码行数:34,代码来源:EtaCalculator.java


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