Package org.osm2world.core.osm.creation

Examples of org.osm2world.core.osm.creation.OsmosisReader


    } else {
     
      /* try to read file using Osmosis */
     
      try {
        osmData = new OsmosisReader(osmFile).getData();
      } catch (IOException e) {
       
        System.out.println("could not read file," +
            " trying workaround for files created by JOSM");
       
        useJOSMHack = true;
             
      }
     
    }
   
    /* create a temporary "cleaned up" file as workaround for JOSM files */
   
    if (useJOSMHack) {
     
      File tempFile;
      try {
        tempFile = JOSMFileHack.createTempOSMFile(osmFile);
      } catch (Exception e2) {
        throw new IOException("could not read OSM file" +
            " (not even with workaround for JOSM files)", e2);
      }
     
      osmData = new OsmosisReader(tempFile).getData();
     
    }
   
    return createRepresentations(osmData, worldModules, config, targets);
   
View Full Code Here


  @Test
  public void testValidFile() throws IOException {
   
    File testFile = new File("test"+File.separator+"files"
        +File.separator+"validFile.osm");
    OSMData osmData = new OsmosisReader(testFile).getData();
   
    assertSame(4, osmData.getNodes().size());
    assertSame(1, osmData.getWays().size());
    assertSame(1, osmData.getRelations().size());
   
View Full Code Here

  private static MapData loadMapData(String filename) throws IOException {
   
    File testFile = new File("test"+File.separator+"files"
        +File.separator+filename);
   
    OSMData osmData = new OsmosisReader(testFile).getData();
    OriginMapProjection mapProjection = new MetricMapProjection();
    mapProjection.setOrigin(osmData);
   
    return new OSMToMapDataConverter(mapProjection).createMapData(osmData);
   
View Full Code Here

    /* create map data */
   
    File testFile = new File("test"+File.separator+"files"
        +File.separator+filename);
   
    OSMData osmData = new OsmosisReader(testFile).getData();
    OriginMapProjection mapProjection = new MetricMapProjection();
    mapProjection.setOrigin(osmData);
   
    OSMToMapDataConverter converter = new OSMToMapDataConverter(mapProjection);
    MapData mapData = converter.createMapData(osmData);
View Full Code Here

TOP

Related Classes of org.osm2world.core.osm.creation.OsmosisReader

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.