コード例 #1
0
ファイル: dataset.py プロジェクト: NERC-CEH/ecomaps
    def create_coverage_dataset(self,name,wms_url,netcdf_url,low_res_url,
                                data_range_from, data_range_to, is_categorical):
        """
        Creates a coverage dataset in the EcoMaps DB
            @param name: Display name of the dataset
            @param wms_url: Endpoint for the mapping server
            @param netcdf_url: URL of the OpenDAP endpoint for this dataset
            @param low_res_url: URL for accessing the NetCDF file over the HTTP protocol
            @param data_range_from: Low range for the data
            @param data_range_to: High range for the data
            @param is_categorical: Set to true if the data is categorical (not continuous)
        """
        with self.transaction_scope() as session:

            dataset_type = session.query(DatasetType).filter(DatasetType.type=='Coverage').one()

            dataset = Dataset()
            dataset.name = name
            dataset.dataset_type = dataset_type
            dataset.netcdf_url = netcdf_url
            dataset.wms_url = wms_url
            dataset.low_res_url = low_res_url
            dataset.data_range_from = data_range_from
            dataset.data_range_to  = data_range_to
            dataset.is_categorical = is_categorical

            session.add(dataset)