demarches-normaliennes/app/services/api_carto_service.rb

26 lines
683 B
Ruby
Raw Normal View History

class ApiCartoService
def self.generate_qp(coordinates)
coordinates.flat_map do |coordinate|
ApiCarto::QuartiersPrioritairesAdapter.new(
coordinate.map { |element| [element['lng'], element['lat']] }
2018-10-15 16:25:16 +02:00
).results
end
end
def self.generate_cadastre(coordinates)
2018-01-15 21:33:29 +01:00
coordinates.flat_map do |coordinate|
ApiCarto::CadastreAdapter.new(
coordinate.map { |element| [element['lng'], element['lat']] }
2018-10-15 16:25:16 +02:00
).results
2018-01-15 21:33:29 +01:00
end
end
2018-10-23 15:37:13 +02:00
def self.generate_rpg(coordinates)
coordinates.flat_map do |coordinate|
ApiGeo::RPGAdapter.new(
coordinate.map { |element| [element['lng'], element['lat']] }
).results
end
end
end