[Geojson] Being more specific about immutable semantics

Sean Gillies <sean.gillies@gmail.com> Mon, 08 February 2016 18:29 UTC

Return-Path: <sean.gillies@gmail.com>
X-Original-To: geojson@ietfa.amsl.com
Delivered-To: geojson@ietfa.amsl.com
Received: from localhost (ietfa.amsl.com [127.0.0.1]) by ietfa.amsl.com (Postfix) with ESMTP id EB6C61B311F for <geojson@ietfa.amsl.com>; Mon, 8 Feb 2016 10:29:56 -0800 (PST)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -1.999
X-Spam-Level:
X-Spam-Status: No, score=-1.999 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, FREEMAIL_FROM=0.001, HTML_MESSAGE=0.001, SPF_PASS=-0.001] autolearn=ham
Received: from mail.ietf.org ([4.31.198.44]) by localhost (ietfa.amsl.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id Juy-3lzmoJdv for <geojson@ietfa.amsl.com>; Mon, 8 Feb 2016 10:29:55 -0800 (PST)
Received: from mail-yw0-x229.google.com (mail-yw0-x229.google.com [IPv6:2607:f8b0:4002:c05::229]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by ietfa.amsl.com (Postfix) with ESMTPS id 169421B311E for <geojson@ietf.org>; Mon, 8 Feb 2016 10:29:55 -0800 (PST)
Received: by mail-yw0-x229.google.com with SMTP id q190so108762250ywd.3 for <geojson@ietf.org>; Mon, 08 Feb 2016 10:29:55 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:date:message-id:subject:from:to:content-type; bh=4zrc0BvrXZXKBHXLcqU8trVsZ0Mvj+DG7gTkEaHMvwk=; b=h5yUBGENvMfCocWB/mxTeqx60PIeqZVttFMTKrC1GWQ+jzP+J+W0Xj4rQlZnvnLQO0 9XZk0gmpSzyCh3/zF/0hI54LNkBBTWIs451zvOSajTnWwlx5y689fSWygffvQ7u7z7AO mS7/+azp8a7lTbzP0ShBa7PLg8vrGgS4PAr1k10E87sCY8+tAvNNB8QpbzH1rtfDHe1o Bbm9CWAvliHiTQ9p0lqPwZjkNZ44Q0hJYVegbBYzT1SJaTBwngJot5ub04QFSok16k47 BHh126J3S6bsdDdB1BrS5lIlBBahlfR23cevK2NlFOO3IjrAaqLpOu4YggQnvCH8oZrM qg3Q==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:date:message-id:subject:from:to :content-type; bh=4zrc0BvrXZXKBHXLcqU8trVsZ0Mvj+DG7gTkEaHMvwk=; b=iQ/fojSyrgEsLiIutTbdxVIKgsJOG3CiDdTgcvNYdyluQ+NG0e6zlVvLpxkRdbow0E OwGVaoZId2VcaTKjMe0ucTVd6+1huIfCBXxNWtPcZJYLXjnaAS4kBg/vPYYotwWqOX6n 6zv3silv67gKRgTsuPGPaiZDfV7dItzF85t6JPsykEDNUEpKmK/4JFagYy8opDbvO4p3 5z1eF8rs72/IEOjYeY8q1uTZsPkAPibHohzqEoEE3aMf9jxDdXSAG7et+e2tvc+slDbj jcDxbzyowZqVDSS6KBNxsrCsq7bQX+dq9EETEaRR1OGUhU0GyohcBBP/mIpyeWxSxwvu /xRg==
X-Gm-Message-State: AG10YOQa+To7EL8vNvh9fuWsFcZr91wO3+XoLODr5RjQU/O9BWpCsifHYLclSEL+5yYdrPZBlzUPH/od6eNc6A==
MIME-Version: 1.0
X-Received: by 10.129.131.142 with SMTP id t136mr3988833ywf.328.1454956194371; Mon, 08 Feb 2016 10:29:54 -0800 (PST)
Received: by 10.129.101.6 with HTTP; Mon, 8 Feb 2016 10:29:54 -0800 (PST)
Date: Mon, 08 Feb 2016 11:29:54 -0700
Message-ID: <CAOodmJqkhLD-cNk_wFznU_LPGyMLj3qeP6DoCY6qXB7-xmafZw@mail.gmail.com>
From: Sean Gillies <sean.gillies@gmail.com>
To: geojson@ietf.org
Content-Type: multipart/alternative; boundary="001a114f14a6213987052b466342"
Archived-At: <http://mailarchive.ietf.org/arch/msg/geojson/eVZbpxrORyt5koH6P7QjdcfcRHE>
Subject: [Geojson] Being more specific about immutable semantics
X-BeenThere: geojson@ietf.org
X-Mailman-Version: 2.1.15
Precedence: list
List-Id: IETF GeoJSON WG <geojson.ietf.org>
List-Unsubscribe: <https://www.ietf.org/mailman/options/geojson>, <mailto:geojson-request@ietf.org?subject=unsubscribe>
List-Archive: <https://mailarchive.ietf.org/arch/browse/geojson/>
List-Post: <mailto:geojson@ietf.org>
List-Help: <mailto:geojson-request@ietf.org?subject=help>
List-Subscribe: <https://www.ietf.org/mailman/listinfo/geojson>, <mailto:geojson-request@ietf.org?subject=subscribe>
X-List-Received-Date: Mon, 08 Feb 2016 18:29:57 -0000

We've got consensus that extensions must not change the semantics of
GeoJSON types.

https://github.com/geojson/draft-geojson/blob/master/middle.mkd#semantics-of-geojson-properties-and-types-are-not-extensible

I'd like this to be more specific to steer implementers away from producing
monsters like this:

{
  "features":[
    {
     "features": [],
      "geometry": {
      "coordinates": [0, 0],
        "type": "Point"
    },
    "properties": {
     "name": "Null Island"
    },
    "type": "Feature"
    }
    ],
  "geometry": {
    "coordinates": [123.0, 345.0],
    "type": "Point"
  },
  "properties": {
    "name": "Dinagat Islands"
  },
  "type": "FeatureCollection"
}

It's a FeatureCollection with semantics of Feature and Geometry containing
a Feature with semantics of FeatureCollection.

Concretely: I propose to add to the "Extending GeoJSON" section a
definition of the GeoJSON properties, enumerating "id", "type", "features",
&c. And add to the "Semantics of GeoJSON properties and types are not
extensible" section something like the following:

- A Feature or Geometry object MUST NOT contain a "features" property.
- A FeatureCollection or Geometry object MUST NOT contain a "geometry" or
"properties" object.
- A FeatureCollection or Feature object MUST NOT contain a "coordinates"
property.

I'll prepare a PR for review unless there are objections.

-- 
Sean Gillies