本文整理汇总了Java中com.esri.ges.datastore.agsconnection.ArcGISServerConnection类的典型用法代码示例。如果您正苦于以下问题:Java ArcGISServerConnection类的具体用法?Java ArcGISServerConnection怎么用?Java ArcGISServerConnection使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
ArcGISServerConnection类属于com.esri.ges.datastore.agsconnection包,在下文中一共展示了ArcGISServerConnection类的12个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: reloadStops
import com.esri.ges.datastore.agsconnection.ArcGISServerConnection; //导入依赖的package包/类
@Override
public List<Stop> reloadStops(String agsConnectionName, String path, String featureService, String layer)
{
removeAllStops();
ArcGISServerConnection agsConnection = agsConnectionManager.getArcGISServerConnection(agsConnectionName);
Layer lyr = agsConnection.getLayer(path, featureService, layer, ArcGISServerType.FeatureServer);
//getAllFeatures(String folder, String serviceName, int layerIndex, String queryDefinition, String outFields, boolean includeGeometry, ArcGISServerType serverType, long lastOid)
try
{
List<JsonNode> nodes = agsConnection.getAllFeatures(path, featureService, lyr.getId(), "1=1", "*", true, ArcGISServerType.FeatureServer, 0);
List<Stop> stops = parseFeaturesToStops(nodes);
for(Stop stop : stops)
{
addOrReplaceStop(stop);
}
}
catch (IOException e)
{
log.error(e);
}
return getStops();
}
示例2: reloadVehicles
import com.esri.ges.datastore.agsconnection.ArcGISServerConnection; //导入依赖的package包/类
@Override
public List<Vehicle> reloadVehicles(String agsConnectionName, String path, String featureService, String layer)
{
removeAllVehicles();
ArcGISServerConnection agsConnection = agsConnectionManager.getArcGISServerConnection(agsConnectionName);
Layer lyr = agsConnection.getLayer(path, featureService, layer, ArcGISServerType.FeatureServer);
try
{
List<JsonNode> nodes = agsConnection.getAllFeatures(path, featureService, lyr.getId(), "1=1", "*", true, ArcGISServerType.FeatureServer, 0);
List<Vehicle> vehicles = parseFeaturesToVehicles(nodes);
for(Vehicle vehicle : vehicles)
{
addOrReplaceVehicle(vehicle);
}
}
catch (IOException e)
{
log.error(e);
}
return getVehicles();
}
示例3: reloadRoutes
import com.esri.ges.datastore.agsconnection.ArcGISServerConnection; //导入依赖的package包/类
@Override
public List<Route> reloadRoutes(String agsConnectionName, String path, String featureService, String layer)
{
removeAllRoutes();
ArcGISServerConnection agsConnection = agsConnectionManager.getArcGISServerConnection(agsConnectionName);
Layer lyr = agsConnection.getLayer(path, featureService, layer, ArcGISServerType.FeatureServer);
try
{
List<JsonNode> nodes = agsConnection.getAllFeatures(path, featureService, lyr.getId(), "1=1", "*", true, ArcGISServerType.FeatureServer, 0);
List<Route> routes = parseFeaturesToRoutes(nodes);
for(Route route:routes)
{
addOrReplaceRoute(route);
}
}
catch (IOException e)
{
log.error(e);
}
return new ArrayList<Route>(getRoutes());
}
示例4: clearAllStops
import com.esri.ges.datastore.agsconnection.ArcGISServerConnection; //导入依赖的package包/类
@Override
public void clearAllStops(String agsConnectionName, String path, String featureService, String stopLayer, String geofenceLayer)
{
ArcGISServerConnection agsConnection = agsConnectionManager.getArcGISServerConnection(agsConnectionName);
Layer stoplyr = agsConnection.getLayer(path, featureService, stopLayer, ArcGISServerType.FeatureServer);
agsConnection.deleteAllRecordsFromLayer(path , featureService, stoplyr.getId());
removeAllStops();
if(!Validator.isEmpty(geofenceLayer))
{
Layer geofencelyr = agsConnection.getLayer(path, featureService, geofenceLayer, ArcGISServerType.FeatureServer);
agsConnection.deleteAllRecordsFromLayer(path , featureService, geofencelyr.getId());
}
}
示例5: clearAllAlertFeatures
import com.esri.ges.datastore.agsconnection.ArcGISServerConnection; //导入依赖的package包/类
@Override
public void clearAllAlertFeatures(String agsConnectionName, String path, String featureService, String layer)
{
ArcGISServerConnection agsConnection = agsConnectionManager.getArcGISServerConnection(agsConnectionName);
Layer lyr = agsConnection.getLayer(path, featureService, layer, ArcGISServerType.FeatureServer);
agsConnection.deleteAllRecordsFromLayer(path , featureService, lyr.getId());
}
示例6: clearAllMessageFeatures
import com.esri.ges.datastore.agsconnection.ArcGISServerConnection; //导入依赖的package包/类
@Override
public void clearAllMessageFeatures(String agsConnectionName, String path, String featureService, String layer)
{
ArcGISServerConnection agsConnection = agsConnectionManager.getArcGISServerConnection(agsConnectionName);
Layer lyr = agsConnection.getLayer(path, featureService, layer, ArcGISServerType.FeatureServer);
agsConnection.deleteAllRecordsFromLayer(path , featureService, lyr.getId());
}
示例7: clearAllVehicleFeatures
import com.esri.ges.datastore.agsconnection.ArcGISServerConnection; //导入依赖的package包/类
@Override
public void clearAllVehicleFeatures(String agsConnectionName, String path, String featureService, String layer)
{
ArcGISServerConnection agsConnection = agsConnectionManager.getArcGISServerConnection(agsConnectionName);
Layer lyr = agsConnection.getLayer(path, featureService, layer, ArcGISServerType.FeatureServer);
agsConnection.deleteAllRecordsFromLayer(path , featureService, lyr.getId());
removeAllVehicles();
}
示例8: clearAllRouteFeatures
import com.esri.ges.datastore.agsconnection.ArcGISServerConnection; //导入依赖的package包/类
@Override
public void clearAllRouteFeatures(String agsConnectionName, String path, String featureService, String layer)
{
ArcGISServerConnection agsConnection = agsConnectionManager.getArcGISServerConnection(agsConnectionName);
Layer lyr = agsConnection.getLayer(path, featureService, layer, ArcGISServerType.FeatureServer);
agsConnection.deleteAllRecordsFromLayer(path , featureService, lyr.getId());
removeAllRoutes();
}
示例9: createAoiForStop
import com.esri.ges.datastore.agsconnection.ArcGISServerConnection; //导入依赖的package包/类
protected GeoEvent createAoiForStop(String naConnectionName, String areaSolverPath, int driveTime, String stopName, Point point)
{
Aoi aoi = null;
ArcGISServerConnection agsConnection = agsConnectionManager.getArcGISServerConnection( naConnectionName );
if( agsConnection != null )
{
Geometry aoiGeom = agsConnection.getAreaAroundPoint( areaSolverPath, point, driveTime );
List<Geometry> geometries = new ArrayList<Geometry>();
geometries.add( aoiGeom );
try
{
aoi = aoiManager.addAoi(stopsManager.getStopsAoiCategory(), stopName, geometries, true );
// Now that we've got an instantiated Aoi, delete it from the manager so that it can create
// one based on the sync rule
aoiManager.deleteAoi( aoi.getCategory(), aoi.getName() );
}
catch (AoiManagerException e)
{
LOG.error( "Unable to add Aoi for Stop "+ stopName, e);
}
}
else
{
LOG.error( "Could not find ArcGISServer Connection "+naConnectionName );
}
return createGeoEventForAoi(aoi);
}
示例10: getMinutesToNextStop
import com.esri.ges.datastore.agsconnection.ArcGISServerConnection; //导入依赖的package包/类
private Double getMinutesToNextStop( Stop stop, Point currentLocation )
{
Double retVal = null;
ArcGISServerConnection agsConn = agsConnectionManager.getArcGISServerConnection( agsConnectionName );
if( agsConn != null )
{
retVal = agsConn.getTimeInMinutesBetween(routeSolverPath, currentLocation, stop.getLocation() );
}
else
{
LOG.error( "Could not find ArcGISServer Data Store "+agsConnectionName );
}
return retVal;
}
示例11: CreateQueries
import com.esri.ges.datastore.agsconnection.ArcGISServerConnection; //导入依赖的package包/类
public void CreateQueries()
{
String connName = properties.get("connection").getValueAsString();
ArcGISServerConnection conn = connectionManager.getArcGISServerConnection(connName);
URL url = conn.getUrl();
String folder = properties.get("folder").getValueAsString();
String service = properties.get("service").getValueAsString();
String lyrName = properties.get("layer").getValueAsString();
Layer layer =conn.getLayer(folder, service, lyrName, ArcGISServerType.FeatureServer);
String layerId = ((Integer)layer.getId()).toString();
String field = properties.get("field").getValueAsString();
String baseUrl = url.getProtocol() +"://"+ url.getHost() + ":" + url.getPort()
+ url.getPath() + "rest/services/";
String curPath = baseUrl + "/" + folder + "/" + service + "/FeatureServer/" + layerId;
String restpath = curPath + "/query?";
HashMap<String, Object> query = new HashMap<String, Object>();
HashMap<String, String> fieldMap = new HashMap<String, String>();
String fldsString = field;
Field[] fields = conn.getFields(folder, service, layer.getId(), ArcGISServerType.FeatureServer);
Boolean usingDist=false;
String lyrHeaderCfg = "";
String distToken="";
String distUnits="";
String wc="";
String itemConfig = "";
wc = properties.get("wc")
.getValueAsString();
lyrHeaderCfg = properties.get("lyrheader").getValueAsString();
usingDist = (Boolean)properties.get("calcDistance").getValue();
if(usingDist)
{
distToken=properties.get("dist_token").getValueAsString();
distUnits=properties.get("dist_units").getValueAsString();
}
String token = properties.get("field-token")
.getValueAsString();
fieldMap.put(field, token);
itemConfig = properties.get("item-config").getValueAsString();
query.put("restpath", restpath);
query.put("path", curPath);
query.put("whereclause", wc);
query.put("fields", fldsString );
query.put("outfields", fields);
query.put("tokenMap", fieldMap);
query.put("headerconfig", lyrHeaderCfg);
query.put("usingdist", usingDist);
query.put("distunits", distUnits);
query.put("disttoken", distToken);
query.put("itemconfig", itemConfig);
query.put("layer", layer.getName());
UUID uid = UUID.randomUUID();
query.put("id", uid);
queries.add(query);
}
示例12: solveRoute
import com.esri.ges.datastore.agsconnection.ArcGISServerConnection; //导入依赖的package包/类
@Override
public Plan solveRoute(List<RouteWithStops> routesWithStops, String naConnection, String routeSolverPath)
{
ArcGISServerConnection agsConnection = agsConnectionManager.getArcGISServerConnection( naConnection );
if( agsConnection == null )
{
throw new RuntimeException( "Could not find ArcGIS Server Connection "+naConnection );
}
NetworkAnalystServerConnection networkAnalystServerConnection = new NetworkAnalystServerConnection(spatial, agsConnection.getUrl());
Plan plan = new Plan();
plan.setRoutes( new ArrayList<Route>() );
plan.setStops( new ArrayList<Stop>() );
if( Validator.isEmpty( routesWithStops ) )
{
return plan;
}
SolvedRoute solvedRoute;
Date startTime;
for( RouteWithStops routeWithStops : routesWithStops )
{
ArrayList<Location> locations = new ArrayList<Location>();
ArrayList<Location> notServicedLocations = new ArrayList<Location>();
startTime = routeWithStops.getCurrentTimeStamp();
List<Stop> servicedStops = new ArrayList<Stop>();
for( Stop stop : routeWithStops.getStops() )
{
if( !stop.isServiced() )
{
notServicedLocations.add( convertStopToLocation( stop ) );
}
else
{
log.info( "Stop "+stop.getName()+" has already been serviced. Will not include it in updated route." );
DefaultStop stopCopy = new DefaultStop( stop );
stopCopy.setSequenceNumber( servicedStops.size());
servicedStops.add( stopCopy );
}
}
// put two lists together
if(routeWithStops.getStops().get(0).isServiced() || (!routeWithStops.getStops().get(0).isServiced() && !routeWithStops.getStops().get(0).getType().equals(NonServiceStopType.Base)))
{
//If vehicle started moving, current location may be needed. If vehicle has not completed the start/base, current location is not needed.
addCurrentLocation(notServicedLocations, routeWithStops, servicedStops);
}
locations.addAll(notServicedLocations);
updateSequenceNumbers( locations );
startTime = constructStartTime(routeWithStops, servicedStops);
solvedRoute = networkAnalystServerConnection.solveRoute(routeSolverPath, locations, routeWithStops.isOptimize(), startTime );
addSolvedRouteToPlan( plan, solvedRoute, servicedStops.size(), startTime );
//Add previously serviced Stops
plan.getStops().addAll( servicedStops );
}
return plan;
}