 ;
 
 
-
-
 /* Spatial Index to Improve the Performance */
 
 CREATE INDEX "idx-poimplist-geom"
   ON poimplist
   USING gist
   (geom);
-
-
-
-
-
-
 
 /* The following Function does the clustering of the POImps.
 --------------------------------------------------------------

DROP TABLE IF EXISTS roadsnodesinorder;

CREATE TEMPORARY TABLE roadsnodesinorder AS

SELECT roadslist.road_id, node_num AS rn, node_id, (node_num = 1 OR node_num = nodes.count) AS is_endpoint
FROM roadslist


/* Find nodes that are part of 2 roads, first and/or last items of both roads, and mode related deadends.
*/

/* RKM: What does this add on top of the previous query?? */

/* Joonas: This query is faulty, because the last WHERE expression is never true, because nofroads=nofmotorcar=nofbicycle=noffoot=nofrail (see subquery for the reason) */
INSERT INTO poimplist
