<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
		>
<channel>
	<title>Comments on: Simplifying a map layer using PostGIS topology</title>
	<atom:link href="http://strk.keybit.net/blog/2012/04/13/simplifying-a-map-layer-using-postgis-topology/feed/" rel="self" type="application/rss+xml" />
	<link>http://strk.keybit.net/blog/2012/04/13/simplifying-a-map-layer-using-postgis-topology/</link>
	<description>Free Thoughts</description>
	<lastBuildDate>Wed, 10 Apr 2013 17:21:09 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.4</generator>
	<item>
		<title>By: Wayne</title>
		<link>http://strk.keybit.net/blog/2012/04/13/simplifying-a-map-layer-using-postgis-topology/comment-page-1/#comment-54051</link>
		<dc:creator>Wayne</dc:creator>
		<pubDate>Wed, 10 Apr 2013 17:21:09 +0000</pubDate>
		<guid isPermaLink="false">http://strk.keybit.net/blog/?p=364#comment-54051</guid>
		<description>I ran into an issue with an exception being thrown using the vanilla code in the blog post.  I found that it was resolved by changing the order of the lines that calculate tol and the if condition that throws an error if tol is 0.  This forces the code to try tolerance 0 first, then thrown an error if that fails.

SQL/MM Spatial exception is the exception that gets thrown.

I changed the code to the following:
IF tol = 0 THEN
  RAISE EXCEPTION &#039;%&#039;, SQLERRM;
END IF;
tol := round( (tol/2.0) * 1e8 ) / 1e8; -- round to get to zero quicker

Needless to say simplifying with tolerance 0 is not supported.</description>
		<content:encoded><![CDATA[<p>I ran into an issue with an exception being thrown using the vanilla code in the blog post.  I found that it was resolved by changing the order of the lines that calculate tol and the if condition that throws an error if tol is 0.  This forces the code to try tolerance 0 first, then thrown an error if that fails.</p>
<p>SQL/MM Spatial exception is the exception that gets thrown.</p>
<p>I changed the code to the following:<br />
IF tol = 0 THEN<br />
  RAISE EXCEPTION &#8216;%&#8217;, SQLERRM;<br />
END IF;<br />
tol := round( (tol/2.0) * 1e8 ) / 1e8; &#8212; round to get to zero quicker</p>
<p>Needless to say simplifying with tolerance 0 is not supported.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: strk</title>
		<link>http://strk.keybit.net/blog/2012/04/13/simplifying-a-map-layer-using-postgis-topology/comment-page-1/#comment-52034</link>
		<dc:creator>strk</dc:creator>
		<pubDate>Tue, 19 Mar 2013 14:16:24 +0000</pubDate>
		<guid isPermaLink="false">http://strk.keybit.net/blog/?p=364#comment-52034</guid>
		<description>Please use the bug tracker for this: http://trac.osgeo.org/postgis</description>
		<content:encoded><![CDATA[<p>Please use the bug tracker for this: <a href="http://trac.osgeo.org/postgis" rel="nofollow">http://trac.osgeo.org/postgis</a></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Fabian Zeindl</title>
		<link>http://strk.keybit.net/blog/2012/04/13/simplifying-a-map-layer-using-postgis-topology/comment-page-1/#comment-52031</link>
		<dc:creator>Fabian Zeindl</dc:creator>
		<pubDate>Tue, 19 Mar 2013 14:05:12 +0000</pubDate>
		<guid isPermaLink="false">http://strk.keybit.net/blog/?p=364#comment-52031</guid>
		<description>when trying to use my own data, I get the following error:

UPDATE rayons SET topogeom = toTopoGeom(geom, &#039;france_dept_topo&#039;, 1);
ERROR:  lwpoly_from_lwlines: shell must be closed
CONTEXT:  SQL statement &quot;WITH ids as ( select row_number() over () as seq, edge from unnest(&#039;{-160,-104,45,-46,41,-44,43,-53,50,-49,47,-67,66,64,-57,55,-61,60,-84,70,-73,72,79,-76,74,-102,101,-87,85,-96,95,-112,98,-100,93,-92,90,-121,120,-125,124,-119,117,-128,113,-109,107,115,-132,-131,-115,116,-108,114,-127,129,-39,-158,159,-153,155,-137,-138,147,-141,144,-145,152,-148,149,-133,134}&#039;::int[] ) u(edge) ), edges AS ( select CASE WHEN i.edge &lt; 0 THEN ST_Reverse(e.geom) ELSE e.geom END as g FROM ids i left join france_dept_topo.edge_data e ON(e.edge_id = abs(i.edge)) ORDER BY seq) SELECT ST_MakePolygon(ST_MakeLine(g.g)) FROM edges g;&quot;
PL/pgSQL function _st_addfacesplit(character varying,integer,integer,boolean) line 34 at EXECUTE statement
SQL statement &quot;SELECT topology._ST_AddFaceSplit(atopology, -newedge.edge_id, newedge.left_face, false)&quot;
PL/pgSQL function st_addedgemodface(character varying,integer,integer,geometry) line 513 at SQL statement
PL/pgSQL function topogeo_addlinestring(character varying,geometry,double precision) line 124 at assignment
SQL statement &quot;SELECT array_cat(edges, array_agg(x)) FROM ( select topology.TopoGeo_addLinestring(atopology, rec.geom, tol) as x ) as foo&quot;
PL/pgSQL function topogeo_addpolygon(character varying,geometry,double precision) line 24 at assignment
PL/pgSQL function totopogeom(geometry,character varying,integer,double precision) line 100 at FOR over SELECT rows

any ideas?</description>
		<content:encoded><![CDATA[<p>when trying to use my own data, I get the following error:</p>
<p>UPDATE rayons SET topogeom = toTopoGeom(geom, &#8216;france_dept_topo&#8217;, 1);<br />
ERROR:  lwpoly_from_lwlines: shell must be closed<br />
CONTEXT:  SQL statement &#8220;WITH ids as ( select row_number() over () as seq, edge from unnest(&#8216;{-160,-104,45,-46,41,-44,43,-53,50,-49,47,-67,66,64,-57,55,-61,60,-84,70,-73,72,79,-76,74,-102,101,-87,85,-96,95,-112,98,-100,93,-92,90,-121,120,-125,124,-119,117,-128,113,-109,107,115,-132,-131,-115,116,-108,114,-127,129,-39,-158,159,-153,155,-137,-138,147,-141,144,-145,152,-148,149,-133,134}&#8217;::int[] ) u(edge) ), edges AS ( select CASE WHEN i.edge &lt; 0 THEN ST_Reverse(e.geom) ELSE e.geom END as g FROM ids i left join france_dept_topo.edge_data e ON(e.edge_id = abs(i.edge)) ORDER BY seq) SELECT ST_MakePolygon(ST_MakeLine(g.g)) FROM edges g;&quot;<br />
PL/pgSQL function _st_addfacesplit(character varying,integer,integer,boolean) line 34 at EXECUTE statement<br />
SQL statement &quot;SELECT topology._ST_AddFaceSplit(atopology, -newedge.edge_id, newedge.left_face, false)&quot;<br />
PL/pgSQL function st_addedgemodface(character varying,integer,integer,geometry) line 513 at SQL statement<br />
PL/pgSQL function topogeo_addlinestring(character varying,geometry,double precision) line 124 at assignment<br />
SQL statement &quot;SELECT array_cat(edges, array_agg(x)) FROM ( select topology.TopoGeo_addLinestring(atopology, rec.geom, tol) as x ) as foo&quot;<br />
PL/pgSQL function topogeo_addpolygon(character varying,geometry,double precision) line 24 at assignment<br />
PL/pgSQL function totopogeom(geometry,character varying,integer,double precision) line 100 at FOR over SELECT rows</p>
<p>any ideas?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: On the fly simplification of topologically defined geometries &#171; Strk&#039;s Blog</title>
		<link>http://strk.keybit.net/blog/2012/04/13/simplifying-a-map-layer-using-postgis-topology/comment-page-1/#comment-51060</link>
		<dc:creator>On the fly simplification of topologically defined geometries &#171; Strk&#039;s Blog</dc:creator>
		<pubDate>Fri, 08 Mar 2013 09:05:48 +0000</pubDate>
		<guid isPermaLink="false">http://strk.keybit.net/blog/?p=364#comment-51060</guid>
		<description>[...] saw how to get a topologically consistent simplified version of a full layer, but that method isn&#8217;t fast enough for on-demand usage. Also, we saw how to perform a fast [...]</description>
		<content:encoded><![CDATA[<p>[...] saw how to get a topologically consistent simplified version of a full layer, but that method isn&#8217;t fast enough for on-demand usage. Also, we saw how to perform a fast [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: strk</title>
		<link>http://strk.keybit.net/blog/2012/04/13/simplifying-a-map-layer-using-postgis-topology/comment-page-1/#comment-50449</link>
		<dc:creator>strk</dc:creator>
		<pubDate>Wed, 27 Feb 2013 15:59:51 +0000</pubDate>
		<guid isPermaLink="false">http://strk.keybit.net/blog/?p=364#comment-50449</guid>
		<description>I suggest subscribing to the &lt;a href=&quot;http://lists.osgeo.org/mailman/listinfo/postgis-users&quot; rel=&quot;nofollow&quot;&gt;postgis users mailing list&lt;/a&gt; for this kind of help</description>
		<content:encoded><![CDATA[<p>I suggest subscribing to the <a href="http://lists.osgeo.org/mailman/listinfo/postgis-users" rel="nofollow">postgis users mailing list</a> for this kind of help</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Francis Seong</title>
		<link>http://strk.keybit.net/blog/2012/04/13/simplifying-a-map-layer-using-postgis-topology/comment-page-1/#comment-50437</link>
		<dc:creator>Francis Seong</dc:creator>
		<pubDate>Wed, 27 Feb 2013 11:48:39 +0000</pubDate>
		<guid isPermaLink="false">http://strk.keybit.net/blog/?p=364#comment-50437</guid>
		<description>I run :
SELECT st_astext(topogeom::geometry) FROM idns_link_0 WHERE id(topogeom) = #table.id

result is :
&quot;MULTILINESTRING((14128213.2930175 4505878.66922969,14128214.0420175 4505877.92022969))&quot;

I don&#039;t understant this result.</description>
		<content:encoded><![CDATA[<p>I run :<br />
SELECT st_astext(topogeom::geometry) FROM idns_link_0 WHERE id(topogeom) = #table.id</p>
<p>result is :<br />
&#8220;MULTILINESTRING((14128213.2930175 4505878.66922969,14128214.0420175 4505877.92022969))&#8221;</p>
<p>I don&#8217;t understant this result.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: strk</title>
		<link>http://strk.keybit.net/blog/2012/04/13/simplifying-a-map-layer-using-postgis-topology/comment-page-1/#comment-50373</link>
		<dc:creator>strk</dc:creator>
		<pubDate>Tue, 26 Feb 2013 09:38:00 +0000</pubDate>
		<guid isPermaLink="false">http://strk.keybit.net/blog/?p=364#comment-50373</guid>
		<description>The message is telling you that by dropping that edge it will be impossible for one TopoGeometry object to retain the same shape.

You can see the shape of the TopoGeometry using:

&lt;code&gt;SELECT topogeom::geometry FROM #table WHERE id(topogeom) = #number&lt;/code&gt;</description>
		<content:encoded><![CDATA[<p>The message is telling you that by dropping that edge it will be impossible for one TopoGeometry object to retain the same shape.</p>
<p>You can see the shape of the TopoGeometry using:</p>
<p><code>SELECT topogeom::geometry FROM #table WHERE id(topogeom) = #number</code></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Francis Seong</title>
		<link>http://strk.keybit.net/blog/2012/04/13/simplifying-a-map-layer-using-postgis-topology/comment-page-1/#comment-50361</link>
		<dc:creator>Francis Seong</dc:creator>
		<pubDate>Tue, 26 Feb 2013 04:24:39 +0000</pubDate>
		<guid isPermaLink="false">http://strk.keybit.net/blog/?p=364#comment-50361</guid>
		<description>I want to reduce edges and nodes. I run &quot;select st_remedgemodface(&#039;topo&#039;, edge_id)&quot;, I got follow error:

ERROR:  TopoGeom #number in layer 1 (#table.topogeom) cannot be represented dropping edge #edge_id</description>
		<content:encoded><![CDATA[<p>I want to reduce edges and nodes. I run &#8220;select st_remedgemodface(&#8216;topo&#8217;, edge_id)&#8221;, I got follow error:</p>
<p>ERROR:  TopoGeom #number in layer 1 (#table.topogeom) cannot be represented dropping edge #edge_id</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: strk</title>
		<link>http://strk.keybit.net/blog/2012/04/13/simplifying-a-map-layer-using-postgis-topology/comment-page-1/#comment-36801</link>
		<dc:creator>strk</dc:creator>
		<pubDate>Tue, 23 Oct 2012 07:21:38 +0000</pubDate>
		<guid isPermaLink="false">http://strk.keybit.net/blog/?p=364#comment-36801</guid>
		<description>Use: &lt;code&gt;SHOW search_path;&lt;/code&gt; to get the current value and &lt;code&gt;SET search_path TO x,y,z&lt;/code&gt; for setting the value.</description>
		<content:encoded><![CDATA[<p>Use: <code>SHOW search_path;</code> to get the current value and <code>SET search_path TO x,y,z</code> for setting the value.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: peas</title>
		<link>http://strk.keybit.net/blog/2012/04/13/simplifying-a-map-layer-using-postgis-topology/comment-page-1/#comment-36790</link>
		<dc:creator>peas</dc:creator>
		<pubDate>Tue, 23 Oct 2012 03:30:15 +0000</pubDate>
		<guid isPermaLink="false">http://strk.keybit.net/blog/?p=364#comment-36790</guid>
		<description>quick update: I was able to create a topology by calling topology.CreateTopology()</description>
		<content:encoded><![CDATA[<p>quick update: I was able to create a topology by calling topology.CreateTopology()</p>
]]></content:encoded>
	</item>
</channel>
</rss>
