<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40"><head><meta http-equiv=Content-Type content="text/html; charset=utf-8"><meta name=Generator content="Microsoft Word 15 (filtered medium)"><style><!--
/* Font Definitions */
@font-face
        {font-family:"Cambria Math";
        panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0in;
        margin-bottom:.0001pt;
        font-size:12.0pt;
        font-family:"Times New Roman",serif;}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:blue;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {mso-style-priority:99;
        color:purple;
        text-decoration:underline;}
p
        {mso-style-priority:99;
        mso-margin-top-alt:auto;
        margin-right:0in;
        mso-margin-bottom-alt:auto;
        margin-left:0in;
        font-size:12.0pt;
        font-family:"Times New Roman",serif;}
span.EmailStyle18
        {mso-style-type:personal-reply;
        font-family:"Calibri",sans-serif;
        color:#1F497D;}
.MsoChpDefault
        {mso-style-type:export-only;
        font-family:"Calibri",sans-serif;}
@page WordSection1
        {size:8.5in 11.0in;
        margin:1.0in 1.0in 1.0in 1.0in;}
div.WordSection1
        {page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]--></head><body lang=EN-US link=blue vlink=purple><div class=WordSection1><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D'>Hi,<o:p></o:p></span></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'><span style='font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D'> I am trying to append points to a new map patch_map6.</span><o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'>v.patch -e input=patch_map1 output=patch_map6                                   <o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'><span style='font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D'>When I run the above command I get the following error.<o:p></o:p></span></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'>ERROR: Key column not found<o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'>Roy<span style='font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D'><o:p></o:p></span></p><p class=MsoNormal><b><span style='font-size:11.0pt;font-family:"Calibri",sans-serif'>From:</span></b><span style='font-size:11.0pt;font-family:"Calibri",sans-serif'> Vaclav Petras [mailto:wenzeslaus@gmail.com] <br><b>Sent:</b> Sunday, November 23, 2014 5:17 PM<br><b>To:</b> Arighna<br><b>Subject:</b> Re: [GRASS-user] Loading JSON data in GRASS<o:p></o:p></span></p><p class=MsoNormal><o:p> </o:p></p><div><div><div><p class=MsoNormal style='margin-bottom:12.0pt'>Hi Roy,<o:p></o:p></p></div><p class=MsoNormal style='margin-bottom:12.0pt'>please send the question to the mailing list. I was not using v.patch with attribute table lately, so I don't know and even if I would the question/answer might useful for other people too. Try -e flag and post also result of that (not only if it does not work but even if it works).<o:p></o:p></p></div><p class=MsoNormal>Vaclav<o:p></o:p></p></div><div><p class=MsoNormal><o:p> </o:p></p><div><p class=MsoNormal>On Sun, Nov 23, 2014 at 6:11 PM, Arighna <<a href="mailto:roy.arighna@gmail.com" target="_blank">roy.arighna@gmail.com</a>> wrote:<o:p></o:p></p><blockquote style='border:none;border-left:solid #CCCCCC 1.0pt;padding:0in 0in 0in 6.0pt;margin-left:4.8pt;margin-right:0in'><div><div><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'><span style='font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D'>Hi Vaclav,</span><o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'><span style='font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D'> </span><o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'><span style='font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D'>When I patch two maps, I can see 2 points in the same map but the attribute table is not populated for the new point. </span><o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'><span style='font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D'> </span><o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'><span style='font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D'>v.patch -a input=patch_map1 output=patch_map5 –overwrite</span><o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'><span style='font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D'> </span><o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'><span style='font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D'>I am trying to append points to patch_map5. In the above command I can see only one row in the attribute table. Map1 attributes did not get populated. </span><o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'><span style='font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D'> </span><o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'><span style='font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D'>Roy</span><o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'><span style='font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D'> </span><o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'><b><span style='font-size:11.0pt;font-family:"Calibri",sans-serif'>From:</span></b><span style='font-size:11.0pt;font-family:"Calibri",sans-serif'> Vaclav Petras [mailto:<a href="mailto:wenzeslaus@gmail.com" target="_blank">wenzeslaus@gmail.com</a>] <br><b>Sent:</b> Thursday, November 06, 2014 7:08 PM<br><b>To:</b> Arighna<br><b>Cc:</b> Moritz Lennert; GRASS user list</span><o:p></o:p></p><div><div><p class=MsoNormal><br><b>Subject:</b> Re: [GRASS-user] Loading JSON data in GRASS<o:p></o:p></p></div></div><div><div><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'> <o:p></o:p></p><div><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'> <o:p></o:p></p><div><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'> <o:p></o:p></p><div><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'>On Thu, Nov 6, 2014 at 3:54 PM, Arighna <<a href="mailto:roy.arighna@gmail.com" target="_blank">roy.arighna@gmail.com</a>> wrote:<o:p></o:p></p><blockquote style='border:none;border-left:solid #CCCCCC 1.0pt;padding:0in 0in 0in 6.0pt;margin-left:4.8pt;margin-top:5.0pt;margin-right:0in;margin-bottom:5.0pt'><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'>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.<o:p></o:p></p><div><div><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'> <o:p></o:p></p></div></div></blockquote><div><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'>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" target="_blank">http://grass.osgeo.org/grass70/manuals/v.patch.html</a><o:p></o:p></p></div><div><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'> <o:p></o:p></p></div><blockquote style='border:none;border-left:solid #CCCCCC 1.0pt;padding:0in 0in 0in 6.0pt;margin-left:4.8pt;margin-top:5.0pt;margin-right:0in;margin-bottom:5.0pt'><div><div><p class=MsoNormal style='mso-margin-top-alt:auto;margin-bottom:12.0pt'>-----Original Message-----<br>From: Arighna [mailto:<a href="mailto:roy.arighna@gmail.com" target="_blank">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" target="_blank">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" target="_blank">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" target="_blank">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><o:p></o:p></p></div></div></blockquote></div><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'> <o:p></o:p></p></div></div></div></div></div></div></blockquote></div><p class=MsoNormal><o:p> </o:p></p></div></div></body></html>