On Thu, 2009-06-11 at 16:15 +0100, William Temperley wrote:
> Hi all
>
> Another question from me today, sorry.
>
> 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
> My setup:
> Ubuntu Hardy
> Postgis 1.3.3
> Postgresql 8.3.7
>
> Any ideas anyone?
>
> Cheers, Will
>
>
> =======================
> Python:
> =======================
> sql = """(SELECT site.geom as geom FROM site WHERE
> geom is not null and
> EXISTS (SELECT * FROM vector_site_sample_period
> WHERE vector_site_sample_period.site_id = site.site_id
> and vector_site_sample_period.anopheline_id = %s)) as pnt
> """ % self.anopheline_id
> |~
> lyr.datasource =
> mapnik.PostGIS(estimate_extent=False,user='somename',password='somepass',dbname='vdb',table=sql)
>
> =======================
> Logfile:
> =======================
>
> BST LOG: statement: select f_geometry_column,srid,type from
> geometry_columns where f_table_name='vector_site_sample_period'
> BST LOG: statement: select * from (SELECT site.geom as geom FROM site WHERE
> geom is not null and
> EXISTS (SELECT * FROM vector_site_sample_period
> WHERE vector_site_sample_period.site_id = site.site_id
> and vector_site_sample_period.anopheline_id = 2)) as pnt
> limit 0
> BST LOG: statement: select xmin(ext),ymin(ext),xmax(ext),ymax(ext)
> from (select extent() as ext from vector_site_sample_period) as tmp
> BST ERROR: function extent() does not exist at character 61
> BST HINT: No function matches the given name and argument types. You
> might need to add explicit type casts.
> BST STATEMENT: select xmin(ext),ymin(ext),xmax(ext),ymax(ext) from
> (select extent() as ext from vector_site_sample_period) as tmp
> _______________________________________________
> Mapnik-users mailing list
> [email protected]
> https://lists.berlios.de/mailman/listinfo/mapnik-users
_______________________________________________
Mapnik-users mailing list
[email protected]
https://lists.berlios.de/mailman/listinfo/mapnik-users