GeoJSONFeature.java

  1. package org.heigit.ors.api.responses.snapping.geojson;

  2. import com.fasterxml.jackson.annotation.JsonProperty;
  3. import io.swagger.v3.oas.annotations.media.Schema;
  4. import org.heigit.ors.api.responses.matrix.json.JSON2DSources;

  5. public class GeoJSONFeature {
  6.     @JsonProperty("type")
  7.     @Schema(description = "GeoJSON type", defaultValue = "Feature")
  8.     public final String type = "Feature";

  9.     @JsonProperty("properties")
  10.     @Schema(description = "Feature properties")
  11.     public GeoJSONFeatureProperties props;

  12.     public GeoJSONFeature(int sourceId, JSON2DSources source) {
  13.         this.geometry = new GeoJSONPointGeometry(source);
  14.         this.props = new GeoJSONFeatureProperties(sourceId, source);
  15.     }

  16.     @JsonProperty("geometry")
  17.     @Schema(description = "Feature geometry")
  18.     public GeoJSONPointGeometry geometry;

  19.     public String getType() {
  20.         return type;
  21.     }

  22.     public GeoJSONFeatureProperties getProps() {
  23.         return props;
  24.     }

  25.     public void setProps(GeoJSONFeatureProperties props) {
  26.         this.props = props;
  27.     }

  28.     public GeoJSONPointGeometry getGeometry() {
  29.         return geometry;
  30.     }

  31.     public void setGeometry(GeoJSONPointGeometry geometry) {
  32.         this.geometry = geometry;
  33.     }

  34. }