예제 #1
0
 def testRemoveFeature(self):
     repo = self.getClonedRepo()        
     repo.removefeatures(["parks/1"])
     f = Feature(repo, geogig.WORK_HEAD, "parks/1")
     self.assertFalse(f.exists())
     f = Feature(repo, geogig.STAGE_HEAD, "parks/1")
     self.assertFalse(f.exists()) 
예제 #2
0
 def testRemoveFeature(self):
     repo = self.getClonedRepo()        
     repo.removefeatures(["parks/1"])
     f = Feature(repo, geogig.WORK_HEAD, "parks/1")
     self.assertFalse(f.exists())
     f = Feature(repo, geogig.STAGE_HEAD, "parks/1")
     self.assertFalse(f.exists()) 
예제 #3
0
 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, geogig.WORK_HEAD, "way/31045880")
     self.assertTrue(feature.exists())
예제 #4
0
 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, geogig.WORK_HEAD, "way/31045880")
     self.assertTrue(feature.exists())
예제 #5
0
 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, geogig.WORK_HEAD, "onewaystreets/31045880")
     self.assertTrue(feature.exists())
예제 #6
0
 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, geogig.WORK_HEAD, "onewaystreets/31045880")
     self.assertTrue(feature.exists())
예제 #7
0
 def testOsmImportWithMapping(self):
     mapping = OSMMapping()
     rule = OSMMappingRule("onewaystreets")
     rule.addfilter("oneway", "yes")
     rule.addfield("lit", "lit", geogig.TYPE_STRING)
     rule.addfield("geom", "the_geom", geogig.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, geogig.WORK_HEAD, "onewaystreets/31045880")
     self.assertTrue(feature.exists())
예제 #8
0
 def testOsmImportWithMapping(self):
     mapping = OSMMapping()
     rule = OSMMappingRule("onewaystreets")
     rule.addfilter("oneway", "yes")
     rule.addfield("lit", "lit", geogig.TYPE_STRING)
     rule.addfield("geom", "the_geom", geogig.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, geogig.WORK_HEAD, "onewaystreets/31045880")
     self.assertTrue(feature.exists())
예제 #9
0
 def testExists(self):
     feature = Feature(self.repo, geogig.HEAD, "parks/1")                    
     self.assertTrue(feature.exists())
     feature = Feature(self.repo, geogig.HEAD, "wrong/path")                    
     self.assertFalse(feature.exists())
예제 #10
0
 def testExists(self):
     feature = Feature(self.repo, geogig.HEAD, "parks/1")
     self.assertTrue(feature.exists())
     feature = Feature(self.repo, geogig.HEAD, "wrong/path")
     self.assertFalse(feature.exists())