[mapserver-dev] Call for vote on RFC 75: INSPIRE view service support

Stephan Meißl stephan at meissl.name
Mon Feb 6 07:31:51 EST 2012


On Sun, 2012-02-05 at 18:32 -0500, Stephen Woodbridge wrote: 
> On 2/5/2012 4:31 PM, Stephan Meißl wrote:
> > Hi devs,
> >
> > I would like to call for a vote on RFC 75: "INSPIRE view service
> > support" [1]. There's also a pretty much advanced sandbox implementation
> > available [2] for review.
> >
> > Thanks,
> > Stephan
> >
> > [1] http://mapserver.org/development/rfc/ms-rfc-75.html
> > [2] http://trac.osgeo.org/mapserver/browser/sandbox/inspire_soc2011
> 
> Hi Steve,
> 
> I just read through RFC-75 and one thing that was not clear to me is how 
> I could change the column name for a label field based on %language%.
> 
> So for example in my road data for the middle east I have NAME and 
> NAME_ALT where NAME_ALT is empty or contains Arabic text for the road name.
> 
> So if the language were 'arb' then I would want to display NAME_ALT or 
> fall back to NAME if it is empty. In SQL I can use coalesce(), but there 
> is not a function like that for all data providers. Obviously, the 
> column names could be changed to NAME, NAME_ARB, etc.
> 
> Is this supported, or is there an easy way to work around this?
> 
> Thanks for all the work you guys have done to support INSPIRE.
> 
> -Steve W

Hi Steve,

thanks for reviewing the RFC. Currently the string "%language%" is
substituted in DATA and CONNECTION directives with the value of the
language parameter of the request. I think it should be possible to use
this for your example at least to select a column based on the language.
Note, names of the columns should be NAME_arb, NAME_eng, etc. where the
one corresponding to the first one in "wms_inspire_languages" is the
default one.

The fallback for empty fields should be possible to implement with SQL.
Maybe something like the following untested DATA statement:

DATA 'the_geom from (SELECT gid, the_geom, CASE WHEN (b.name NOT NULL OR b.name != "") THEN b.name ELSE a.name END from NAME_arb a, NAME_%language% b WHERE a.gid = b.gid) as x USING UNIQUE gid USING SRID=4326'

cu
Stephan




More information about the mapserver-dev mailing list