I'm making a map for inclusion in a manuscript. I have the basic layout
set, using the wx display system: https://flic.kr/p/CThHdE
Not perfect, but I can tweak the placement of labels in Inkscape.
However, when I try to transfer the code from d.mon to ps.map, the
gridlines become 'jointed', rather than smooth curves: https://flic.kr/p/DEp7zL
I've tried setting the region resolution, but it doesn't seem to change
anything. How can I plot geographic grids as smooth curves with ps.map?
Or is there a better workflow to accomplish this?
The general issue (also exists in QGIS) is that grid/graticule creators
commonly only create nodes where 2 lines intersect. The solution
generically is that you need to increase the node density of each line
so that there are more points to bend the line along when projected.
As an example (or perhaps a solution) you can see my script that creates
such dense lines. It's a python script to create WGS 84 dense lines that
re-project well at world scales. I've written it to be standalone, or
it's available in QGIS Processing, you could also adapt it to GRASS
since it's pure python and writes a geojson file (ogr can read that). https://github.com/wildintellect/pyGraticule
Enjoy,
Alex
On 02/05/2016 11:08 AM, Tyler Smith wrote:
Hi,
I'm making a map for inclusion in a manuscript. I have the basic layout
set, using the wx display system: https://flic.kr/p/CThHdE
Not perfect, but I can tweak the placement of labels in Inkscape.
However, when I try to transfer the code from d.mon to ps.map, the
gridlines become 'jointed', rather than smooth curves: https://flic.kr/p/DEp7zL
I've tried setting the region resolution, but it doesn't seem to change
anything. How can I plot geographic grids as smooth curves with ps.map?
Or is there a better workflow to accomplish this?
On Fri, Feb 5, 2016 at 8:08 PM, Tyler Smith <tyler@plantarum.ca> wrote:
Hi,
I'm making a map for inclusion in a manuscript. I have the basic layout
set, using the wx display system: https://flic.kr/p/CThHdE
Not perfect, but I can tweak the placement of labels in Inkscape.
However, when I try to transfer the code from d.mon to ps.map, the
gridlines become 'jointed', rather than smooth curves: https://flic.kr/p/DEp7zL
I've tried setting the region resolution, but it doesn't seem to change
anything. How can I plot geographic grids as smooth curves with ps.map?
Or is there a better workflow to accomplish this?
What about using v.mkgrid and then reprojection it using vertex
densification as provided by v.proj?
On Sun, Feb 7, 2016, at 05:17 PM, Markus Neteler wrote:
On Fri, Feb 5, 2016 at 8:08 PM, Tyler Smith <tyler@plantarum.ca> wrote:
>
> How can I plot geographic grids as smooth curves with ps.map?
What about using v.mkgrid and then reprojection it using vertex
densification as provided by v.proj?
Thanks Markus,
That sounds reasonable. However, based on your and Alex's comments, I
did some digging into ps.map. It appears the resolution of grid lines is
hardcoded to use 10 vertices across the length of each grid line, via:
#define SEGS 10
in do_geogrid.c. I changed this to 100 and recompiled, and now I have
nice smooth grids. This suggests that perhaps a permanent fix would be
to replace the SEGS macro with an additional argument to the geogrid
command in the ps.map instruction set. That way users could tune the
value to suit the map they are preparing. Alternatively, some more
sophisticated calculation could be used to determine the number of
segments. Or it could just be set to a sufficiently high number.
I can look into one or more of these options if it sounds generally
useful; I don't yet understand how the ps.map arguments are parsed, but
it looks to be within my capabilities to make the change.
On Sun, Feb 7, 2016, at 05:17 PM, Markus Neteler wrote:
On Fri, Feb 5, 2016 at 8:08 PM, Tyler Smith <tyler@plantarum.ca> wrote:
How can I plot geographic grids as smooth curves with ps.map?
What about using v.mkgrid and then reprojection it using vertex
densification as provided by v.proj?
Thanks Markus,
That sounds reasonable. However, based on your and Alex's comments, I
did some digging into ps.map. It appears the resolution of grid lines is
hardcoded to use 10 vertices across the length of each grid line, via:
#define SEGS 10
in do_geogrid.c. I changed this to 100 and recompiled, and now I have
nice smooth grids. This suggests that perhaps a permanent fix would be
to replace the SEGS macro with an additional argument to the geogrid
command in the ps.map instruction set. That way users could tune the
value to suit the map they are preparing. Alternatively, some more
sophisticated calculation could be used to determine the number of
segments. Or it could just be set to a sufficiently high number.
I can look into one or more of these options if it sounds generally
useful; I don't yet understand how the ps.map arguments are parsed, but
it looks to be within my capabilities to make the change.
Try attached diff as a starting point. Certainly needs some more clean-up and inclusion in the documentation in ps.map.html.