tileoven icon indicating copy to clipboard operation
tileoven copied to clipboard

Postgis plugin error: Layer fails on Tileoven but works on Tilemill

Open csytsma opened this issue 7 years ago • 1 comments

I have a layer with a Postgis query that works on Tilemill, but fails in Tileoven.

Here's the error:

Postgis Plugin: ERROR:  syntax error at or near "WHERE"
LINE 1: SELECT ST_SRID("way") AS srid FROM   ( WHERE "way" IS NOT NU...
                                               ^
in executeQuery Full sql was: 'SELECT ST_SRID("way") AS srid FROM 		( WHERE "way" IS NOT NULL LIMIT 1;'
  encountered during parsing of layer 'barrier_points' in Layer

Here's the query:

( SELECT way, 'barrier' AS type, 
	( select degrees(ST_Azimuth(ST_StartPoint(inter), ST_EndPoint(inter))) from 
		( select ST_Intersection(r.way, ST_Buffer(p.way, 100)) as inter 
			from planet_osm_line r 
			where r.highway in ('motorway', 'trunk', 'primary','secondary', 'tertiary', 'residential', 'service', 'track', 'path', 'cycleway', 'footpath','unknown') 
			and r.way && ST_Buffer(p.way, 100) order by ST_Distance(r.way, p.way) limit 1 ) rr ) 
	as angle 
	FROM planet_osm_point p 
	WHERE barrier IN ('gate', 'yes') ) 
AS data

Any ideas why?

csytsma avatar Sep 27 '18 17:09 csytsma

It seems the error comes directly from mapnik. The call to

source = new mapnik.Datasource(mml.Layer[0].Datasource);

in Datasource.server.bones fails. This is a native function, so I'm out of ideas here. Maybe create a Postgres View?

florianf avatar Oct 07 '18 21:10 florianf