@@ -213,6 +213,43 @@ void testLinkStopNearPlatformVertex() {
213
213
assertEquals (10 , graph .getEdges ().size ());
214
214
}
215
215
216
+ /**
217
+ * Link an interior vertex which is very close to a visibility vertex by
218
+ * calling directly addPermanentAreaVertex used in boarding location linking
219
+ * A connecting edge pair is created despite of the small distance
220
+ */
221
+ @ Test
222
+ void testAddPermanentAreaVertex () {
223
+ Coordinate [] platform = {
224
+ new Coordinate (10 , 60.002 ),
225
+ new Coordinate (10.004 , 60.002 ),
226
+ new Coordinate (10.004 , 60 ),
227
+ new Coordinate (10 , 60 ),
228
+ };
229
+ // add one entrance to bottom left corner
230
+ int [] visibilityPoints = { 3 };
231
+
232
+ // No stops
233
+ Coordinate [] stops = {};
234
+
235
+ Graph graph = prepareTest (platform , visibilityPoints , stops );
236
+
237
+ // dig up the AreaGroup
238
+ AreaGroup ag = null ;
239
+ var edge = graph .getEdges ().stream ().findFirst ().get ();
240
+ if (edge instanceof AreaEdge ae ) {
241
+ ag = ae .getArea ();
242
+ }
243
+ assertNotNull (ag );
244
+
245
+ var vertexFactory = new VertexFactory (graph );
246
+ var v = vertexFactory .intersection ("boardingLocation" , 10.00000001 , 60.00000001 );
247
+ graph .getLinker ().addPermanentAreaVertex (v , ag );
248
+
249
+ // vertex links to the single visibility point with 2 edges
250
+ assertEquals (10 , graph .getEdges ().size ());
251
+ }
252
+
216
253
/**
217
254
* Link a stop which is inside an area and very close to its edge.
218
255
* Linking snaps directly to the edge without short connecting edges
0 commit comments