Newer
Older
task-bldg / src / main / java / osm / surveyor / task / util / JsonCrs.java
@haya4 haya4 on 18 Jul 2022 832 bytes fix: 'index.geojson'のパース
package osm.surveyor.task.util;

import com.fasterxml.jackson.databind.JsonNode;

import lombok.Getter;
import lombok.Setter;

/**
	"crs": {
		"type":"name",
		"properties":{
			"name":"urn:ogc:def:crs:OGC:1.3:CRS84"
		}
	}
*/
@Getter
@Setter
public class JsonCrs {
	
	private String type = "name";
	private JsonProperties properties;
	
	public String toString() {
		StringBuffer sb = new StringBuffer();
		boolean c1 = false;
		sb.append("{");
		c1 = Geojson.outStr(c1, sb, "type", this.type);
		c1 = Geojson.out(c1, sb, "properties", this.properties);
		sb.append("}");
		return sb.toString();
	}
	
	public void parse(JsonNode node) {
		setType(node.get("type").textValue());
		
		JsonNode node1 = node.get("properties");
		if (node1 != null) {
			this.properties = new JsonProperties();
			this.properties.parse(node1);
		}
	}
}