After messing around quite a while, I was finally able to get a topogeometry converted from my geometry table following the example of toTopoGeom. I have the topology extension, with a topology schema (SRID = 5367) and a table in the public schema with a topogeometry column.
However, after running a couple of minutes I quit the query because it would take too long. Now I have around 4000 rows in the topogeometry table and only ~10% converted.
Then I wanted to convert the topogeometry to a topojson following the example of the AsTopoJSON. It works ok, but it takes 7 seconds to generate 4000 rows, which is really slow in my opinion.
So the question is; is this a common problem and is there an alternative approach to speed things up?
Insert topogeometry from geometry:
INSERT INTO grid_topo(topo) SELECT topology.toTopoGeom(geom, 'grid_topo', 1) FROM grid WHERE gid >= 0 AND id < 500;
(added the condition to limit the running time).
Generate TopoJSON from topogeometry:
SELECT AsTopoJSON(topo, null) from grid_topo