[postgis-users] Generating PNGs from PostGIS

Paul Ramsey pramsey at cleverelephant.ca
Fri Sep 5 14:26:07 PDT 2008


Dylan,

Mapserver with variable substitution will do what you want. Define a
layer with a DATA string like

DATA "the_geom from (%sql%) using unique gid using srid=4326"

Then, on the CGI URL line, add a sql= parameter. You'll have to add a
DATAPATTERN regex to allow this for securitiy reasons.

Need to run from command line, not CGI?  Use the magic QUERY_STRING
command line parameter to mapserv, which makes it behave like a CGI,
but from a commandline invocation.  The QUERY_STRING is just the stuff
you would ordinarily put on a URL line.

It's hacky but easy.

P.

On Fri, Sep 5, 2008 at 12:11 PM, Dylan Lorimer <edylan at google.com> wrote:
> Thanks everyone for the awesome suggestions! Given that I need this to be
> command line driven, Mapnik looks to be the best option. Though the fact
> that QGIS builds the .map files is tempting as well. In any event, thanks
> again for the suggestions. I'll report back on how successful I am with
> Mapnik.
>
> On other thought: what about throwing a WMS on top of PostGIS and then
> programmatically requesting the data I need via WMS URL request? You can
> pass a SQL query in part of the request using the OGC FILTER syntax, right?
>
> -dylan
>
> _______________________________________________
> postgis-users mailing list
> postgis-users at postgis.refractions.net
> http://postgis.refractions.net/mailman/listinfo/postgis-users
>
>



More information about the postgis-users mailing list