<?xml version='1.0' encoding='US-ASCII'?>
<!DOCTYPE rfc SYSTEM "rfc2629.dtd">

<rfc number="8142" ipr="trust200902" category="std" submissionType="IETF" consensus="yes">
  <?rfc toc="yes"?>
  <?rfc symrefs="yes"?>
  <?rfc sortrefs="yes" ?>
  <?rfc compact="yes" ?>
  <?rfc subcompact="no" ?>

  <front>
    <title abbrev="GeoJSON Text Sequences">GeoJSON Text Sequences</title>
    <author initials="S." surname="Gillies" fullname="Sean Gillies">
      <organization>Mapbox</organization>
      <address>
        <email>sean.gillies@gmail.com</email>
        <uri>http://sgillies.net</uri>
      </address>
    </author>

    <date month="April" year="2017"/>

    <area>General</area>
    <workgroup>GeoJSON</workgroup>

    <keyword>JSON</keyword>
    <keyword>Geospatial</keyword>
    <keyword>JavaScript Object Notation</keyword>
    <abstract>
      <t>This document describes the GeoJSON text sequence format and
      "application/geo+json-seq" media type. This format is based on
      JavaScript Object Notation (JSON) text sequences and GeoJSON, and it makes
      arbitrarily large geographic datasets incrementally parseable without
      restricting the form of GeoJSON texts within a sequence.</t>
    </abstract>
  </front>
  <middle>

<section
 title="Introduction"
 anchor="introduction"
 toc="default">
<t>Arbitrarily large sequences of values pose a problem for JavaScript Object
Notation (JSON) <xref target="RFC7159"/> that is well explained in the motivation for JSON
text sequences <xref target="RFC7464"/>. The GeoJSON format <xref
target="RFC7946"/> faces the same kind of
problem. Geographic datasets often run to the tens of thousands or millions of
features. The problem is often amplified by the presence of large arrays of
coordinates for each of the features.  </t>

<t>This document describes a specialization of JSON text sequences. 
A GeoJSON text sequence is a document of arbitrarily large size
containing one or more GeoJSON objects (e.g., multiple GeoJSON texts
that can be produced and parsed incrementally) and not just a single
GeoJSON FeatureCollection, Feature, or Geometry.</t>

<section title="Requirements Language"
anchor="requirements-language" toc="default">

<t>The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT",
"SHOULD", "SHOULD NOT", "RECOMMENDED", "NOT RECOMMENDED", "MAY", and
"OPTIONAL" in this document are to be interpreted as described in <xref target="RFC2119"/>.
</t></section></section>

<section title="GeoJSON Text Sequence Format"
anchor="geojson-text-sequence-format" toc="default">

<t>Defined in prose similar to the description of the JSON text sequence in <xref target="RFC7464"/>, a GeoJSON text sequence is any
number of GeoJSON <xref target="RFC7946"/> texts, each encoded in UTF-8 <xref
target="RFC3629"/>, 
preceded by one ASCII <xref target="RFC0020"/> record separator (RS) character,
and followed by a line feed
(LF).  </t>

<t>The GeoJSON text sequence format conforms to all the rules of <xref target="RFC7464"/> and
adds the following constraint: each JSON text MUST contain a single GeoJSON
object as defined in <xref target="RFC7946"/>.  </t>

<t>Heterogeneous sequences containing a mix of GeoJSON Geometry, Feature, and
FeatureCollection objects are permitted. How producers and parsers of GeoJSON
text sequences communicate rules for allowed GeoJSON types in exchanged
sequences is not specified in this document.  </t></section> 

<section
title="Security Considerations" anchor="security-considerations"
toc="default">

<t>GeoJSON text sequences have no security considerations beyond those of JSON
    text sequences <xref target="RFC7464"/> and the GeoJSON format <xref target="RFC7946"/>.  </t></section>

<section
title="Interoperability Considerations"
anchor="interoperability-considerations" toc="default">

<t>The advantage of using ASCII character RS "0x1e" to denote a text is that
sequence producers and parsers need not enforce a canonical form of
GeoJSON. Any valid GeoJSON, pretty-printed or compact, can be used in a
GeoJSON text sequence.  </t>

<t>A variety of parsers designed for newline-delimited sequences of compact
JSON text are deployed on the internet today. While there is no canonical form
for JSON texts, and pretty-printed and compact forms are equally valid,
GeoJSON text sequences containing compact GeoJSON texts with no internal
newlines are more interoperable with existing non-standardized parsers.  </t>

<t>In a distributed system where order and exactly-once delivery of messages
are difficult to achieve, GeoJSON text sequences that do not rely on order of
texts for extra semantics are more interoperable than those that do.
</t></section> 

<section title="IANA Considerations" toc="default">

<t>The MIME media type for GeoJSON text sequences is
"application/geo+json-seq" (which uses the suffix
established in <xref target="RFC8091"/>). IANA has registered it in the "Media
Types" registry &lt;https://www.iana.org/assignments/media-types/&gt;.   

<list style="hanging">

<t hangText="Type name:">application</t>
<t hangText="Subtype name:">geo+json-seq</t>
<t hangText="Required parameters:">n/a</t>
<t hangText="Optional parameters:">n/a</t>
<t hangText="Encoding considerations:">binary</t>
<t hangText="Security considerations:">See <xref
target="security-considerations" pageno="false" format="default"/> of RFC 8142</t>
<t hangText="Interoperability considerations:">See <xref
target="interoperability-considerations" pageno="false" format="default"/> of
RFC 8142</t>
<t hangText="Published specification:">RFC 8142</t>
<t hangText="Applications that use this media type:">Geographic information systems (GIS)</t>
<t hangText="Additional information:"><list style="hanging">
        <t hangText="Deprecated alias names for this type:"> n/a</t>
<t hangText="Magic number(s):">n/a</t>
<t hangText="File extension(s):">n/a</t>
<t hangText="Macintosh file type code(s):">n/a</t></list> </t>
<t hangText="Person to contact for further information:">Sean Gillies
(sean.gillies@gmail.com)</t>
<t hangText="Intended usage:">COMMON</t>
<t hangText="Restrictions on usage:">none</t>
<t hangText="Author:">Sean Gillies (sean.gillies@gmail.com)</t>
<t hangText="Change controller:">IETF</t></list> </t></section></middle>
  <back>

    <references title="Normative References">

<?rfc include="reference.RFC.0020"?>
<?rfc include="reference.RFC.2119"?>
<?rfc include="reference.RFC.3629"?>
<?rfc include="reference.RFC.7159"?>
<?rfc include="reference.RFC.7464"?>
<?rfc include="reference.RFC.7946"?>

    </references>


    <references title="Informative References">

<!-- wilde-json-seq-suffix now published as RFC 8091 -->

<?rfc include="reference.RFC.8091"?>

    </references>

  </back>
</rfc>
