Fix GEOS Intersection error when dealing with malformed ways
Fix GEOS Intersection error when dealing with malformed ways

In concerned SQL queries this patch apply a 0-buffer to malformed ways.
As malformed ways seem pretty uncommon and as this operation is heavy
for performance issue the query is first run without the 0-buffer and
is re-run with it if the query fails.

With PostGIS 1.5 the failure message is not explicit so we can only
catch the generic psycopg2.InternalError.

maposmatic/ocitysmap,maposmatic/ocitysmap,maposmatic/ocitysmap,dittaeva/ocitysmap,dittaeva/ocitysmap