def testOsmImport(self): repoPath = self.getTempRepoPath() repo = Repository(repoPath, init = True) osmfile = os.path.join(os.path.dirname(__file__), "data", "osm", "ways.xml") repo.importosm(osmfile) feature = Feature(repo, geogit.WORK_HEAD, "way/31045880") self.assertTrue(feature.exists())
def testOsmImportWithMappingFile(self): repoPath = self.getTempRepoPath() repo = Repository(repoPath, init = True) osmfile = os.path.join(os.path.dirname(__file__), "data", "osm", "ways.xml") mappingfile = os.path.join(os.path.dirname(__file__), "data", "osm", "mapping.json") repo.importosm(osmfile, False, mappingfile) feature = Feature(repo, geogit.WORK_HEAD, "onewaystreets/31045880") self.assertTrue(feature.exists())
def testOsmImportWithMapping(self): mapping = OSMMapping() rule = OSMMappingRule("onewaystreets") rule.addfilter("oneway", "yes") rule.addfield("lit", "lit", geogit.TYPE_STRING) rule.addfield("geom", "the_geom", geogit.TYPE_LINESTRING) mapping.addrule(rule) repoPath = self.getTempRepoPath() repo = Repository(repoPath, init = True) osmfile = os.path.join(os.path.dirname(__file__), "data", "osm", "ways.xml") repo.importosm(osmfile, False, mapping) feature = Feature(repo, geogit.WORK_HEAD, "onewaystreets/31045880") self.assertTrue(feature.exists())