<div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote">On Thu, Nov 6, 2014 at 3:54 PM, Arighna <span dir="ltr"><<a href="mailto:roy.arighna@gmail.com" target="_blank">roy.arighna@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">I am not sure how I can load multiple data in the same map. Putting<br>
everything in the same json file does not work. Also, using an existing map<br>
for loading a new json file does not work.<br>
<div class=""><div class="h5"><br></div></div></blockquote><div>Import individual JSON files separately and then patch (merge) them using v.patch.<br><br><a href="http://grass.osgeo.org/grass70/manuals/v.patch.html">http://grass.osgeo.org/grass70/manuals/v.patch.html</a><br></div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div class=""><div class="h5">
-----Original Message-----<br>
From: Arighna [mailto:<a href="mailto:roy.arighna@gmail.com">roy.arighna@gmail.com</a>]<br>
Sent: Wednesday, October 22, 2014 1:52 PM<br>
To: 'Moritz Lennert'<br>
Cc: <a href="mailto:grass-user@lists.osgeo.org">grass-user@lists.osgeo.org</a>; 'Vaclav Petras'<br>
Subject: RE: [GRASS-user] Loading JSON data in GRASS<br>
<br>
<br>
Awesome man. It worked now. Thanks a ton Moritz.<br>
<br>
Arighna<br>
<br>
-----Original Message-----<br>
From: Moritz Lennert [mailto:<a href="mailto:mlennert@club.worldonline.be">mlennert@club.worldonline.be</a>]<br>
Sent: Wednesday, October 22, 2014 7:16 AM<br>
To: Arighna; 'Vaclav Petras'<br>
Cc: <a href="mailto:grass-user@lists.osgeo.org">grass-user@lists.osgeo.org</a><br>
Subject: Re: [GRASS-user] Loading JSON data in GRASS<br>
<br>
On 21/10/14 04:38, Arighna wrote:<br>
> Hi Vaclav,<br>
><br>
> I have loaded the point in GRASS. But the attributes are not loaded<br>
> successfully. I am posting one sample data. Could you please help me<br>
> finding what is wrong with the data. Or maybe I am going wrong with<br>
> the loading process.<br>
<br>
This sample data is not enough. According to the ogr GeoJSON format manual<br>
[1], "according to the GeoJSON Specification, only the Feature object must<br>
have a member with name properties. Each and every member of properties is<br>
translated to OGR object of type of OGRField and added to corresponding<br>
OGRFeature object."<br>
<br>
In other words: attributes have to be members of the member properties of<br>
the Feature object.<br>
<br>
I can get a bit further in importing your attributes by using the following<br>
at the beginning<br>
<br>
{"type": "Feature",<br>
"geometry":<br>
{<br>
<br>
     "type": "Point",<br>
<br>
     "coordinates": [50.922759,-90.089954] },<br>
<br>
                 "properties":<br>
<br>
                 {<br>
<br>
                                 "air_temp":{"unit":"F","value":32.0},<br>
<br>
[then the rest is identical to JSON code].<br>
<br>
However, this imports the attributes as such (example is air_temp):<br>
<br>
{ "unit": "F", "value": 32.0 }<br>
<br>
If I change the JSON to<br>
<br>
                 "properties":<br>
<br>
                 {<br>
<br>
                                 "air_temp":32.0,<br>
<br>
etc<br>
<br>
I get the expected attribute values, i.e. air_temp is 32.0 which is<br>
recognized as double precision in the attribute table.<br>
<br>
To check quickly how ogr parses the attributes, you can check on the command<br>
line with<br>
<br>
ogrinfo point.json OGRGeoJSON<br>
<br>
Moritz<br>
<br>
[1] <a href="http://www.gdal.org/drv_geojson.html" target="_blank">http://www.gdal.org/drv_geojson.html</a><br>
<br>
<br>
</div></div></blockquote></div><br></div></div>