[mapserver-users] Postgres call 2 GetCapabilities attribute listing.

Basques, Bob (CI-StPaul) bob.basques at ci.stpaul.mn.us
Tue Jan 10 10:56:57 PST 2017


Hi Jukka,

Yeah, I was just reading up on WFS stuff when this came in.

Actually, we’re all set up with WFS already, we set up both WMS and WFS by default, but the WMS is a more generic config that encompasses all our layers, where the WFS config, are set up per layer.  Just a little bit more painful to do.

Most of this question is just me trying to do things the hard way.  While the WFS configuration isn’t as generic, maybe that’s not as bad as I’m thinking it might be.

bobb

On Jan 10, 2017, at 11:29 AM, Rahkonen Jukka (MML) <jukka.rahkonen at maanmittauslaitos.fi<mailto:jukka.rahkonen at maanmittauslaitos.fi>> wrote:

I would activate WFS and send DescribeFeatureType for reading the schema. No need to support other WFS request. All you need is less than ten new metadata lines in your mapfile and you can make Mapserver to publish both the column names and their data types.

-Jukka Rahkonen-
________________________________
Lähettäjä: Basques, Bob (CI-StPaul)<mailto:bob.basques at ci.stpaul.mn.us>
Lähetetty: ‎10.‎1.‎2017 19:11
Vastaanottaja: Jeff McKenna<mailto:jmckenna at gatewaygeomatics.com>
Kopio: mapserver-users at lists.osgeo.org<mailto:mapserver-users at lists.osgeo.org>
Aihe: Re: [mapserver-users] Postgres call 2 GetCapabilities attribute listing.

Hi Jeff,

PHP = Yucky!!

I was trying to go the route of all OGC calls.  The idea is to possibly expand on the options for configuring GeoMOOSE, where you would be able to configure a filtering process on a layer by layer basis.  I know I can make it all work by hardcoding things.  It’s just that the data is variable from the database (as it should be) and I wanted to be able to populate the distinct list upon query vs hardcoding it.

The SLD path might be the best “OGC” based approach, but it end up as a two stage query this way.  I’m still investigating things.  Maybe I should just hardcode for the first pass and try some different approaches after the fact.  Hmm, a thought, I could use a Template populated from a SQL call for the list, but it’s not OGC anymore . . .

I have many potential uses for this on a layer by layer basis.

Thanks for the response.

bobb


On Jan 10, 2017, at 10:50 AM, Jeff McKenna <jmckenna at gatewaygeomatics.com<mailto:jmckenna at gatewaygeomatics.com>> wrote:

Hi Bob,

I personally think you are over-complicating this: if you have full access to the PG instance, it's easiest to have your form submit a short PHP script (mapscript isn't even needed) that executes a "pg_query" returning your distinct column names.

That's the easiest way.

If you must stick with WMS etc, you could use a mapscript wrapper to capture something like a GetFeatureInfo request (that lists all attributes) and populate your form (see wrapper doc http://mapserver.org/ogc/mapscript.html).

But if this was me I would create a short pg_query script.

-jeff


--
Jeff McKenna
MapServer Consulting and Training Services
http://www.gatewaygeomatics.com/



On 2017-01-10 11:52 AM, Basques, Bob (CI-StPaul) wrote:
All,

Anyone have an example of how to set up a postgres call in mapfile that
is used to output a GetCapabilities attribute listing?  I think I said
that correctly.  :c)

I have a layer set up as a WMS service from Postgres, I want to provide
a GetCapabilities result for a “select distinct column” call to populate
a layering filtering form.  Is this even a WMS thing?

I anticipate that this particular set of unqiue values will be added to
over time in the database and thus without my knowing it.  I think I
could generate a SLD on the fly with the list as a call result, but that
seems overly complicated for some reason.

Maybe this is a DescribeLayer function??  Or do I need to move to a WFS
service?

Thanks

bobb










_______________________________________________
mapserver-users mailing list
mapserver-users at lists.osgeo.org<mailto:mapserver-users at lists.osgeo.org>
http://lists.osgeo.org/mailman/listinfo/mapserver-users



"Not everything that can be counted counts, and not everything that counts can be counted."
- Albert Einstein






"Give me chastity and continence, but not yet."
- Saint Augustine



-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/mapserver-users/attachments/20170110/3529a1f0/attachment.htm>


More information about the MapServer-users mailing list