fpdcc / ccfp-asset-dashboard

CCFP Asset Dashboard
0 stars 1 forks source link

Increase efficiency of GIS API calls #104

Open smcalilly opened 2 years ago

smcalilly commented 2 years ago

@smcalilly Can you open an issue for increasing efficiency of these API calls? I don't think the ORM has a way to bulk transform a geometry column, but we could maybe use raw SQL and st_transform to add a transformed field to our queryset in one quick PostGIS query.

_Originally posted by @hancush in https://github.com/fpdcc/ccfp-asset-dashboard/pull/93#discussion_r789008302_

smcalilly commented 2 years ago

Adding to this discussion more inefficiencies.

The signals that calculate the zone distribution, geographic distance scoring, and socioeconomic distance scoring add more overhead. It would be good to make this as efficient as possible, because it currently makes a lot of database calls for each geojson feature within a feature collection.