]> git.argeo.org Git - gpl/argeo-suite.git/blob - environment/org.argeo.geo.ui/src/org/argeo/geo/GeoJsonUtils.java
Hack in order to test ODK Collect bug.
[gpl/argeo-suite.git] / environment / org.argeo.geo.ui / src / org / argeo / geo / GeoJsonUtils.java
1 package org.argeo.geo;
2
3 import java.util.Map;
4
5 import com.fasterxml.jackson.databind.JsonNode;
6 import com.fasterxml.jackson.databind.node.ObjectNode;
7
8 /** Geo data utilities. */
9 public class GeoJsonUtils {
10
11 /** Add these properties to all features. */
12 public static void addProperties(JsonNode tree, Map<String, String> map) {
13 for (JsonNode feature : tree.get("features")) {
14 ObjectNode properties = (ObjectNode) feature.get("properties");
15 for (String key : map.keySet()) {
16 properties.put(key, map.get(key));
17 }
18 }
19 }
20
21 /** Singleton. */
22 private GeoJsonUtils() {
23 }
24 }