On Mon, 28 Dec 2020 09:06:12 -0800 (PST), Francesco Frassinelli wrote:
> My problem is that the last step of the process, which involves
> TopoGeo_ToGeoTableGeneralize, produces a table with an empty Geometry
> column and no error at all. What could it be?
>
ciao Francesco,
SOLVED :-D
it drove me crazy for many hours searching what was wrong in your SQL
or if it was some obscure bug, but at the end of the day I've finally
caught it.
conclusion: there is nothing wrong in TopoGeo_ToGeoTableGeneralize(),
it works nicely as expected; there was just an absurd value passed
as an argument. I've to say that it was under my nose for hours,
and I wasn't able to see it. :-P
let's see what was the real cause of failure:
SELECT TopoGeo_ToGeoTableGeneralize('topology', NULL, 'comuni',
'Geometry', 'comuni_simplified_1000m', 1000);
the last argument (1000) is the tolerance factor for simplifying,
that's to say that it's a distance radius.
but distances _MUST_ be expressed in the natural unit of measure
for the adopted SRID, that in this case is 4326 WGS84, a geographic
reference system based on _ANGLES_ of latitude and longitude,
adopting _DEGREES_ as the unit of measure.
conclusion: a tolerance of thousand degrees is obviouly an
absurdity, and consequently the underlying algorithm
just returned NULL Geometries.
SELECT TopoGeo_ToGeoTableGeneralize('topology', NULL, 'comuni',
'Geometry', 'comuni_simplified_1000m', 0.01);
this second corrected statement will work ;-)
note: at the equator 1 longitude degree = 111.1 Km, so
0.01 degrees are roughly equivalent to 1 Km
bye Sandro