Exemple #1
0
    def delete_and_append(self):

        logging.info('Starting delete and append for {0}'.format(self.name))
        arcpy.DeleteRows_management(self.esri_service_output)
        arcpy.Append_management(self.source, self.esri_service_output)

        logging.info('restarting service for {0}'.format(self.name))
        service_dict = {'gran_chaco_deforestation': 'forest_change'}
        service_name = service_dict[self.name]

        service = service_name

        for i in range(0, 2):
            arcgis_server.set_service_status(service, 'stop')
            arcgis_server.set_service_status(service, 'start')
Exemple #2
0
    def delete_and_append(self):

        logging.info('Starting delete and append for {0}'.format(self.name))
        arcpy.DeleteRows_management(self.esri_service_output)
        arcpy.Append_management(self.source, self.esri_service_output)

        logging.info('restarting service for {0}'.format(self.name))
        service_dict = {'gran_chaco_deforestation': 'forest_change'}
        service_name = service_dict[self.name]

        service = service_name

        for i in range(0, 2):
            arcgis_server.set_service_status(service, 'stop')
            arcgis_server.set_service_status(service, 'start')
    def update_image_service(self):
        arcpy.env.overwriteOutput = True

        logging.debug("running update_image_service")
        # Copy downloaded data to R drive
        self.copy_to_esri_output_multiple()

        # Calculate stats on files and mosaics
        self.calculate_stats()

        # Will update two GFW image services
        # http://gis-gfw.wri.org/arcgis/rest/services/image_services/glad_alerts_analysis/ImageServer
        # http://gis-gfw.wri.org/arcgis/rest/services/image_services/glad_alerts_con_analysis/ImageServer
        service_dict = {'umd_landsat_alerts': 'glad_alerts_analysis', 'terrai': 'terrai_analysis'}
        service_name = service_dict[self.name]

        service = r'image_services/{0}'.format(service_name)

        for i in range(0, 2):
            arcgis_server.set_service_status(service, 'stop')
            arcgis_server.set_service_status(service, 'start')