[postgis-devel] a slight error in postgis TopologySummary

Rémi Cura remi.cura at gmail.com
Thu Sep 26 06:29:36 PDT 2013


Hello strk,

I'm not using the latest yet :
POSTGIS="2.0.3 r11128" GEOS="3.4.0dev-CAPI-1.8.0 r3857" PROJ="Rel. 4.8.0, 6
March 2012" GDAL="GDAL 1.10.0, released 2013/04/24" LIBXML="2.8.0" TOPOLOGY
RASTER


Quick fix : a minor change in design : was querying the wrong table.
On my version it's around lines 68-70 in the function definition.

Old version :
"EXECUTE 'SELECT count(*) FROM (SELECT DISTINCT layer_id FROM '
      || quote_ident(atopology) || '.relation ) foo ' INTO STRICT n;

New version :
 "EXECUTE 'SELECT count(*) FROM (SELECT DISTINCT layer_id FROM
topology.layer
 WHERE schema_name = '|| quote_literal(atopology) || ') foo ' INTO STRICT
n;"


Cheers,

Rémi-C




2013/9/26 Sandro Santilli <strk at keybit.net>

> On Thu, Sep 26, 2013 at 11:11:12AM +0200, Rémi Cura wrote:
> > Hello,
> > I noticed a slight error in the TopologySummary function :
> > The layer count is wrong : it appears that if a layer is empty it is not
> > counted.
> >
> > Cheers,
> > Rémi-C
> >
> > Here is what I get :
> >
> > SELECT TopologySummary('demo_zone_test')
> > Topology demo_zone_test (11), SRID 931008, precision 0.1, has Z
> > 88 nodes, 105 edges, 49 faces, 76 topogeoms in 2 layers
> > Layer 1, type Lineal (2), 48 topogeoms
> >  Deploy: demo_zone_test.route_demo.tg
> > Layer 4, type Polygonal (3), 28 topogeoms
> >  Deploy: demo_zone_test.bati_demo.tg
> > Layer 5, type Polygonal (3), 0 topogeoms
> >  Deploy: demo_zone_test.chaussee.tg
>
> Uhm, Layer 5 is empty too, why is that counted ?
> Are you using latest version of PostGIS ?
> If you find the problem and have a patch, I'll be happy to apply it.
>
> --strk;
> _______________________________________________
> postgis-devel mailing list
> postgis-devel at lists.osgeo.org
> http://lists.osgeo.org/cgi-bin/mailman/listinfo/postgis-devel
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/postgis-devel/attachments/20130926/305702db/attachment.html>


More information about the postgis-devel mailing list