2015-11-23 18:41:48 +01:00
|
|
|
class GeojsonService
|
2016-01-15 11:53:00 +01:00
|
|
|
def self.to_json_polygon_for_qp coordinates
|
2015-11-25 10:26:55 +01:00
|
|
|
polygon = {
|
2015-11-23 18:41:48 +01:00
|
|
|
geo: {
|
|
|
|
type: "Polygon",
|
|
|
|
coordinates: [coordinates]
|
|
|
|
}
|
|
|
|
}
|
2015-11-25 10:26:55 +01:00
|
|
|
|
|
|
|
polygon.to_json
|
2015-11-23 18:41:48 +01:00
|
|
|
end
|
2016-01-15 11:53:00 +01:00
|
|
|
|
|
|
|
def self.to_json_polygon_for_cadastre coordinates
|
|
|
|
|
|
|
|
polygon = {
|
|
|
|
geom: {
|
|
|
|
type: "Feature",
|
|
|
|
geometry: {
|
|
|
|
type: "Polygon",
|
|
|
|
coordinates: [
|
|
|
|
coordinates
|
|
|
|
]
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
polygon.to_json
|
|
|
|
end
|
2015-11-23 18:41:48 +01:00
|
|
|
end
|