Exemplo n.º 1
0
 def test_publishShapefileToShapefile(self):
     """
     Test publishing a shapefile to another shapefile
     """
     f1 = os.path.join(self.testShpWorkspace, 'Airports.shp')
     loc = self.resultShpWorkspace
     f2 = 'Airport.shp'
     geopublisher.publish_data(f1, loc, f2)
     self.assertTrue(arcpy.Exists(os.path.join(loc, f2)))
Exemplo n.º 2
0
 def test_publishFgdbToShapefile(self):
     """
     Test publishing a feature class from File Geodatabase to Shapefile
     """
     f1 = os.path.join(self.testFgdb, 'Fire_Stations')
     loc = self.resultShpWorkspace
     f2 = 'Fire_Stations.shp'
     geopublisher.publish_data(f1, loc, f2)
     self.assertTrue(arcpy.Exists(os.path.join(loc, f2)))
Exemplo n.º 3
0
 def test_publishFgdbToFgdb(self):
     """
     Test publishing a feature class from a file geodatabase to
     another file geodatabase
     """
     f1 = os.path.join(self.testFgdb, 'Fire_Stations')
     loc = self.resultFgdb
     f2 = 'Fire_Stations'
     geopublisher.publish_data(f1, loc, f2)
     self.assertTrue(arcpy.Exists(os.path.join(loc, f2)))
Exemplo n.º 4
0
 def test_publishSdeToFgdb(self):
     """
     Test publishing a feature class from an enterprise geodatabase
     (SDE) to a file geodatabase.
     """
     f1 = os.path.join(self.testSde, 'Master_GISDATA.DBO.Roads',
                       'Master_GISDATA.DBO.MP_Markers_2008')
     loc = self.resultFgdb
     f2 = 'MP_Markers_2008'
     geopublisher.publish_data(f1, loc, f2)
     self.assertTrue(arcpy.Exists(os.path.join(loc, f2)))
Exemplo n.º 5
0
 def test_publishSdeToShapefile(self):
     """
     Test publishing a feature class from enterprise geodatabase (SDE) to
     Shapefile
     """
     f1 = os.path.join(self.testSde,
                       'Master_GISDATA.DBO.cadastral',
                       'Master_GISDATA.DBO.Plat_Boundaries')
     loc = self.resultShpWorkspace
     f2 = 'Plat_Boundaries.shp'
     geopublisher.publish_data(f1, loc, f2)
     self.assertTrue(arcpy.Exists(os.path.join(loc, f2)))
Exemplo n.º 6
0
 def test_publishShapefileToShapefileAndArchive(self):
     """
     Test publishing and archiving a shapefile to another shapefile
     """
     f1 = os.path.join(self.testShpWorkspace, 'bridges.shp')
     loc = self.resultShpWorkspace
     f2 = 'bridges.shp'
     zipFolder = self.archiveWorkspace
     zipFile = f2 + '_' + date.isoformat(datetime.now()) + '.zip'
     print(zipFolder, zipFile)
     geopublisher.publish_data(f1, loc, f2, zipFolder)
     self.assertTrue(arcpy.Exists(os.path.join(loc, f2)))
     self.assertTrue(zipfile.is_zipfile(os.path.join(zipFolder, zipFile)))
Exemplo n.º 7
0
 def test_publishFgdbToShapefileAndArchive(self):
     """
     Test publishing and archiving a feature class from File Geodatabase to
     Shapefile
     """
     f1 = os.path.join(self.testFgdb, 'NOAA_Shorelines')
     loc = self.resultShpWorkspace
     f2 = 'NOAA_Shorelines.shp'
     zipFolder = self.archiveWorkspace
     zipFile = f2 + '_' + date.isoformat(datetime.now()) + '.zip'
     print(zipFolder, zipFile)
     geopublisher.publish_data(f1, loc, f2, zipFolder)
     self.assertTrue(arcpy.Exists(os.path.join(loc, f2)))
     self.assertTrue(zipfile.is_zipfile(os.path.join(zipFolder, zipFile)))
Exemplo n.º 8
0
 def test_publishShapefileToFgdbAndArchive(self):
     """
     Test publishing and archiving a shapefile to a file
     geodatabase. The feature class is also archived as a
     shapefile
     """
     f1 = os.path.join(self.testShpWorkspace, 'bridges.shp')
     loc = self.resultFgdb
     f2 = 'bridges'
     zipFolder = self.archiveWorkspace
     zipFile = f2 + '_' + date.isoformat(datetime.now()) + '.zip'
     geopublisher.publish_data(f1, loc, f2, zipFolder)
     self.assertTrue(arcpy.Exists(os.path.join(loc, f2)))
     self.assertTrue(zipfile.is_zipfile(os.path.join(zipFolder, zipFile)))
Exemplo n.º 9
0
 def test_publishSdeToShapefileAndArchive(self):
     """
     Test publishing and archiving a feature class from enterprise
     geodatabase (SDE) to shapefile
     """
     f1 = os.path.join(self.testSde,
                       'Master_GISDATA.DBO.cadastral',
                       'Master_GISDATA.DBO.Parcel_Point')
     loc = self.resultShpWorkspace
     f2 = 'Parcel_point.shp'
     zipFolder = self.archiveWorkspace
     zipFile = f2 + '_' + date.isoformat(datetime.now()) + '.zip'
     print(zipFolder, zipFile)
     geopublisher.publish_data(f1, loc, f2, zipFolder)
     self.assertTrue(arcpy.Exists(os.path.join(loc, f2)))
     self.assertTrue(zipfile.is_zipfile(os.path.join(zipFolder, zipFile)))
Exemplo n.º 10
0
 def test_publishSdeToFdgbAndArchive(self):
     """
     Test publishing and archiving a feature class from an enterprise
     geodatabase (SDE) to a file geodatabase. The feature class is also
     archived as a shapefile
     """
     f1 = os.path.join(self.testSde, 'Master_GISDATA.DBO.Roads',
                       'Master_GISDATA.DBO.MP_Routes_2008')
     loc = self.resultFgdb
     f2 = 'MP_Routes_2008'
     zipFolder = self.archiveWorkspace
     zipFile = f2 + '_' + date.isoformat(datetime.now()) + '.zip'
     print(zipFolder, zipFile)
     geopublisher.publish_data(f1, loc, f2, zipFolder)
     self.assertTrue(arcpy.Exists(os.path.join(loc, f2)))
     self.assertTrue(zipfile.is_zipfile(os.path.join(zipFolder, zipFile)))