Package uk.ac.starlink.tfcat

# Class Feature

java.lang.Object
uk.ac.starlink.tfcat.TfcatObject
uk.ac.starlink.tfcat.Feature

public class Feature extends TfcatObject
Represents a TFCat Feature object.

Since:
  9 Feb 2022
Author:
  Mark Taylor

## Constructor Summary

Constructors
Constructor
Description
`Feature(org.json.JSONObject json, Crs crs, Bbox bbox, Geometry<?> geometry, String id, org.json.JSONObject properties)`
Constructor.

## Method Summary

Modifier and Type
Method
Description
`Geometry<?>`
`getGeometry()`
Returns this feature's geometry.
`String`
`getId()`
Returns this feature's identifier.
`org.json.JSONObject`
`getProperties()`
Returns this featurs's properties object.
`void`
`purgeJson()`
Removes any reference to the original parsed JSON from this object.

### Methods inherited from class uk.ac.starlink.tfcat.TfcatObject

`getBbox, getCrs, getJson, getParent, getType`

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

## Constructor Details

### Feature

public Feature(org.json.JSONObject json, Crs crs, Bbox bbox, Geometry<?> geometry, String id, org.json.JSONObject properties)
Constructor.

Parameters:
  `json` - JSON object with "type":"Feature" on which this is based
  `crs` - coordinate reference system, may be null
  `bbox` - bounding box, may be null
  `geometry` - geometry content, may be null
  `id` - identifier string, may be null
  `properties` - properties object, may be null

## Method Details

### getGeometry

public Geometry<?> getGeometry()
Returns this feature's geometry.

Returns:
  geometry, may be null

### getId

public String getId()
Returns this feature's identifier.

Returns:
  id string, may be null

### getProperties

public org.json.JSONObject getProperties()
Returns this featurs's properties object.

Returns:
  properties object, may be null

### purgeJson

public void purgeJson()
Description copied from class: `TfcatObject`
Removes any reference to the original parsed JSON from this object. This may be useful for purposes of efficiency following a parse if the TFCat objects are to be long-lived.

Overrides:
  `purgeJson` in class `TfcatObject`