[GRASS-user] Loading JSON data in GRASS

Arighna roy.arighna at gmail.com
Wed Dec 3 18:02:59 PST 2014


Hi Moritz,

This command has worked. Thanks a lot Moritz. This is the command('in' instead of 'input') I was looking for. 
Is there any documentation where I could find these commands in detail? I did not find this in http://grass.osgeo.org/documentation/manuals/. 

Thanks again
Roy

-----Original Message-----
From: Moritz Lennert [mailto:mlennert at club.worldonline.be] 
Sent: Wednesday, December 03, 2014 3:59 AM
To: Arighna; 'Vaclav Petras'; grass-user at lists.osgeo.org
Subject: Re: [GRASS-user] Loading JSON data in GRASS

On 02/12/14 17:51, Arighna wrote:
>
>
> I am using -e flag to copy the attribute table as well. I have data in 
> json format. I am importing json data in separate maps and then 
> patching them into one map to have all the points in one place.


So, if you have several patch_map*, then you could just do:

v.patch -e in=patch_map1,patch_map2,patch_map3[,...] output=patched_map

What I don't understand is why you do

v.patch -e in=patch_map1 out=patch_map6

which doesn't patch any maps together, but just copies patch_map1 to patch_map6...


> I did not find any smarter
> way to import them. Is there any way that I can directly insert the records
> in the db instead of saving them in json file first and then importing it?

In what format are they before you save them into json format ?

If you stick with json, couldn't you just glue your json files together 
before importing ?

>
> I am using GRASS 7.0.
>
> v.db.connect -p patch_map1
> layer <1/patch_map1> table <patch_map1> in database
> </home/shared/research/GRASSDATA/RedRiverValley/aroy/sqlite/sqlite.db>
> through driver <sqlite> with key <cat>
>
> v.info -c patch_map1
>
> INTEGER|cat
> CHARACTER|air_temp
> CHARACTER|cloud_cover
> CHARACTER|descriptors
> CHARACTER|dew_point
> CHARACTER|ice_acc_last_hour
> CHARACTER|liquid_acc_last_hour
> CHARACTER|msl_pressure
> CHARACTER|precip_acc_last_hour
> CHARACTER|relative_humidity
> CHARACTER|snow_acc_last_hour
> CHARACTER|station_pressure
> CHARACTER|u_wind_speed
> CHARACTER|v_wind_speed
> DOUBLE PRECISION|valid_time_end
> DOUBLE PRECISION|valid_time_start
> CHARACTER|visibility
> CHARACTER|wind_direction
> CHARACTER|wind_speed
> Displaying column types/names for database connection of layer <1>:
> (Tue Dec  2 10:47:58 2014) Command finished (0 sec)
>
>
> Thanks
> Roy

Everything looks fine here...

Moritz




More information about the grass-user mailing list