WFS attributes to MapServer TEMPLATE in an automated way.
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';
"But what ... is it good for?"
--Engineer at the Advanced Computing Systems Division of IBM, 1968, commenting on the microchip.