[pgrouting-dev] Issue #329 + new flag

Dear community:

I am about to finish up issue #329, Incremental Create Topology

 Actually John Zabrenski mailed to user's list on june last year, and he tested the solution,
 but the merge remained pending.

The actual signature of the function is:

CREATE OR REPLACE FUNCTION pgr_createtopology(edge_table text, tolerance double precision,
                   the_geom text default 'the_geom', id text default 'id',
                   source text default 'source', target text default 'target',rows_where text default 'true')

the minimal usage is like this: (I like defaults... less typing) 
pgr_createtopology(edge_table, tolerance)
And this will delete any topology information already stored in edge_table, if any.

I am about to add a flag "clean", so I am asking what is de preferred default value for the flag?


CREATE OR REPLACE FUNCTION pgr_createtopology(edge_table text, tolerance double precision,
                   the_geom text default 'the_geom', id text default 'id',
                   source text default 'source', target text default 'target',rows_where text default 'true',
                   clean boolean default true)  <<<<<<

CREATE OR REPLACE FUNCTION pgr_createtopology(edge_table text, tolerance double precision,
                   the_geom text default 'the_geom', id text default 'id',
                   source text default 'source', target text default 'target',rows_where text default 'true',
                   clean boolean default false)  <<<<<<

My personal preference is clean = False (Don’t clean), that is, it will continue with the topology where source & target values are null. That way if I add 100 rows to my 25million edges table, it will just add the topology for those 100 rows and not delete the existing topology and restart constructing the topology of 25million +100 edges.

Please, feedback.

×

···

My personal preference is clean = False (Don’t clean), that is, it will continue with the topology where source & target values are null. That way if I add 100 rows to my 25million edges table, it will just add the topology for those 100 rows and not delete the existing topology and restart constructing the topology of 25million +100 edges.

In my opinion, what it shouldn’t do is to drop the table by default :wink:

Are you planning to improve the function to allow to continue updating topology if new data was added for example?

I think the case for the “clean” flag are:

  • clean = True
    → topology exists already → drop and recreate topology without warning?
    → topology doesn’t exist → create it

  • clean = False
    → topology exists already → update topology?

→ topology doesn’t exist → create it

Correct?

Daniel

Georepublic UG & Georepublic Japan
eMail: daniel.kastl@georepublic.de
Web: http://georepublic.info

Right now the functionality is this:

It cleans the table.
https://github.com/pgRouting/pgrouting/blob/master/src/common/sql/pgrouting_topology.sql#L527

the proposed functionality is:
https://github.com/cvvergara/pgrouting/blob/commonFunctionsUnderscore/src/common/sql/pgrouting_topology.sql#L206
+
https://github.com/cvvergara/pgrouting/blob/commonFunctionsUnderscore/src/common/sql/pgrouting_topology.sql#L226

So clean = false, works only with rows where source or target are null

In my opinion, what it shouldn’t do is to drop the table by default :wink:
So, I’ll take that as:
clean = false be the default.


From: daniel@georepublic.de
Date: Tue, 7 Apr 2015 11:40:02 +0900
To: pgrouting-dev@lists.osgeo.org
Subject: Re: [pgrouting-dev] Issue #329 + new flag

My personal preference is clean = False (Don’t clean), that is, it will continue with the topology where source & target values are null. That way if I add 100 rows to my 25million edges table, it will just add the topology for those 100 rows and not delete the existing topology and restart constructing the topology of 25million +100 edges.

In my opinion, what it shouldn’t do is to drop the table by default :wink:

Are you planning to improve the function to allow to continue updating topology if new data was added for example?

I think the case for the “clean” flag are:

  • clean = True
    → topology exists already → drop and recreate topology without warning?
    → topology doesn’t exist → create it

  • clean = False
    → topology exists already → update topology?

→ topology doesn’t exist → create it

Correct?

Daniel

Georepublic UG & Georepublic Japan
eMail: daniel.kastl@georepublic.de
Web: http://georepublic.info

×

_______________________________________________ pgrouting-dev mailing list pgrouting-dev@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/pgrouting-dev

On Tue, Apr 7, 2015 at 11:52 AM, Vicky Vergara <vicky_vergara@hotmail.com>
wrote:

Right now the functionality is this:

It cleans the table.

https://github.com/pgRouting/pgrouting/blob/master/src/common/sql/pgrouting_topology.sql#L527

the proposed functionality is:

https://github.com/cvvergara/pgrouting/blob/commonFunctionsUnderscore/src/common/sql/pgrouting_topology.sql#L206
+

https://github.com/cvvergara/pgrouting/blob/commonFunctionsUnderscore/src/common/sql/pgrouting_topology.sql#L226

So clean = false, works only with rows where source or target are null

>>>In my opinion, what it shouldn't do is to drop the table by default :wink:
So, I'll take that as:
clean = false be the default.

To me this looks like a good solution.

Daniel

--
Georepublic UG & Georepublic Japan
eMail: daniel.kastl@georepublic.de
Web: http://georepublic.info