feat(export): add GeoJSON export

This commit is contained in:
Paul Chavard 2022-11-16 11:50:19 +01:00
parent d70db8cc05
commit 0c0618aa79
13 changed files with 91 additions and 34 deletions

View file

@ -1144,6 +1144,13 @@ class Dossier < ApplicationRecord
}
end
def self.to_feature_collection
{
type: 'FeatureCollection',
features: GeoArea.joins(:champ).where(champ: { dossier: ids }).map(&:to_feature)
}
end
def log_api_entreprise_job_exception(exception)
exceptions = self.api_entreprise_job_exceptions ||= []
exceptions << exception.inspect