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


Java PMap类代码示例

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


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

示例1: getWeightingProps

import com.graphhopper.util.PMap; //导入依赖的package包/类
private PMap getWeightingProps(String weightingName, Map<String, String> map)
{
	PMap res = new PMap();

	String prefix = "weighting_#" + weightingName;
	int n = prefix.length();
	
	for (Map.Entry<String, String> kv : map.entrySet())
	{
		String name = kv.getKey();
	    int p = name.indexOf(prefix);
	    if (p >= 0)
	    	res.put(name.substring(p + n + 1, name.length()), kv.getValue());
	}
	
	return res;
}
 
开发者ID:GIScience,项目名称:openrouteservice,代码行数:18,代码来源:ORSWeightingFactory.java

示例2: AdditionWeighting

import com.graphhopper.util.PMap; //导入依赖的package包/类
public AdditionWeighting(Weighting[] weightings, Weighting superWeighting, FlagEncoder encoder, PMap map, GraphStorage graphStorage) {
    super(encoder);
    _superWeighting = superWeighting;
    
    int count = weightings.length;
    if (count == 1)
       _weightCalc = new OneWeightCalc(weightings);
    else if (count == 2)
        _weightCalc = new TwoWeightCalc(weightings);
    else if (count == 3)
        _weightCalc = new ThreeWeightCalc(weightings);
    else if (count == 4)
        _weightCalc = new FourWeightCalc(weightings);
    else if (count == 5)
        _weightCalc = new FiveWeightCalc(weightings);
}
 
开发者ID:GIScience,项目名称:openrouteservice,代码行数:17,代码来源:AdditionWeighting.java

示例3: SteepnessDifficultyWeighting

import com.graphhopper.util.PMap; //导入依赖的package包/类
public SteepnessDifficultyWeighting(FlagEncoder encoder, PMap map, GraphStorage graphStorage)
{
    super(encoder, map);
    
    buffer = new byte[1];

 int difficultyLevel = map.getInt("level", -1);

    gsHillIndex = GraphStorageUtils.getGraphExtension(graphStorage, HillIndexGraphStorage.class);
    
    if (gsHillIndex != null)
    {
    	if (difficultyLevel >= 0)
    	{
    		//String name = encoder.toString();
    		/*if (name.equals("hike") || name.equals("hike2") || name.equals("foot"))
    			difficultyWeights = HIKE_DIFFICULTY_MATRIX[difficultyLevel];
    		else*/
    			difficultyWeights = BIKE_DIFFICULTY_MATRIX[difficultyLevel];
    	}
    }
}
 
开发者ID:GIScience,项目名称:openrouteservice,代码行数:23,代码来源:SteepnessDifficultyWeighting.java

示例4: TrafficAvoidWeighting

import com.graphhopper.util.PMap; //导入依赖的package包/类
public TrafficAvoidWeighting( FlagEncoder encoder, PMap map)
{
	super(encoder);
	
    if (!encoder.isRegistered())
        throw new IllegalStateException("Make sure you add the FlagEncoder " + encoder + " to an EncodingManager before using it elsewhere");

    encoderIndex = encoder.getIndex();
    maxSpeed = encoder.getMaxSpeed() / SPEED_CONV;
}
 
开发者ID:GIScience,项目名称:openrouteservice,代码行数:11,代码来源:TrafficAvoidWeighting.java

示例5: DistanceWeighting

import com.graphhopper.util.PMap; //导入依赖的package包/类
public DistanceWeighting( FlagEncoder encoder, PMap pMap )
{
    super(encoder);

    this.flagEncoder = encoder;
    this.encoderIndex = encoder.getIndex();
}
 
开发者ID:GIScience,项目名称:openrouteservice,代码行数:8,代码来源:DistanceWeighting.java

示例6: GreenWeighting

import com.graphhopper.util.PMap; //导入依赖的package包/类
public GreenWeighting(FlagEncoder encoder, PMap map, GraphStorage graphStorage) {
    super(encoder, map);
    
    _gsGreenIndex = GraphStorageUtils.getGraphExtension(graphStorage, GreenIndexGraphStorage.class);
    double factor = map.getDouble("factor", 1);
    
    for (int i = 0; i < totalLevel; i++)
    	_factors[i] = calcGreenWeightFactor(i, factor);
}
 
开发者ID:GIScience,项目名称:openrouteservice,代码行数:10,代码来源:GreenWeighting.java

示例7: AvoidHillsWeighting

import com.graphhopper.util.PMap; //导入依赖的package包/类
public AvoidHillsWeighting(FlagEncoder encoder, PMap map, GraphStorage graphStorage)
{
    super(encoder, map);
    
    buffer = new byte[1];
    this.maxSteepness = map.getDouble("steepness_maximum", -1);
    
    gsHillIndex = GraphStorageUtils.getGraphExtension(graphStorage, HillIndexGraphStorage.class);
}
 
开发者ID:GIScience,项目名称:openrouteservice,代码行数:10,代码来源:AvoidHillsWeighting.java

示例8: CarFlagEncoder

import com.graphhopper.util.PMap; //导入依赖的package包/类
public CarFlagEncoder(PMap properties) {
    this((int) properties.getLong("speed_bits", 5),
            properties.getDouble("speed_factor", 5),
            properties.getBool("turn_costs", false) ? 1 : 0);
    this.properties = properties;
    this.setBlockFords(properties.getBool("block_fords", true));
    this.setBlockByDefault(properties.getBool("block_barriers", true));
    
    maxTrackGradeLevel = properties.getInt("maximum_grade_level", 3);
}
 
开发者ID:GIScience,项目名称:openrouteservice,代码行数:11,代码来源:CarFlagEncoder.java

示例9: HikingFlagEncoder

import com.graphhopper.util.PMap; //导入依赖的package包/类
public HikingFlagEncoder( PMap properties )
{
    this((int) properties.getLong("speed_bits", 4),
            properties.getDouble("speed_factor", 1));
    this.properties = properties;
    this.setBlockFords(properties.getBool("block_fords", true));
}
 
开发者ID:GIScience,项目名称:openrouteservice,代码行数:8,代码来源:HikingFlagEncoder.java

示例10: ElectroBikeFlagEncoder

import com.graphhopper.util.PMap; //导入依赖的package包/类
public ElectroBikeFlagEncoder(PMap properties )
{
    this((int) properties.getLong("speed_bits", 4) + (properties.getBool("consider_elevation", false) ? 1 : 0),
            properties.getLong("speed_factor", 2),
            properties.getBool("turn_costs", false) ? 1 : 0, properties.getBool("consider_elevation", false));
    this.properties = properties;
    this.setBlockFords(properties.getBool("block_fords", true));
}
 
开发者ID:GIScience,项目名称:openrouteservice,代码行数:9,代码来源:ElectroBikeFlagEncoder.java

示例11: EmergencyFlagEncoder

import com.graphhopper.util.PMap; //导入依赖的package包/类
public EmergencyFlagEncoder(PMap properties)
{
    this(properties.getInt("speed_bits", 5),
    		properties.getDouble("speed_factor", 5),
    		properties.getBool("turn_costs", false) ? 3 : 0);
    
    setBlockFords(false);
}
 
开发者ID:GIScience,项目名称:openrouteservice,代码行数:9,代码来源:EmergencyFlagEncoder.java

示例12: RunningFlagEncoder

import com.graphhopper.util.PMap; //导入依赖的package包/类
public RunningFlagEncoder( PMap properties )
{
    this((int) properties.getLong("speed_bits", 4),
            properties.getDouble("speed_factor", 1));
    this.properties = properties;
    this.setBlockFords(properties.getBool("block_fords", true));
}
 
开发者ID:GIScience,项目名称:openrouteservice,代码行数:8,代码来源:RunningFlagEncoder.java

示例13: HeavyVehicleFlagEncoder

import com.graphhopper.util.PMap; //导入依赖的package包/类
public HeavyVehicleFlagEncoder(PMap properties)
{
    this(properties.getInt("speed_bits", 5),
    		properties.getDouble("speed_factor", 5),
    		properties.getBool("turn_costs", false) ? 3 : 0);
    
    setBlockFords(false);
    
    maxTrackGradeLevel = properties.getInt("maximum_grade_level", 1);
}
 
开发者ID:GIScience,项目名称:openrouteservice,代码行数:11,代码来源:HeavyVehicleFlagEncoder.java

示例14: SafetyBikeFlagEncoder

import com.graphhopper.util.PMap; //导入依赖的package包/类
public SafetyBikeFlagEncoder(PMap configuration)
{
   this(configuration.getInt("speed_bits", 4) + (configuration.getBool("consider_elevation", false) ? 1 : 0),
 		  configuration.getDouble("speed_factor", 2),
           configuration.getBool("turn_costs", false) ? 3 : 0,
           configuration.getBool("consider_elevation", false));
   
   setBlockFords(false);
}
 
开发者ID:GIScience,项目名称:openrouteservice,代码行数:10,代码来源:SafetyBikeFlagEncoder.java

示例15: BikeFlagEncoder

import com.graphhopper.util.PMap; //导入依赖的package包/类
public BikeFlagEncoder(PMap properties) {
    this((int) properties.getLong("speed_bits", 4) + (properties.getBool("consider_elevation", false) ? 1 : 0),
            properties.getLong("speed_factor", 2),
            properties.getBool("turn_costs", false) ? 1 : 0, properties.getBool("consider_elevation", false));
    this.properties = properties;
    this.setBlockFords(properties.getBool("block_fords", true));
}
 
开发者ID:GIScience,项目名称:openrouteservice,代码行数:8,代码来源:BikeFlagEncoder.java


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