Salut Sandro & list,
On 8/16/21 9:29 AM,
a.fu...@lqt.it wrote:
> On Sat, 14 Aug 2021 19:31:02 +0200, Jan Vaillant wrote:
>> Friends,
>>
>> really, I have no doubt that your algorithmic insight is far superior to
>> mine.
>>
>> I am just arguing on behalf of the friendly people of Marciana Marina
>> (quote: "one of the most important towns of Elba Island") and any other
>> tribe that is neglected existence and wiped of the map by a cruel
>> algorithm. I was hoping they could just happily live on in their tiny
>> triangle - instead of being nullified - regardless of the tolerance
>> applied by a heartless GIS users.
>>
>
> Hi Jan,
>
> you still continue to miss the question.
>
> why and when we'll use a simplified/generalized dataset ?
>
> surely not for data processing or data analysis, because only
> a fool man will voluntary use a degraded dataset when he can
> use the full quality one.
>
Thank you for the thorough - as always - explanation.
I admit, I am a fool - and my question is indeed quite 'foolish'. It is
not about some theoretical, mathematical concept of topological
somethingness.
I am just trying to understand the following behavior that I find a bit
inconsistent given that there are three functions/ways to
"simplify/generalize":
SQLite version 3.27.2 2019-02-25 16:06:06
Enter ".help" for usage hints.
Connected to a transient in-memory database.
Use ".open FILENAME" to reopen on a persistent database.
sqlite> select load_extension('/usr/local/lib/mod_spatialite');
sqlite> select initspatialmetadatafull(1);
1
sqlite> create table polys (id integer primary key autoincrement);
sqlite> select AddGeometryColumn('polys', 'geom', 3003, 'POLYGON');
1
sqlite> insert into polys values (null, geomfromtext('polygon((0 0, 0
10, 10 0, 0 0))', 3003));
sqlite> insert into polys values (null, geomfromtext('polygon((10 0, 0
10, 10 10, 10 0))', 3003));
sqlite> select aswkt(simplify(geom, 5)) from polys;
POLYGON((0 0,0 10,10 0,0 0))
POLYGON((10 0,0 10,10 10,10 0))
sqlite> select aswkt(simplify(geom, 10)) from polys;
NULL
NULL
sqlite> select aswkt(simplifypreservetopology(geom, 10)) from polys;
POLYGON((0 0,0 10,10 0,0 0))
POLYGON((10 0,0 10,10 10,10 0))
sqlite> SELECT CreateTopology('topo', 3003, 0, 0);
1
sqlite> SELECT TopoGeo_FromGeoTable('topo', 'main', 'polys', NULL);
1
sqlite> SELECT TopoGeo_ToGeoTableGeneralize('topo', 'main', 'polys',
NULL, 'polys_5', 5);
1
sqlite> SELECT TopoGeo_ToGeoTableGeneralize('topo', 'main', 'polys',
NULL, 'polys_10', 10);
1
sqlite> select aswkt(geom) from polys_5;
MULTIPOLYGON(((0 0,0 10,10 0,0 0)))
MULTIPOLYGON(((0 10,10 10,10 0,0 10)))
sqlite> select aswkt(geom) from polys_10;
NULL
NULL
Observations:
1. simplify collapses the geom if the tolerance is >= 10m
2. simplifypreservetopology leaves them untouched if the tolerance is >=
10m (I guess, because it is supposed to preserve the topology - as far
as I understand)
3. TopoGeo_ToGeoTableGeneralize collapses the geom if the tolerance is
>= 10m
If the behavior of "TopoGeo_ToGeoTableGeneralize" is a choice (I guess
it is) - that's fine! I just argue that it is at least surprising and
maybe considering (<- notice my carefully phrased idea) an option to not
collapse (e.g. for the sake of the brave "Marciana Marinarians") might
be, if possible ... nice, useful.
Bye,
Jan