abstraction of mapogcsos.c common ogc bits
Kralidis,Tom [Burlington]
Tom.Kralidis at EC.GC.CA
Wed Oct 18 14:53:46 EDT 2006
> -----Original Message-----
> From: UMN MapServer Developers List
> [mailto:MAPSERVER-DEV at LISTS.UMN.EDU] On Behalf Of Daniel Morissette
> Sent: 18 October, 2006 1:52 PM
> To: MAPSERVER-DEV at LISTS.UMN.EDU
> Subject: Re: [UMN_MAPSERVER-DEV] abstraction of mapogcsos.c
> common ogc bits
>
> Kralidis,Tom [Burlington] wrote:
> >
> > What do people think about a generic mapowscommon.c / mapowscommon.h
> >
>
> I think that grouping all OWS Common stuff in a
> mapowscommon.c file would be a good idea.
>
> >
> > Maybe Assefa/others can provide comments on using libxml2
> compared to
> > msIO_printf for XML. If it were up to me, I'd go with doing things
> > the
> > libxml2 way, as msIO_printf can be quite error prone for XML output
> > and well formedness. This would of course mean that any future
> > development of OGC stuff in MapServer would be best to
> align with the
> > libxml2 way of doing things.
> >
>
> It seems that using libxml2 for future OGC service work is
> probably a good idea, but I think we'd need some comments on
> whether libxml2 brought real benefits for the SOS
> implementation by simplifying the code, and also it would be
> interesting to see a comparison of the performance impact of
> using libxml2 vs msIO_printf.
>
Assefa would be the best judge here, sice he primarily did mapogcsos.c.
> I guess before deciding to go with libxml2 all the way I'd
> like to make sure that we are not trading an ugly mechanism
> for another ugly one with just poorer performance.
>
> For instance, from a quick browse of the mapogcsos.c code, it
> seems that everytime something is set with libxml2 there is a
> call to xmlNewNs() with hardcoded namespace and uri. There is
> a total of 110 calls like this in mapogcsos.c, most of them
> with the same hardcoded gml or ows namespace info, are these
> really necessary? Do these repeated allocations of objects
> not add up and eventually impact on performance?
> If they cannot be avoided then at least we should use a
> #define to avoid duplicating the same namespace and uri
> strings 39 times (for ows) and 25 times (for gml)... at least
> to make the code look better than the former msIO_printf version.
>
Very true. Say hello to mapowscommon.h :)
I think we need to look into libxml2 a lot deeper and what the API does.
For example, Assefa used the tree module of libxml2. And we are
outputting the OGC Exceptions with the ows: namespace explicitly defined
in the output (e.g. ows:ExceptionReport).
This is more commonly done by setting a global namespace and NOT
explicitly defining a namespace foreach element, i.e.:
<ExceptionReport xmlns="http://www.opengis.net/ows" ...>
<Exception exceptionCode="Foo">
...
</ExceptionReport>
...type of thing.
So we may be able to save namespaces declarations there.
> Please don't get me wrong, I'm not saying that libxml2 is not
> a good way to go, I'm just thinking out loud.
>
> Daniel
> --
> Daniel Morissette
> http://www.mapgears.com/
>
More information about the mapserver-dev
mailing list