demarches-normaliennes/app/services/module_api_carto_service.rb
2018-11-27 16:11:25 +01:00

25 lines
689 B
Ruby

class ModuleApiCartoService
def self.generate_qp(coordinates)
coordinates.flat_map do |coordinate|
ApiCarto::QuartiersPrioritairesAdapter.new(
coordinate.map { |element| [element['lng'], element['lat']] }
).results
end
end
def self.generate_cadastre(coordinates)
coordinates.flat_map do |coordinate|
ApiCarto::CadastreAdapter.new(
coordinate.map { |element| [element['lng'], element['lat']] }
).results
end
end
def self.generate_rpg(coordinates)
coordinates.flat_map do |coordinate|
ApiGeo::RPGAdapter.new(
coordinate.map { |element| [element['lng'], element['lat']] }
).results
end
end
end