commit
e2f031d90e
5 changed files with 14 additions and 4 deletions
|
@ -18,7 +18,10 @@ class ApiGeo::RPGAdapter
|
||||||
:code_culture,
|
:code_culture,
|
||||||
:surface,
|
:surface,
|
||||||
:bio
|
:bio
|
||||||
).merge({ geometry: feature[:geometry] })
|
).merge({
|
||||||
|
geometry: feature[:geometry],
|
||||||
|
geo_reference_id: feature[:properties][:id]
|
||||||
|
})
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
class GeoAreaSerializer < ActiveModel::Serializer
|
class GeoAreaSerializer < ActiveModel::Serializer
|
||||||
attributes :geometry, :source
|
attributes :geometry, :source, :geo_reference_id
|
||||||
|
|
||||||
attribute :surface_intersection, if: :include_cadastre?
|
attribute :surface_intersection, if: :include_cadastre?
|
||||||
attribute :surface_parcelle, if: :include_cadastre?
|
attribute :surface_parcelle, if: :include_cadastre?
|
||||||
|
|
5
db/migrate/20181030103913_add_geo_id_to_geo_areas.rb
Normal file
5
db/migrate/20181030103913_add_geo_id_to_geo_areas.rb
Normal file
|
@ -0,0 +1,5 @@
|
||||||
|
class AddGeoIdToGeoAreas < ActiveRecord::Migration[5.2]
|
||||||
|
def change
|
||||||
|
add_column :geo_areas, :geo_reference_id, :string
|
||||||
|
end
|
||||||
|
end
|
|
@ -10,7 +10,7 @@
|
||||||
#
|
#
|
||||||
# It's strongly recommended that you check this file into your version control system.
|
# It's strongly recommended that you check this file into your version control system.
|
||||||
|
|
||||||
ActiveRecord::Schema.define(version: 2018_10_10_183331) do
|
ActiveRecord::Schema.define(version: 2018_10_30_103913) do
|
||||||
|
|
||||||
# These are extensions that must be enabled in order to support this database
|
# These are extensions that must be enabled in order to support this database
|
||||||
enable_extension "plpgsql"
|
enable_extension "plpgsql"
|
||||||
|
@ -347,6 +347,7 @@ ActiveRecord::Schema.define(version: 2018_10_10_183331) do
|
||||||
t.jsonb "geometry"
|
t.jsonb "geometry"
|
||||||
t.jsonb "properties"
|
t.jsonb "properties"
|
||||||
t.bigint "champ_id"
|
t.bigint "champ_id"
|
||||||
|
t.string "geo_reference_id"
|
||||||
t.index ["champ_id"], name: "index_geo_areas_on_champ_id"
|
t.index ["champ_id"], name: "index_geo_areas_on_champ_id"
|
||||||
t.index ["source"], name: "index_geo_areas_on_source"
|
t.index ["source"], name: "index_geo_areas_on_source"
|
||||||
end
|
end
|
||||||
|
|
|
@ -53,7 +53,8 @@ describe ApiGeo::RPGAdapter do
|
||||||
:code_culture,
|
:code_culture,
|
||||||
:surface,
|
:surface,
|
||||||
:bio,
|
:bio,
|
||||||
:geometry
|
:geometry,
|
||||||
|
:geo_reference_id
|
||||||
])
|
])
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in a new issue