Example #1
0
 def test_extract_bbox(self, name=None, bbox=None):
     name = name or 'test'
     bbox = bbox or TEST_BBOX
     d = tempfile.mkdtemp()
     p = planet.PlanetBase(TESTFILE)
     outfile = os.path.join(d, '%s.osm.pbf' % name)
     p.extract_bbox(name, bbox, outpath=d)
     self.assertTrue(os.path.exists(outfile))
     p2 = planet.PlanetBase(outfile)
     self.assertEquals(p2.get_timestamp(), TESTFILE_TIMESTAMP)
     os.unlink(outfile)
     os.rmdir(d)
Example #2
0
 def test_osmosis(self):
     p = planet.PlanetBase(TESTFILE)
     output = p.osmosis(
         '--read-pbf', TESTFILE,
         '--tf', 'accept-ways', 'highway=pedestrian',
         '--write-xml','-'
     )
     self.assertTrue(output.count('way id=') > 0)
Example #3
0
 def test_get_timestamp(self):
     p = planet.PlanetBase(TESTFILE)
     self.assertEquals(p.get_timestamp(), TESTFILE_TIMESTAMP)
Example #4
0
 def test_osmconvert(self):
     p = planet.PlanetBase(TESTFILE)
     output = p.osmconvert(p.osmpath, '--out-statistics')
     self.assertIn('timestamp min:', output)