Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FeatureCollection and Feature should be top-level object classes #12

Closed
martinburch opened this issue Jun 12, 2014 · 1 comment
Closed
Labels

Comments

@martinburch
Copy link

Point,MultiPoint,LineString, etc. are all \GeoJson\Geometry objects, e.g. \GeoJson\Geometry\Point. This follows spec.

Feature and FeatureCollection are both in the \GeoJson\Feature hierarchy -- \GeoJson\Feature\FeatureCollection and \GeoJson\Feature\Feature. I think this is out of spec. The Feature and FeatureCollection classes do not extend a common Feature class -- FeatureCollection has no properties in common with Feature.

@jmikola
Copy link
Owner

jmikola commented Jun 12, 2014

The namespaces are just there to separate classes into logical packages and aren't meant to enforce a class hierarchy (although it is often consistent with one). I could have put both collection classes in a GeoJson\Collection namespace, but I thought it was more intuitive to have all of the geometry or feature-related classes in one place.

The Feature and FeatureCollection classes do not extend a common Feature class

The collection classes shouldn't extend their non-collection counterparts, as they are only GeoJson objects (outlined in the spec). I'm not sure if your comment was motivated by the GeometryCollection's class hierarchy, but the fact that it extends Geometry instead of GeoJson is actually a bug. I'm tracking that in #13.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants