Changes between Initial Version and Version 1 of TopologyCopy


Ignore:
Timestamp:
Mar 7, 2011, 1:26:16 AM (13 years ago)
Author:
strk
Comment:

Legend:

Unmodified
Added
Removed
Modified
  • TopologyCopy

    v1 v1  
     1= Introduction =
     2
     3When working with topology model, it is often useful to copy a dataset for backup, experimentation or other purposes.
     4For example,  you may want to get a simplified version of your data for visualization purposes, so you'd pass each edge under ST_Simplify, but don't want to destroy the original data.
     5
     6Such a copy process would be pretty complex as you'd need to:
     7
     8 1. Copy all node,edge,face primitives to a different topology schema
     9 2. Copy all TopoGeometry definitions (from the relation table and the topology.layer table)
     10 3. Make the new TopoGeometry available again somewhere (in some actual table column)
     11
     12The nice thing about this is that primitive identifiers, as well as layer identifiers and TopoGeometry identifiers are all valid on a per-topology basis, so simply copying a whole topology schema and any rows in topology.layer would get you in a situation where you'd have every TopoGeometry from source topology have a corresponding TopoGeometry in target topology having the _same_ identifier. This is useful as you can then "rebind" a TopoGeometry from one topology to the other by simply modifying its "topology_id" field.
     13
     14Only trouble would be tweaking the copies of topology.layer records (the rows defining the layers, and thus completing definition of the TopoGeometry which belong to those layers) as those records are currently expected to associate a conceptual layer to an actual column of a database table. But we don't have those table columns yet (and we may even not want it).
     15
     16To restate, performing steps 2 above forces us to insert records in topology.layer, but until we do step 3 we have nothing to write in the "schema_name", "table_name", "feature_column fields of that table.
     17
     18This wiki page is to help with defining interfaces that might take care of those steps for us, in a generic and robust way.
     19
     20== Proposal1: TopoGeometry collections (conceptual layers) are part of topology structure ==
     21
     22With this proposal, steps 1 and 2 described in the introduction are seen as a single step, effectively rendering the relation table and the rows in topology.layer (required for proper interpretation of the relation table) as a fundamental part of the topology structure.
     23
     24In order to decouple the "definition" of the TopoGeometry from their deployment in actual table, we'd need to allow not specifying a schema/table/col in topology.layer records. Such records might then represent "detached layers", that are conceptual layers (set of TopoGeometry objects) which are not bound to a specific database column.
     25
     26This would imply changing the current definition of topology.layer table in a normalized form (for example splitting in two tables, one with structural definition fields, another with deployment info) or using placeholder values for the three fields which would be meaningless for "detached layers".
     27
     28Also, it would then be advisable to provide functions to "attach" detached layers to existing tables, some kind of AddTopoGeometryLayer when you request to use an existing "detached layer" definition rather than make up a new one.
     29And maybe also functions to "detach" attached layers and to "drop" attached or detached ones...
     30
     31... TBC ...