--- ./service.c 2013-07-02 17:36:27.864475674 +0200
+++ ./service.c 2013-09-10 15:40:53.717038816 +0200
@@ -233,9 +233,9 @@
       if (const K::Segment_2 *tmp=CGAL::object_cast<K::Segment_2>(&o)) {
        const K::Point_2 p1=tmp->source();
        const K::Point_2 p2=tmp->target();
-#ifdef DEBUG
+//#ifdef DEBUG
        fprintf(stderr,"P1 %d %d | P2 %d %d\n",p1.x(),p1.y(),p2.x(),p2.y());
-#endif
+//#endif
        OGRFeatureH hFeature = OGR_F_Create( OGR_L_GetLayerDefn( poDstLayer ) );
        OGRGeometryH currLine=OGR_G_CreateGeometry(wkbLineString);
        OGR_G_AddPoint_2D(currLine,p1.x(),p1.y());
@@ -249,7 +249,23 @@
        OGR_F_Destroy( hFeature );
        ++ns ;
       }
-      else if (CGAL::object_cast<K::Ray_2>(&o)) {++nr;}
+      else if (const K::Ray_2 *tmp=CGAL::object_cast<K::Ray_2>(&o)) {
+        const K::Point_2 p1=tmp->source();
+       const K::Point_2 p2=tmp->point(100);
+       OGRFeatureH hFeature = OGR_F_Create( OGR_L_GetLayerDefn( poDstLayer ) );
+       OGRGeometryH currLine=OGR_G_CreateGeometry(wkbLineString);
+       OGR_G_AddPoint_2D(currLine,p1.x(),p1.y());
+       OGR_G_AddPoint_2D(currLine,p2.x(),p2.y());
+       OGR_F_SetGeometry( hFeature, currLine ); 
+       OGR_G_DestroyGeometry(currLine);
+       if( OGR_L_CreateFeature( poDstLayer, hFeature ) != OGRERR_NONE ){
+         setMapInMaps(conf,"lenv","message","Failed to create feature in file.\n");
+         return SERVICE_FAILED;
+       }
+       OGR_F_Destroy( hFeature );
+       ++nr;
+       fprintf(stderr,"Edge as a ray: P1 %d %d | P2 %d %d \n",p1.x(),p1.y(),p2.x(),p2.y());
+       }
     }
     OGR_DS_Destroy( poODS );
     OGRCleanupAll();
