# Ticket #198 (new bug report)

Opened 9 months ago

## critical bug in compute_alpha_shape

Reported by: | stefanzweig | Owned by: | somebody |
---|---|---|---|

Priority: | major | Milestone: | Version 1.1 |

Component: | DrivingDistance | Version: | trunk |

Keywords: | Cc: |

### Description

by today i had time to figure out the reason for http://pgrouting.postlbs.org/ticket/153 ("Crash with points_as_polygon()")

the problem is on line 248 in file /extra/driving_distance/src/alpha.c: if (total_tuples < 2)

this should be instead if (total_tuples < 3)

or even better: if (total_tuples == 0) {

elog(ERROR, "Distance is too short. no vertex for alpha shape calculation. alpha shape calculation needs at least 3 vertices.");

} if (total_tuples == 1) {

elog(ERROR, "Distance is too short. only 1 vertex for alpha shape calculation. alpha shape calculation needs at least 3 vertices.");

} if (total_tuples == 2) {

elog(ERROR, "Distance is too short. only 2 vertices for alpha shape calculation. alpha shape calculation needs at least 3 vertices.");

} if (total_tuples < 3) {

// elog(ERROR, "Distance is too short ...."); return finish(SPIcode, ret);

}

the alpha_shape method of cgal crashes in case only 2 vertices are given to it. it needs at least 3 vertices to run properly.

confer as well to attached alpha.c file

regards, stefan

## Attachments

## Change History

**Note:**See TracTickets for help on using tickets.