[mapserver-users] WFS attributes to MapServer TEMPLATE in an automated way.

Basques, Bob (CI-StPaul) bob.basques at ci.stpaul.mn.us
Wed Dec 20 12:28:36 PST 2017


All,

I’ve been working with remote WFS feeds a lot lately, and it got me thingking about how to generate a MapServer TEMPLATE that included all the ATTRIBUTE names that are published from a WFS service in an automated way.  I could write a Application service to run a call to the service and report back with a TEMPLATE output, but then I started thinkging about how to do the same thing in a POSTGIS connection.

Is anyone attempting to just output the attribute list directly from the SQL call and pass it to a TEMPLATE wrapper perhaps?  I would be able to filter in one spot this way, in the SQL for the POSTGIS connection, and all the attributes pulled from the SQL would automatically be applied in the TEMPLATE ala:

 Column Name: <column value>

I’m really after the auto-population of the TEMPLATE to create the columnName: valueList from the connection.  I can build a SQL to generate this even not knowing the original list to start with (SELECT * from . . .) . . .

I can get the column names like so:

select column_name from information_schema.columns where table_name = 'stpl_swdischargepoint';

Maybe the real question is, how can I generate a TEMPLATE from a pre-sql like this?  would this need to happen outside of the MapServer CGI request structure?

or is there a method forward for something like:

 TEMPLATE = select column_name from information_schema.columns where table_name = ‘stpl_swdischargepoint';


Thoughts?



bobb






"But what ... is it good for?"
--Engineer at the Advanced Computing Systems Division of IBM, 1968, commenting on the microchip.



-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/mapserver-users/attachments/20171220/3b3a51f4/attachment.html>


More information about the mapserver-users mailing list