geoJson
{
"type": "Feature",
"geometry": {
"type": "Point",
"coordinates": [125.6, 10.1]
},
"properties": {
"name": "Dinagat Islands"
}
}import org.apache.commons.lang3.ArrayUtils;
import com.google.gson.Gson;
public class Scratch {
public static void main(String[] args) throws Exception {
String json = "{" +
" \"geometry\": {" +
" \"type\": \"Polygon\"," +
" \"coordinates\": [" +
" [" +
" [-69.899139," +
" 12.452005" +
" ]," +
" [-69.895676," +
" 12.423015" +
" ]" +
" ]" +
" ]" +
" }" +
"}";
Geometry g = new Gson().fromJson(json, Geometry.class);
System.out.println(g);
// Geometry [geometry=GeometryData [type=Polygon, coordinates={{{-69.899139,12.452005},{-69.895676,12.423015}}}]]
}
}
class Geometry {
GeometryData geometry;
@Override
public String toString() {
return "Geometry [geometry=" + geometry + "]";
}
}
class GeometryData {
String type;
double[][][] coordinates;
@Override
public String toString() {
return "GeometryData [type=" + type + ", coordinates=" + ArrayUtils.toString(coordinates) + "]";
}
}
Also in JavaScript:
- resize js
- tolocalestring javascript currency fixing 2 decimal places
- expo app.json
- javascript minute and second to convert seconds
- math.random js
- javascript compare maps
- the original image of nodejs image
- if in javascript
- javascript tabs example
- react render for loop
- javascript less than but greater than
- javascript truncate array
- Warning: Failed child context type: Invalid child context `virtualizedCell.cellKey` of type
- if else render react
- how to swap two elements in an array js
- UltraExploit.js
- string to boolean javascript
- render react in blaze
- javascript keydown
- push item to array js
- angular stable version
- You seem to not be depending on "@angular/core" and/or "rxjs". This is an error.
- javascript pad with leading zeros
- react if statement