geojson/draft-geojson

Add explanation of feature vs. geometry

dret opened this issue · 7 comments

dret commented

if #148 turns a "geometry collection" into one of the four "core types" (feature and geometry, simple and collection), then it might be helpful to add an intro section in section 2 that explains the difference between the concept of a feature, and a collection. there is some of this in section 1 (the intro), but maybe it would be helpful to have an explicit "feature vs. geometry" section.

The geometry types can be members of the feature types. So while they can be core types, they are different from Feature/Feature Collection.

I think we lost the first paragraph of the 1.0 spec
http://geojson.org/geojson-spec.html#introduction http://geojson.org/geojson-spec.html#introduction
GeoJSON is a format for encoding a variety of geographic data structures. A GeoJSON object may represent a geometry, a feature, or a collection of features. GeoJSON supports the following geometry types: Point, LineString, Polygon, MultiPoint, MultiLineString, MultiPolygon, and GeometryCollection. Features in GeoJSON contain a geometry object and additional properties, and a feature collection represents a list of features.

In retrospect, that’s a loss for the current draft.

On Feb 16, 2016, at 4:39 AM, Erik Wilde notifications@github.com wrote:

if #148 #148 turns a "geometry collection" into one of the four "core types" (feature and geometry, simple and collection), then it might be helpful to add an intro section in section 2 that explains the difference between the concept of a feature, and a collection. there is some of this in section 1 (the intro), but maybe it would be helpful to have an explicit "feature vs. geometry" section.


Reply to this email directly or view it on GitHub #149.

dret commented

On 2016-02-16 15:51, Allan Doyle wrote:

The geometry types can be members of the feature types. So while they
can be core types, they are different from Feature/Feature Collection.
I think we lost the first paragraph of the 1.0 spec
http://geojson.org/geojson-spec.html#introduction
http://geojson.org/geojson-spec.html#introduction
GeoJSON is a format for encoding a variety of geographic data
structures. A GeoJSON object may represent a geometry, a feature, or a
collection of features. GeoJSON supports the following geometry types:
Point, LineString, Polygon, MultiPoint, MultiLineString, MultiPolygon,
and GeometryCollection. Features in GeoJSON contain a geometry object
and additional properties, and a feature collection represents a list of
features.
In retrospect, that’s a loss for the current draft.

the current intro reads:

"GeoJSON comprises the seven concrete geometry types defined in the
OpenGIS Simple Features Implementation Specification for SQL [SFSQL]:
0-dimensional Point and MultiPoint; 1-dimensional curve LineString and
MultiLineString; 2-dimensional surface Polygon and MultiPolygon; and the
heterogeneous GeometryCollection. [...] GeoJSON also comprises the types
Feature and FeatureCollection. Feature objects in GeoJSON contain a
geometry object with one of the above geometry types and additional
members. A FeatureCollection object contains an array of feature objects."

that's a bit different, but not close enough for you?

The former version was short and sweet and had a nice cadence and progression:

  1. it's a format
  2. an object can be a geometry, feature or collection of features
  3. it enumerates the geometry types
  4. it says what a feature is and what a feature collection is.

If you remember those four things while reading the rest of the spec, it makes other things seem more clear.

The new version goes into more detail, and I think, obscures the main points a bit, requiring more effort to keep in mind while reading the rest.

dret commented

On 2016-02-16 18:56, Allan Doyle wrote:

The former version was short and sweet and had a nice cadence and
progression:

  1. it's a format
  2. an object can be a geometry, feature or collection of features
  3. it enumerates the geometry types
  4. it says what a feature is and what a feature collection is.

If you remember those four things while reading the rest of the spec, it
makes other things seem more clear.

The new version goes into more detail, and I think, obscures the main
points a bit, requiring more effort to keep in mind while reading the rest.

+1; explanations about why things are a certain why are nice later on.
having a concise description in the intro is a plus.

dret commented

#148 (comment) may be a useful illustration of how i think the GeoJSON universe could be explained a bit better. ideally, something like this could be added to the intro part of section 2.

dret commented
                            +--------------------------+
                            |                          |
FeatureCollection           | GeometryCollection       |
                            |                          |
 |                          |  |                       |
 v features                 |  v geometries            |
                            |                          |
Feature  +----------------> | non-Collection (6 types) |
              geometries    |                          |
 |                          |  |              Geometry |
 |                          +--+-----------------------+
 |                             |
 v properties                  v coordinates

@dret I think I'd prefer to stick with JSON examples of the concepts instead of graphics.

The essential difference between Feature and Geometry, as I see it, is

  • a Feature represents a thing (physical or information)
  • a Geometry represents the spatial extent of a thing, and is not a thing

This is probably too philosophical for the draft. I feel like the changes we've made that say only a Feature may have both "properties" and "geometry" members and that only a Geometry may have a "coordinates" member draw a pretty clear line between Feature and Geometry. Solid JSON examples and clearer prose around these will help a lot. I'll suggest something very soon.