Hi Chris,
I'm sorry if I stopped replying to you in recent days, but I was
busy with a very urgent job.
When I went to reread your messages once again I realized something
didn't add up.
> I did find there was an E-09 difference in the y values from the
> original start and end points between my original and simplified
> LINESTRINGS but I updated my simplified geometry back to have
> original values for these two points but Polygonize still fails.
>
I did a quick check using a dataset of about a thousand Linestrings
(srid=4326); these are very varied road routes with a number of points
rangin from a few dozen to several thousand, and with lengths in
the range between 1 and 50 km.
I used ST_Simplify() with three different gradually increasing
tolerance factors.
In no case did I detect any shifts in the starting and ending
points, which always remain absolutely unchanged, as I expected.
This leads me to suspect that your problem might arise right
here, from something that introduces subtle errors in the
coordinates but that can't be directly attributed to
ST_Simplify(); check your procedures better.
-------------------------------------
Second point; it is clear that your procedure for simplifying
OSM WAYs introduces something that prevents you from
reconstructing all the Polygons.
I think I understand that you throw all the simplified
linestrings together in a single pass.
But in this way a single failure is enough to cause the
operation as a whole to fail.
You should always be able to trace the ID code of each
single WAY (simplified linestring), just as you should
be able to trace the code of the RELATION which corresponds
to a single polygon.
Try to reconstruct your polygons one at a time, using only
the simplified WAYs that are needed on a case-by-case basis.
I would expect that in most cases it should work, while only
in a minority of cases do I expect possible failures.
This should allow you to limit the problem, which is
certainly the first step to take to understand what
the factors may be may be noise introduced by
ST_Simplify() which prevents the polygons from
being correctly reconstructed.
bye Sandro