1. Prepare JSON like:
{
"features": [
{
"type": "Feature",
"geometry": {
"type": "GeometryCollection",
"geometries": [
{
"type": "Point",
"coordinates": [
19.883992823270653,
50.02026203045478
]
}
]
},
"properties": {
"gridId": 6
}
},
{
"type": "Feature",
"geometry": {
"type": "GeometryCollection",
"geometries": [
{
"type": "Point",
"coordinates": [
19.901266347582094,
50.07074684071764
]
}
]
},
"properties": {
"gridId": 7
}
}
]
}
2.
Here are two examples of code. First one is working, second is not.
List<String> typeList= JSON.jsonPath().get("features.geometry.type"); //It's
working
List<Integer> gridIdList= JSON.jsonPath().get("features.properties.gridId");
//It's not working
In second case I should get list of all gridIds but its not working, it returns
null. I
assumed it is connected with property name = "properties". The example above is
valid GeoJson format.
What is more interesting I can do something like that and it's working:
Integer gridId = JSON.jsonPath().get("features[0].properties.gridId");
Version: 2.4.0
Original issue reported on code.google.com by kamil.ni...@gmail.com on 21 Apr 2015 at 9:07
Original issue reported on code.google.com by
kamil.ni...@gmail.com
on 21 Apr 2015 at 9:07