[gradsusr] KML Coordinates

Andrew Revering andy at f5data.com
Fri Oct 18 22:15:46 EDT 2019


I want to figure out how to calculate or obtain the coordinates defined in
the generated KML file from the 'set kml' command.
Simply using the defined coordinates of the 'set lat / set lon' commands do
not match up exactly with what's in the KML file, and I can't figure out
the logic to skew those numbers manually.
Because of the way my system is set up, it's inconvenient to use the KML
option and parse the kml file.
I'm also generating the PNG myself with the following code. I'm not sure if
that matters, but I just want to make sure that my edge coordinates are
exact.
Ideas?

Here is my abbreviated code.

* define my map bounds
'set lon -129 -64'
'set lat 23.5 52'

* generate the base PNG layer instead of using the KML's TIF
'set parea 0 11 0 8.5'
'set grid off'
'set mproj scaled'
'set mpdraw off'
'set grads off'
'set gxout shaded'
'display var'
'printim myimg.png x2048 y1024 -t 0'

* KML file providing coordinates I want to obtain without having to produce
this KML
'set mproj latlon'
'set gxout kml'
'set kml -img mykml'
'display var'

Resulting coordinates in KML say:
    <LatLonBox>
      <west>   -129.02</west>
      <east>   -63.975</east>
      <south>    23.485</south>
      <north>    52.015</north>
      <rotation>0.0</rotation>
    </LatLonBox>
Which are not the same as my 'set lon/set lat' definitions.

These scripts run for different domains and maps that I can't simply write
this down once and use those values. They are modified on the fly so I need
to figure it out on the fly.

Thanks in advance!
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://gradsusr.org/pipermail/gradsusr/attachments/20191018/4b3f5345/attachment.html>


More information about the gradsusr mailing list