2009/6/11 Jon Burgess <[email protected]>: > On Thu, 2009-06-11 at 16:15 +0100, William Temperley wrote: >> >> I've trying to plot a subset of points from a Postgis Multipoint >> shapefile, however nothing plots. >> I've got "estimate_extent = False" set, yet mapnik tries to estimate >> the extent (see log file below) which seems to cause an error. > > Not exactly. Turing off the estimated extent will force to query the DB > for the real extent, unless you also specify the extent, e.g. > > <Parameter name="extent">-20037508,-19929239,20037508,19929239</Parameter> > >> I have no clue why mapnik appends limit 0 to my query, either. > > It is trying to determine the names and types of the columns returned by > thte query. > >> Nothing untoward shows in the debug output. >> When I plot the whole table, it works fine. > > The problem is here: > > select extent() as ext from vector_site_sample_period > > That should be like this, but the name of the geometry column is > missing: > > select extent(geom) as ext from vector_site_sample_period > > Often this means that the user running query can not do a select on the > geometry_columns table. In your case though it looks like maybe Mapnik > is just confused about which table you are querying. > > Can you show us which geometry columns are in geometry_columns? > > In recent versions of Mapnik you can force the geometry column name by > setting: > geometry_field = 'geom' > > see http://trac.mapnik.org/ticket/139 >
Thanks - it's making some sense now, though for me this seems somewhat confusing behaviour. I'd been expecting behaviour similar to shp2pgsql where you can specify arbitrary queries, which don't get messed with. Mapnik rewrites the query in somewhat non-transparent ways. I've ended up hacking postgis.cpp, allowing the table parameter to pass straight through and be executed unadulterated (i.e. I can pass arbitrary queries shp2pgsql style, provided I use "AsBinary(the_geom) as geom" to get the geometry. Works well for me. Can provide a patch if anyone wants. Best, Will _______________________________________________ Mapnik-users mailing list [email protected] https://lists.berlios.de/mailman/listinfo/mapnik-users

