def getPointsCountyGeoJSON(county_name, year): (manure, msw, crop, manure_nonpoints, proc_nonpoints, manure_cols, cols_msw, cols_crp, cols_manure_nonpts, cols_proc_nonpts) = getBiomassInSelectCounty( county_name, counties_df, biomass_pts, msw_CBGcntrd_pts, crp2016_pts, crp2020_pts, crp2050_pts, manure_nonpts, proc_nonpts, year) return { 'manure_pts': gpd_to_geojson(manure, manure_cols), 'msw_pts': gpd_to_geojson(msw, cols_msw), 'crp_pts': gpd_to_geojson(crop, cols_crp), 'manure_nonpts': gpd_to_geojson(manure_nonpoints, cols_manure_nonpts), 'proc_nonpts': gpd_to_geojson(proc_nonpoints, cols_proc_nonpts) }
def getPROCwithScale(): left_bottom_lon = float(request.args.get('left_bottom_lon')) left_bottom_lat = float(request.args.get('left_bottom_lat')) right_top_lon = float(request.args.get('right_top_lon')) right_top_lat = float(request.args.get('right_top_lat')) pointlist = [[left_bottom_lon, left_bottom_lat], [left_bottom_lon, right_top_lat], [right_top_lon, right_top_lat], [right_top_lon, left_bottom_lat]] points_in_frame = getPointsInFrame(pointlist, PROC_ZC_pts) cluster_centers = getPointsWithScale(points_in_frame) cluster_centers['Type'] = 'PROC' return flask.jsonify({ 'PROC': gpd_to_geojson(cluster_centers, ['number_of_points', 'Type', 'AVG_PH', 'AVG_PC']), 'DES_CBG': gpd_to_geojson(DES_CBG_pts, cols_DES_CBG_pts) })
def getPointsBufferGeoJSON(lat, lng, buffer_m, year, moisture, energy_type, content, potential): biomass, msw, crp, total_biomass, total_biomass_wt = getBiomassInBuffer( (lng, lat), buffer_m, biomass_pts, msw_CBGcntrd_pts, crp2016_pts, crp2020_pts, crp2050_pts, year, moisture, energy_type, content, potential) cols_msw = list(msw.columns.values) cols_msw.remove('geometry') cols_crop = list(crp.columns.values) cols_crop.remove('geometry') cols_manure = list(biomass.columns.values) cols_manure.remove('geometry') return { 'manure': gpd_to_geojson(biomass, cols_manure), 'msw': gpd_to_geojson(msw, cols_msw), 'crop': gpd_to_geojson(crp, cols_crop), 'total_biomass': total_biomass, 'total_biomass_wt': total_biomass_wt }
def getPoints(): return flask.jsonify({ 'AD': gpd_to_geojson(AD_pts, cols_AD_pts), 'COMB': gpd_to_geojson(COMB_pts, cols_COMB_pts), 'W2E': gpd_to_geojson(W2E_pts, cols_W2E_pts), })
def getCounties(): return flask.jsonify({ 'biomass': gpd_to_geojson(counties_df, cols_counties), 'thermal': gpd_to_geojson(thermal, cols_thermal) })