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

New Feature getGeom & getGeomType in @turf/invariant #720

Merged
merged 4 commits into from
May 8, 2017

Conversation

DenisCarriere
Copy link
Member

New Feature getGeom & getGeomType

Both methods are primarily used to normalize Geometry Object information from Feature or Geometry inputs.

Examples

getGeom(geojson) => Geometry

var point = {
  "type": "Feature",
  "properties": {},
  "geometry": {
    "type": "Point",
    "coordinates": [110, 40]
  }
}
var geom = invariant.getGeom(point)
//={"type": "Point", "coordinates": [110, 40]}

getGeomType(geojson) => String

var point = {
  "type": "Feature",
  "properties": {},
  "geometry": {
    "type": "Point",
    "coordinates": [110, 40]
  }
}
var geom = invariant.getGeom(point)
//="Point"

@DenisCarriere DenisCarriere added this to the 4.3.0 milestone May 8, 2017
@DenisCarriere DenisCarriere self-assigned this May 8, 2017
@DenisCarriere DenisCarriere changed the title New Feature => getGeom & getGeomType to @turf/invariant New Feature getGeom & getGeomType in @turf/invariant May 8, 2017
@DenisCarriere DenisCarriere merged commit cfffd7d into master May 8, 2017
@DenisCarriere DenisCarriere deleted the invariant branch May 8, 2017 18:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant