2018-10-22 19:27:52 +02:00
|
|
|
FactoryBot.define do
|
|
|
|
factory :geo_area do
|
2020-07-20 16:50:12 +02:00
|
|
|
association :champ
|
2021-05-06 18:50:06 +02:00
|
|
|
properties { {} }
|
2020-07-20 16:50:12 +02:00
|
|
|
|
2020-04-30 15:49:43 +02:00
|
|
|
trait :cadastre do
|
|
|
|
source { GeoArea.sources.fetch(:cadastre) }
|
2022-08-31 13:09:00 +02:00
|
|
|
properties { { numero: '42', section: 'A11', prefixe: '000', commune: '75127', contenance: 123, id: '75127000A1142' } }
|
2021-05-13 12:46:42 +02:00
|
|
|
end
|
|
|
|
|
|
|
|
trait :legacy_cadastre do
|
|
|
|
source { GeoArea.sources.fetch(:cadastre) }
|
|
|
|
properties { { numero: '42', section: 'A11', code_com: '127', code_dep: '75', code_arr: '000', surface_parcelle: '1234', surface_intersection: 1234 } }
|
2018-10-23 15:40:39 +02:00
|
|
|
end
|
2018-12-19 11:09:13 +01:00
|
|
|
|
|
|
|
trait :selection_utilisateur do
|
|
|
|
source { GeoArea.sources.fetch(:selection_utilisateur) }
|
|
|
|
end
|
2020-04-30 15:49:43 +02:00
|
|
|
|
|
|
|
trait :polygon do
|
|
|
|
geometry do
|
|
|
|
{
|
|
|
|
"type": "Polygon",
|
|
|
|
"coordinates": [
|
|
|
|
[
|
|
|
|
[2.428439855575562, 46.538476837725796],
|
|
|
|
[2.4284291267395024, 46.53842148758162],
|
|
|
|
[2.4282521009445195, 46.53841410755813],
|
|
|
|
[2.42824137210846, 46.53847314771794],
|
|
|
|
[2.428284287452698, 46.53847314771794],
|
|
|
|
[2.428364753723145, 46.538487907747864],
|
|
|
|
[2.4284291267395024, 46.538491597754714],
|
|
|
|
[2.428439855575562, 46.538476837725796]
|
|
|
|
]
|
|
|
|
]
|
|
|
|
}
|
|
|
|
end
|
|
|
|
end
|
2020-05-05 10:26:13 +02:00
|
|
|
|
2020-09-23 14:37:07 +02:00
|
|
|
trait :hourglass_polygon do
|
|
|
|
geometry do
|
|
|
|
{
|
|
|
|
"type": "Polygon",
|
|
|
|
"coordinates": [
|
|
|
|
[
|
|
|
|
[2.4282997263522077, 46.53823812531846],
|
|
|
|
[2.4283969564289976, 46.53823259028192],
|
|
|
|
[2.4283701343391897, 46.53816063476029],
|
|
|
|
[2.4284807754604003, 46.53817078233945],
|
|
|
|
[2.4284921748487136, 46.53822105895472],
|
|
|
|
[2.428447247847828, 46.53820214757286],
|
|
|
|
[2.4282997263522077, 46.53823812531846]
|
|
|
|
]
|
|
|
|
]
|
|
|
|
}
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
2021-03-16 10:38:56 +01:00
|
|
|
trait :invalid_right_hand_rule_polygon do
|
|
|
|
geometry do
|
|
|
|
{
|
|
|
|
"type": "Polygon",
|
|
|
|
"coordinates": [
|
|
|
|
[
|
|
|
|
[1.9116157293319704, 49.758172033960115],
|
|
|
|
[1.9116157293319704, 49.758172033960115],
|
|
|
|
[1.91162645816803, 49.75818243044436],
|
|
|
|
[1.9116157293319704, 49.758172033960115]
|
|
|
|
]
|
|
|
|
]
|
|
|
|
}
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
2020-10-08 16:02:52 +02:00
|
|
|
trait :polygon_with_extra_coordinate do
|
|
|
|
geometry do
|
|
|
|
{
|
|
|
|
"type": "Polygon",
|
|
|
|
"coordinates": [
|
|
|
|
[
|
|
|
|
[2.428439855575562, 46.538476837725796, 0],
|
|
|
|
[2.4284291267395024, 46.53842148758162, 0],
|
|
|
|
[2.4282521009445195, 46.53841410755813, 0],
|
|
|
|
[2.42824137210846, 46.53847314771794, 0],
|
|
|
|
[2.428284287452698, 46.53847314771794, 0],
|
|
|
|
[2.428364753723145, 46.538487907747864, 0],
|
|
|
|
[2.4284291267395024, 46.538491597754714, 0],
|
|
|
|
[2.428439855575562, 46.538476837725796, 0]
|
|
|
|
]
|
|
|
|
]
|
|
|
|
}
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
2020-05-05 10:26:13 +02:00
|
|
|
trait :line_string do
|
|
|
|
geometry do
|
|
|
|
{
|
|
|
|
"type": "LineString",
|
|
|
|
"coordinates": [
|
|
|
|
[2.4282521009445195, 46.53841410755813],
|
|
|
|
[2.42824137210846, 46.53847314771794],
|
|
|
|
[2.428284287452698, 46.53847314771794],
|
|
|
|
[2.4284291267395024, 46.538491597754714]
|
|
|
|
]
|
|
|
|
}
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
trait :point do
|
|
|
|
geometry do
|
|
|
|
{
|
|
|
|
"type": "Point",
|
|
|
|
"coordinates": [2.428439855575562, 46.538476837725796]
|
|
|
|
}
|
|
|
|
end
|
|
|
|
end
|
2020-04-30 16:59:38 +02:00
|
|
|
|
|
|
|
trait :multi_polygon do
|
|
|
|
geometry do
|
|
|
|
{
|
|
|
|
"type": "MultiPolygon",
|
|
|
|
"coordinates": [
|
|
|
|
[
|
|
|
|
[
|
|
|
|
[2.428439855575562, 46.538476837725796],
|
|
|
|
[2.4284291267395024, 46.53842148758162],
|
|
|
|
[2.4282521009445195, 46.53841410755813],
|
|
|
|
[2.42824137210846, 46.53847314771794],
|
|
|
|
[2.428284287452698, 46.53847314771794],
|
|
|
|
[2.428364753723145, 46.538487907747864],
|
|
|
|
[2.4284291267395024, 46.538491597754714],
|
|
|
|
[2.428439855575562, 46.538476837725796]
|
|
|
|
]
|
|
|
|
]
|
|
|
|
]
|
|
|
|
}
|
|
|
|
end
|
|
|
|
end
|
2018-10-22 19:27:52 +02:00
|
|
|
end
|
|
|
|
end
|