demarches-normaliennes/app/services/api_carto_service.rb
Pierre de La Morinerie 150ddab660 zeitwerk: Api -> API
2021-02-09 13:07:30 +01:00

25 lines
683 B
Ruby

class APICartoService
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