perf(carto): use json schema to validate geojson instead of rgeo
This commit is contained in:
parent
3d3b90c4fb
commit
c4432b1b47
11 changed files with 1312 additions and 99 deletions
|
@ -1,11 +0,0 @@
|
|||
class Migrations::NormalizeGeoAreaJob < ApplicationJob
|
||||
def perform(ids)
|
||||
GeoArea.where(id: ids).find_each do |geo_area|
|
||||
geojson = RGeo::GeoJSON.decode(geo_area.geometry.to_json, geo_factory: RGeo::Geographic.simple_mercator_factory)
|
||||
geometry = RGeo::GeoJSON.encode(geojson)
|
||||
geo_area.update_column(:geometry, geometry)
|
||||
rescue RGeo::Error::InvalidGeometry
|
||||
geo_area.destroy
|
||||
end
|
||||
end
|
||||
end
|
Loading…
Add table
Add a link
Reference in a new issue