Accept multi-line SQL queries in table parameter #173

Closed
artemp opened this Issue Oct 11, 2011 · 4 comments

Comments

Projects
None yet
1 participant
@artemp
Member

artemp commented Oct 11, 2011

Currently, it seems necessary to pre-process SQL by removing line breaks.

@artemp

This comment has been minimized.

Show comment
Hide comment
@artemp

artemp Oct 11, 2011

Member

[springmeyer] Migurski, I'm interested in looking into this.

What error's do you get currently, or does mapnik fail silently to render when postgres queries fail?

Member

artemp commented Oct 11, 2011

[springmeyer] Migurski, I'm interested in looking into this.

What error's do you get currently, or does mapnik fail silently to render when postgres queries fail?

@artemp

This comment has been minimized.

Show comment
Hide comment
@artemp

artemp Oct 11, 2011

Member

[migurski] I don't see an error, but I see behavior consistent with mapnik ignoring any parts of the query after the first line break.

Member

artemp commented Oct 11, 2011

[migurski] I don't see an error, but I see behavior consistent with mapnik ignoring any parts of the query after the first line break.

@artemp

This comment has been minimized.

Show comment
Hide comment
@artemp

artemp Oct 11, 2011

Member

[springmeyer] Hmm, mike even with crazy multiline queries like in this test mapfile: http://mapnik-utils.googlecode.com/svn/sandbox/multiline_tests/ the mapnik postgis plugin seems to render fine.

Any chance you could post a query gone wrong?

Also, would be great if you could rebuild mapnik with DEBUG=True and then check out the query that mapnik outputs...

ie, based on that example above this is one query that mapnik prints in debug output and it works for me:
{{{
select asbinary(the_geom) as geom from (select * from world where
cntry_name
= 'Germany') as

  world

where the_geom && setSRID('BOX3D(-180 -90,180 83.62359619140619)'::box3d,4326)
}}

Member

artemp commented Oct 11, 2011

[springmeyer] Hmm, mike even with crazy multiline queries like in this test mapfile: http://mapnik-utils.googlecode.com/svn/sandbox/multiline_tests/ the mapnik postgis plugin seems to render fine.

Any chance you could post a query gone wrong?

Also, would be great if you could rebuild mapnik with DEBUG=True and then check out the query that mapnik outputs...

ie, based on that example above this is one query that mapnik prints in debug output and it works for me:
{{{
select asbinary(the_geom) as geom from (select * from world where
cntry_name
= 'Germany') as

  world

where the_geom && setSRID('BOX3D(-180 -90,180 83.62359619140619)'::box3d,4326)
}}

@artemp

This comment has been minimized.

Show comment
Hide comment
@artemp

artemp Oct 11, 2011

Member

[artem] fixed in r862

Member

artemp commented Oct 11, 2011

[artem] fixed in r862

@artemp artemp closed this Oct 11, 2011

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment