Skip to content

Commit 1ca29e1

Browse files
authored
Merge pull request #267 from map-of-pi/sync-pict-changes
Self approved; Copy over Docker/ BE version by PiCT Tate [Revisited]
2 parents 23d68a7 + 16194de commit 1ca29e1

File tree

3 files changed

+163
-3
lines changed

3 files changed

+163
-3
lines changed

src/models/enums/restrictedArea.ts

Lines changed: 42 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,8 @@ export enum RestrictedArea {
55
SYRIA = "Syria",
66
REPUBLIC_OF_CRIMEA = "Republic of Crimea",
77
DONETSK_OBLAST = "Donetsk Oblast",
8-
LUHANSK_OBLAST = "Luhansk Oblast"
8+
LUHANSK_OBLAST = "Luhansk Oblast",
9+
RUSSIA = "Russia"
910
}
1011

1112
export const RestrictedAreaBoundaries = {
@@ -80,4 +81,44 @@ export const RestrictedAreaBoundaries = {
8081
[37.7, 47.7],
8182
]],
8283
},
84+
[RestrictedArea.RUSSIA]: {
85+
type: "MultiPolygon", // Need multiple values because MongoDB gets confused with really large 2dsphere Polygons
86+
coordinates: [
87+
[[
88+
[27.3, 77.0],
89+
[27.3, 41.1],
90+
[69.1, 41.1],
91+
[69.1, 77.0],
92+
[27.3, 77.0],
93+
]],
94+
[[
95+
[69.1, 77.8],
96+
[69.1, 49.1],
97+
[114.0, 49.1],
98+
[114.0, 77.8],
99+
[69.1, 77.8],
100+
]],
101+
[[
102+
[114.0, 77.2],
103+
[114.0, 42.3],
104+
[180, 42.3],
105+
[180, 77.2],
106+
[114.0, 77.2],
107+
]],
108+
[[
109+
[-180.0, 62.0],
110+
[-170.0, 62.0],
111+
[-170.0, 72.0],
112+
[-180.0, 72.0],
113+
[-180.0, 62.0],
114+
]],
115+
[[
116+
[44.8, 81.9],
117+
[44.8, 77.9],
118+
[107.9, 77.9],
119+
[107.9, 81.9],
120+
[44.8, 81.9],
121+
]]
122+
],
123+
},
83124
};

src/models/misc/SanctionedRegion.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@ const sanctionedRegionSchema = new Schema<ISanctionedRegion>(
1111
required: true,
1212
},
1313
boundary: {
14-
type: { type: String, enum: ["Polygon"], required: true },
15-
coordinates: { type: [[[Number]]], required: true },
14+
type: { type: String, enum: ["Polygon", "MultiPolygon"], required: true },
15+
coordinates: { type: Array, required: true },
1616
}
1717
}
1818
);

test/mockData.json

Lines changed: 119 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -155,6 +155,38 @@
155155
"phone_number": "121-121-1212",
156156
"findme": "deviceGPS",
157157
"trust_meter_rating": 50
158+
},
159+
{
160+
"user_settings_id": "0m0m0m-0m0m-0m0m",
161+
"user_name": "Test Thirteen",
162+
"email": "[email protected]",
163+
"phone_number": "131-131-1313",
164+
"findme": "deviceGPS",
165+
"trust_meter_rating": 0
166+
},
167+
{
168+
"user_settings_id": "0n0n0n-0n0n-0n0n",
169+
"user_name": "Test Fourteen",
170+
"email": "[email protected]",
171+
"phone_number": "141-141-1414",
172+
"findme": "deviceGPS",
173+
"trust_meter_rating": 0
174+
},
175+
{
176+
"user_settings_id": "0o0o0o-0o0o-0o0o",
177+
"user_name": "Test Fifteen",
178+
"email": "[email protected]",
179+
"phone_number": "151-151-1515",
180+
"findme": "deviceGPS",
181+
"trust_meter_rating": 0
182+
},
183+
{
184+
"user_settings_id": "0p0p0p-0p0p-0p0p",
185+
"user_name": "Test Sixteen",
186+
"email": "[email protected]",
187+
"phone_number": "161-161-1616",
188+
"findme": "deviceGPS",
189+
"trust_meter_rating": 0
158190
}
159191
],
160192
"sellers": [
@@ -286,6 +318,50 @@
286318
"type": "Point",
287319
"coordinates": [39.9930, 49.5582]
288320
}
321+
},
322+
{
323+
"seller_id": "0m0m0m-0m0m-0m0m",
324+
"name": "Test Seller Sanctioned 13",
325+
"description": "Test Seller Sanctioned 13 Description",
326+
"address": "Sanctioned Region Russia West",
327+
"seller_type": "testSeller",
328+
"sell_map_center": {
329+
"type": "Point",
330+
"coordinates": [38.3174, 56.0084]
331+
}
332+
},
333+
{
334+
"seller_id": "0n0n0n-0n0n-0n0n",
335+
"name": "Test Seller Sanctioned 14",
336+
"description": "Test Seller Sanctioned 14 Description",
337+
"address": "Sanctioned Region Russia Central",
338+
"seller_type": "testSeller",
339+
"sell_map_center": {
340+
"type": "Point",
341+
"coordinates": [87.9806, 61.6986]
342+
}
343+
},
344+
{
345+
"seller_id": "0o0o0o-0o0o-0o0o",
346+
"name": "Test Seller Sanctioned 15",
347+
"description": "Test Seller Sanctioned 15 Description",
348+
"address": "Sanctioned Region Russia East",
349+
"seller_type": "testSeller",
350+
"sell_map_center": {
351+
"type": "Point",
352+
"coordinates": [-175.5260, 66.1756]
353+
}
354+
},
355+
{
356+
"seller_id": "0p0p0p-0p0p-0p0p",
357+
"name": "Test Seller Sanctioned 16",
358+
"description": "Test Seller Sanctioned 16 Description",
359+
"address": "Sanctioned Region Russia Polar",
360+
"seller_type": "testSeller",
361+
"sell_map_center": {
362+
"type": "Point",
363+
"coordinates": [60.753873, 80.534107]
364+
}
289365
}
290366
],
291367
"sellerItems": [
@@ -480,6 +556,49 @@
480556
[37.5, 47.0]
481557
]]
482558
}
559+
},
560+
{
561+
"location": "Russia",
562+
"boundary": {
563+
"type": "MultiPolygon",
564+
"coordinates": [
565+
[[
566+
[27.3, 77.0],
567+
[27.3, 41.1],
568+
[69.1, 41.1],
569+
[69.1, 77.0],
570+
[27.3, 77.0]
571+
]],
572+
[[
573+
[69.1, 77.8],
574+
[69.1, 49.1],
575+
[114.0, 49.1],
576+
[114.0, 77.8],
577+
[69.1, 77.8]
578+
]],
579+
[[
580+
[114.0, 77.2],
581+
[114.0, 42.3],
582+
[180, 42.3],
583+
[180, 77.2],
584+
[114.0, 77.2]
585+
]],
586+
[[
587+
[-180.0, 62.0],
588+
[-170.0, 62.0],
589+
[-170.0, 72.0],
590+
[-180.0, 72.0],
591+
[-180.0, 62.0]
592+
]],
593+
[[
594+
[44.8, 81.9],
595+
[44.8, 77.9],
596+
[107.9, 77.9],
597+
[107.9, 81.9],
598+
[44.8, 81.9]
599+
]]
600+
]
601+
}
483602
}
484603
],
485604
"toggle": [

0 commit comments

Comments
 (0)