Using JSON instead of XML for OGC documents

Cameron Shorter cameron.shorter at gmail.com
Fri Nov 17 14:37:46 EST 2006


The biggest win for web browsers (performace wise) would be if Web 
Feature Services could return GML in JSON format. I'd imagine this would 
be relatively easy to incorporate into the WFS spec.

Disclaimer: I still haven't done any performance tests with JSON.

Raj Singh wrote:
> Martin echoes my initial reaction. The bigger picture is the reliance  
> on XML data structures for information content. I don't think it's a  
> good idea to consider abandoning such a flexible, well-understood,  
> expressive format just because it's not ideal for one platform (Web  
> browsers), even if that platform is perhaps the primary parser of  some 
> document types.
> 
> Maybe a good long term strategy is to go with XML as the canonical  
> document format, but have some sort of "header" section that points  to 
> other formats (or services that produce alternative formats). And  make 
> that header easy enough to read that text parsers can easily  pull out 
> enough information to avoid the rest and go get their  preferred 
> document format. This strategy could apply not only to  static document 
> formats like Context and SLD, but also to service  responses like 
> GetCapabilities.
> 
> ---
> Raj
> 
> On Nov 16, 2006, Martin Daly wrote:
> 
>> We've also looked into JSON a bit, although not for Context documents.
>> In this case not using XML for the first step seems to be just  delaying
>> the inevitable?  That is, after you have the context data, the next  step
>> is always to get the capabilities of the server (see the recent e-mail
>> trail about, for example, GetMap and GetCapabilities not sharing the
>> same URL root).
>>
>> Unless all of the references services/data area also returned as JSON,
>> then you will be parsing XML sooner rather than later.
>>
>> M
> 
> 
> On Nov 16, 2006, at 5:34 PM, Cameron Shorter wrote:
> 
>> Context working group,
>>
>> Regarding: http://json.org
>>
>> There has been discussion amongst http://openlayers.org developers  
>> about using JSON instead of XML for storing OGC documents (like OGC  
>> Context, WMC, and probably a host of other documents too).
>>
>> The reason for considering JSON over XML are:
>> * In Web Browsers, XML support is patchy.
>> * Consequently extra code is required to be downloaded to cover all  
>> browsers.
>> * In browser clients, code size is a major consideration as  
>> size=bandwidth=speed.
>> * JSON is reportedly faster to process.
>>
>> JSON reportedly has all the other advantages of XML like being  
>> structured, easy to read, is supported by multiple languages etc.
>>
>> One thing discussed is standing up XML<->JSON services.
>>
>> I'd be interested to hear comments from OGC participants on these  ideas.
>>
>> Feel free to foward onto others more appropriate.
>>
>> -- 
>> Cameron Shorter
>> http://cameron.shorter.net
> 
> 
> 


-- 
Cameron Shorter
http://cameron.shorter.net




More information about the Mail_webmap-discuss mailing list