errors with r.out.kml Re: Raster kml export script?

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

errors with r.out.kml Re: Raster kml export script?

Vishal Mehta-2
Hello all,

I just tried using r.out.kml with

r.outkml input=Tdr1980.12 output=Tdr.kml -l

and got the following errors:

r.out.kml: line 96: [: -eq: unary operator expected
Sorry, <m> is not a valid flag

ERROR: Required parameter <map> not set:
   (Name of existing raster map).

Description:
Outputs basic information about a user-specified raster map layer.

Usage:
r.info [-rst] map=name

Flags:
 -r   Print range only
 -s   Print resolution (NS-res, EW-res) only
 -t   Print raster map type only

Parameters:
 map   Name of existing raster map
r.out.kml: line 134: [: -eq: unary operator expected
mogrify: unable to open file `.png': No such file or directory.
mogrify: unable to open image `_legend.png': No such file or directory.

Could anyone tell me how to fix it? I did look at David's code but could'nt troubleshoot the problem..

I am using Grass 6.0.1 on Ubuntu 6.06 LTS..

Thanks very much!

Vishal
www.people.cornell.edu/pages/vkm2


On Jan 4, 2008 8:23 PM, David Finlayson <[hidden email]> wrote:

> Here is a link to my web site with the latest version:
>
> http://david.p.finlayson.googlepages.com/grasstogoogleearth
>
> I have something that works for me, but I was forced to use image
> magick to clip the nodata collar off of the exported png file. If I
> can figure out how to get a one-to-one correspondence between raster
> cells and image pixels, I fix it again.
>
> David
>
> _______________________________________________
> grass-user mailing list
> [hidden email]
> http://lists.osgeo.org/mailman/listinfo/grass-user
>


_______________________________________________
grass-user mailing list
[hidden email]
http://lists.osgeo.org/mailman/listinfo/grass-user
Reply | Threaded
Open this post in threaded view
|

Re: errors with r.out.kml Re: Raster kml export script?

Vishal Mehta-2
Hello,

I've fixed the problem - it was that the version of r.info that grass 6.0.1 uses does not have the m flag option used in David Finlayson's r.out.kml script. Since that was only being used for the Title field in the output kml file, I just commented it out and then it worked file.

Incidentally, the r.info -m flag only seems to be in the GRASS 6.3 version, therefore anyone running r.out.kml in a version less than 6.3 may have the same problem I did.

Now that r.out.kml file works on a single raster map, I am thinking of how I can automate its use for several raster maps - any ideas?

thanks,
Vishal


On Jan 6, 2008 8:06 PM, John C. Tull < [hidden email]> wrote:
Just a guess, but that's a really old GRASS so the problem may stem from GRASS being outdated. 

John


On Jan 6, 2008, at 11:21 AM, Vishal Mehta wrote:

Hello all,

I just tried using r.out.kml with

r.outkml input=Tdr1980.12 output=Tdr.kml -l

and got the following errors:

r.out.kml: line 96: [: -eq: unary operator expected
Sorry, <m> is not a valid flag

ERROR: Required parameter <map> not set:
   (Name of existing raster map).

Description:
Outputs basic information about a user-specified raster map layer.

Usage:
r.info [-rst] map=name

Flags:
 -r   Print range only
 -s   Print resolution (NS-res, EW-res) only
 -t   Print raster map type only

Parameters:
 map   Name of existing raster map
r.out.kml: line 134: [: -eq: unary operator expected
mogrify: unable to open file `.png': No such file or directory.
mogrify: unable to open image `_legend.png': No such file or directory.

Could anyone tell me how to fix it? I did look at David's code but could'nt troubleshoot the problem..

I am using Grass 6.0.1 on Ubuntu 6.06 LTS..

Thanks very much!

Vishal
www.people.cornell.edu/pages/vkm2


On Jan 4, 2008 8:23 PM, David Finlayson <[hidden email]> wrote:

> Here is a link to my web site with the latest version:
>
> http://david.p.finlayson.googlepages.com/grasstogoogleearth
>
> I have something that works for me, but I was forced to use image
> magick to clip the nodata collar off of the exported png file. If I
> can figure out how to get a one-to-one correspondence between raster
> cells and image pixels, I fix it again.
>
> David
>
> _______________________________________________
> grass-user mailing list
> [hidden email]
> http://lists.osgeo.org/mailman/listinfo/grass-user
>

_______________________________________________
grass-user mailing list
[hidden email]
http://lists.osgeo.org/mailman/listinfo/grass-user



_______________________________________________
grass-user mailing list
[hidden email]
http://lists.osgeo.org/mailman/listinfo/grass-user
Reply | Threaded
Open this post in threaded view
|

Re: errors with r.out.kml Re: Raster kml export script?

David Finlayson-4
A basic KML file isn't much more complicated than an HTML web page.
See the google web site on KML for easy examples.

Take a look at the part of the script that adds the
<GroundOverlay></GroundOverlay> section and add as many of these
sections as you need, one for each raster.

If you come up with a way to reliably export a display image with an
accurate bounding box, please let me know (what I did was a hack using
image magick and all). I also change the region to match the raster
which Glen, in a previous post, pointed out was poor style. It would
be easy to add a company logo or other overlays to the script too.

If you come up with anything cool please let me know.

David
_______________________________________________
grass-user mailing list
[hidden email]
http://lists.osgeo.org/mailman/listinfo/grass-user
Reply | Threaded
Open this post in threaded view
|

Re: errors with r.out.kml Re: Raster kml export script?

Vishal Mehta-2
Hi David,

To check if your r.out.kml overlayed a correctly georeferenced image of my data onto Google Earth, I used one of my GRASS raster maps (January potential evaporation for south Asia, mm/day), adding my own India boundary layer within your script. As you can see it seems to be pretty well georeferenced (the black boundary is my country boundary layer). Looks like the way you do it works fine:) Thanks!

I could not find Glen's post that you referred to. I have a bunch of png images created earlier, and can understand your point about figuring out a way to georeference plus make transparent background easily, but I dont have a quick solution as of now. Meanwhile i'm figuring out how to do an overlay sequence of my data..will let you know if I can contribute back to you,

thanks again,
vishal


On Jan 7, 2008 1:12 AM, David Finlayson <[hidden email]> wrote:
A basic KML file isn't much more complicated than an HTML web page.
See the google web site on KML for easy examples.

Take a look at the part of the script that adds the
<GroundOverlay></GroundOverlay> section and add as many of these
sections as you need, one for each raster.

If you come up with a way to reliably export a display image with an
accurate bounding box, please let me know (what I did was a hack using
image magick and all). I also change the region to match the raster
which Glen, in a previous post, pointed out was poor style. It would
be easy to add a company logo or other overlays to the script too.

If you come up with anything cool please let me know.

David


_______________________________________________
grass-user mailing list
[hidden email]
http://lists.osgeo.org/mailman/listinfo/grass-user

ETjan.kmz (7K) Download Attachment