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


Java ArcGISServerConnection.getUrl方法代码示例

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


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

示例1: 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);
}
 
开发者ID:Esri,项目名称:defense-solutions-proofs-of-concept,代码行数:58,代码来源:QueryReportProcessor.java

示例2: 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;
}
 
开发者ID:Esri,项目名称:route-monitor-for-geoevent,代码行数:61,代码来源:RouteManagerImpl.java


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