Package org.osm2world.core

Examples of org.osm2world.core.ConversionFacade


   
    OSMData osmData = new OSMData(EMPTY_LIST, nodes, ways, EMPTY_LIST);
   
    /* render to multiple targets */
   
    ConversionFacade cf = new ConversionFacade();
   
    StatisticsTarget t1 = new StatisticsTarget();
    StatisticsTarget t2 = new StatisticsTarget();
   
    List<Target<?>> targets = Arrays.<Target<?>>asList(t1, t2);
    List<WorldModule> modules = Collections.<WorldModule>singletonList(new PowerModule());
   
    cf.createRepresentations(osmData, modules, null, targets);
   
    /* check whether the results are the same each time */
   
    for (Stat stat : Stat.values()) {
      assertEquals(t1.getGlobalCount(stat), t2.getGlobalCount(stat));
View Full Code Here


      CLIArgumentsGroup argumentsGroup)
    throws IOException {
   
    long start = System.currentTimeMillis();
   
    ConversionFacade cf = new ConversionFacade();
    PerformanceListener perfListener =
      new PerformanceListener(argumentsGroup.getRepresentative());
    cf.addProgressListener(perfListener);
       
    String interpolatorType = config.getString("terrainInterpolator");
    if ("ZeroInterpolator".equals(interpolatorType)) {
      cf.setTerrainEleInterpolatorFactory(
          new DefaultFactory<TerrainInterpolator>(ZeroInterpolator.class));
    } else if ("LeastSquaresInterpolator".equals(interpolatorType)) {
      cf.setTerrainEleInterpolatorFactory(
          new DefaultFactory<TerrainInterpolator>(LeastSquaresInterpolator.class));
    } else if ("NaturalNeighborInterpolator".equals(interpolatorType)) {
      cf.setTerrainEleInterpolatorFactory(
          new DefaultFactory<TerrainInterpolator>(NaturalNeighborInterpolator.class));
    }
   
    String enforcerType = config.getString("eleConstraintEnforcer");
    if ("NoneEleConstraintEnforcer".equals(enforcerType)) {
      cf.setEleConstraintEnforcerFactory(
          new DefaultFactory<EleConstraintEnforcer>(NoneEleConstraintEnforcer.class));
    } else if ("SimpleEleConstraintEnforcer".equals(enforcerType)) {
      cf.setEleConstraintEnforcerFactory(
          new DefaultFactory<EleConstraintEnforcer>(SimpleEleConstraintEnforcer.class));
    } else if ("LPEleConstraintEnforcer".equals(enforcerType)) {
      cf.setEleConstraintEnforcerFactory(
          new DefaultFactory<EleConstraintEnforcer>(LPEleConstraintEnforcer.class));
    }
   
    Results results = cf.createRepresentations(
        argumentsGroup.getRepresentative().getInput(), null, config, null);
   
    ImageExporter exporter = null;
   
    for (CLIArguments args : argumentsGroup.getCLIArgumentsList()) {
View Full Code Here

   
    try {
     
      this.osmFile = osmFile;
     
      ConversionFacade converter = new ConversionFacade();
      converter.setTerrainEleInterpolatorFactory(interpolatorFactory);
      converter.setEleConstraintEnforcerFactory(enforcerFactory);
     
      converter.addProgressListener(listener);
     
      if (failOnLargeBBox) {
        config.addProperty("maxBoundingBoxDegrees", 1);
      }
     
      conversionResults = converter.createRepresentations(
          osmFile, null, config, null);
     
    } catch (IOException e) {
     
      osmFile = null;
View Full Code Here

TOP

Related Classes of org.osm2world.core.ConversionFacade

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.