I'm trying to generate a vector graphics file (PDF, but EPS or PS is fine) from the GRASS CLI. I'd like to have both raster and vector output. When I follow the simple examples from PSDRIVER or CAIRO the result is always the same - only the last graphic appears. It is as though there is a "d.erase" between every command.
Ken Mankoff <mankoff@gmail.com> hat am 29. Januar 2019 um 08:43 geschrieben:
Hi,
I'm trying to generate a vector graphics file (PDF, but EPS or PS is fine) from the GRASS CLI. I'd like to have both raster and vector output. When I follow the simple examples from PSDRIVER or CAIRO the result is always the same - only the last graphic appears. It is as though there is a "d.erase" between every command.
* Ken Mankoff <mankoff@gmail.com> [2019-01-29 08:43:56 +0100]:
Hi,
I'm trying to generate a vector graphics file (PDF, but EPS or PS is fine) from the GRASS CLI. I'd like to have both raster and vector output. When I follow the simple examples from PSDRIVER or CAIRO the result is always the same - only the last graphic appears. It is as though there is a "d.erase" between every command.
Ken Mankoff <mankoff@gmail.com> hat am 29. Januar 2019 um 08:43 geschrieben:
Hi,
I’m trying to generate a vector graphics file (PDF, but EPS or PS is fine) from the GRASS CLI. I’d like to have both raster and vector output. When I follow the simple examples from PSDRIVER or CAIRO the result is always the same - only the last graphic appears. It is as though there is a “d.erase” between every command.
Give it a try. ps.map is not that complicated. The manual page even offers an out of the box template for instant results (just scroll to the end).
And if you get familiar with that tool you can produce very convincing graphics for publications, with graphically additions of your liking.
cheers
Stefan
Ken Mankoff <mankoff@gmail.com> hat am 29. Januar 2019 um 11:20 geschrieben:
I will look into ps.map. I was hoping for something simpler.
Please excuse brevity. Sent from tiny pocket computer with non-haptic
feedback keyboard.
On Tue, Jan 29, 2019, 09:28 <st_kiefer@web.de wrote:
> Hi Ken,
> have you considered using ps.map?
>
> https://grass.osgeo.org/grass76/manuals/ps.map.html
>
> regards
>
> Stefan
>
> > Ken Mankoff <mankoff@gmail.com> hat am 29. Januar 2019 um 08:43
> geschrieben:
> >
> >
> > Hi,
> >
> > I'm trying to generate a vector graphics file (PDF, but EPS or PS is
> fine) from the GRASS CLI. I'd like to have both raster and vector output.
> When I follow the simple examples from PSDRIVER or CAIRO the result is
> always the same - only the last graphic appears. It is as though there is a
> "d.erase" between every command.
> >
> > From https://grass.osgeo.org/grass76/manuals/psdriver.html
> >
> > export GRASS_RENDER_IMMEDIATE=ps
> > export GRASS_RENDER_TRUECOLOR=TRUE
> > g.region raster=elevation
> > d.rast elevation
> > d.vect roadsmajor color=red
> >
> > Only shows roads, no elevation.
> >
> > I can get what I want with the PNG driver, but those graphics are not
> publication quality.
> >
> > Thanks,
> >
> > -k.
> > _______________________________________________
> > grass-user mailing list
> > grass-user@lists.osgeo.org
> > https://lists.osgeo.org/mailman/listinfo/grass-user
> _______________________________________________
> grass-user mailing list
> grass-user@lists.osgeo.org
> https://lists.osgeo.org/mailman/listinfo/grass-user
On 2019-01-29 at 11:48 +0100, st_kiefer@web.de wrote...
Give it a try. ps.map is not that complicated. The manual page even
offers an out of the box template for instant results (just scroll to
the end). And if you get familiar with that tool you can produce very
convincing graphics for publications, with graphically additions of
your liking.
You're right - it is easy.
One issue - I can't reference map@mapset. I have to g.copy map@mapset,map and then reference just "map". Am I missing something or is this a real limitation?
Give it a try. ps.map is not that complicated. The manual page even
offers an out of the box template for instant results (just scroll to
the end). And if you get familiar with that tool you can produce very
convincing graphics for publications, with graphically additions of
your liking.
You’re right - it is easy.
One issue - I can’t reference map@mapset. I have to g.copy map@mapset,map and then reference just “map”. Am I missing something or is this a real limitation?
I just tested with the cartographic composer GUI (g.gui.psmap) and with command line ps.map, and as long as the other mapset is accessible, no problems with fully qualified map names, i.e., map@mapset. No need to copy maps, you can use map@mapset in the instruction file
On 2019-01-29 at 18:42 +0100, Veronica Andreo <veroandreo@gmail.com> wrote...
I just tested with the cartographic composer GUI (g.gui.psmap) and
with command line ps.map, and as long as the other mapset is
accessible, no problems with fully qualified map names, i.e.,
map@mapset. No need to copy maps, you can use map@mapset in the
instruction file
OK - maybe there was something else that was causing the problem for me. Thank you for testing and letting me know this does work.
On 2019-01-29 at 11:48 +0100, st_kiefer@web.de wrote...
Give it a try. ps.map is not that complicated. The manual page even
offers an out of the box template for instant results (just scroll to
the end). And if you get familiar with that tool you can produce very
convincing graphics for publications, with graphically additions of
your liking.
One more ps.map question. What is the best/easiest method to patch together multiple rasters with different colors?
I have two raster basemaps plus a velocity raster map.
One basemap is the output of r.shade (a colored shaded relief map).
One basemap is the output of r.relief (a grayscale shaded map)
The velocity raster has its own color scale.
I'd like all three in ps.map, but understand there is a one-raster limitation (any good reason for this?). How do I patch them but maintain distinct colors?
"""If you want to show two or more overlapping raster maps you need to combine them with the r.patch module or r.mapcalc's '#' color operator. (see also the r.his and r.composite modules)"""
"""If you want to show two or more overlapping raster maps you need to combine them with the r.patch module or r.mapcalc's '#' color operator. (see also the r.his and r.composite modules)"""
r.mapcalc and "r#..." to split 5 different rasters into RGB channels.
r.patch'ing 3x (5x r, 5x g, 5x b)
then rgb displaying the patched rasters in ps.map.
r.blend looks easier. But I'm not sure how to keep things spread evenly and looking good for >2 rasters.
Is there any deep technical reason ps.map does not accept >1 raster? I don't want to start GUI programming, but from the command line it seems like this could be a tractable first major contribution to the GRASS code, depending on the reasons it doesn't exist.
Hi Ken,
unfotunately i have not tested that so far, but outside grass I used virtual raster many times for this purpose. You might try to harness r.buildvrt to combine different raster-layer (or have a look for GDAL .vrt-files). So i use this to keep smal raster files but get large combined extends. This should work for overlappings as well. But as I said, I did not verify this.
Ken Mankoff <mankoff@gmail.com> hat am 2. Februar 2019 um 11:51 geschrieben:
Hello,
On 2019-01-29 at 11:48 +0100, st_kiefer@web.de wrote...
> Give it a try. ps.map is not that complicated. The manual page even
> offers an out of the box template for instant results (just scroll to
> the end). And if you get familiar with that tool you can produce very
> convincing graphics for publications, with graphically additions of
> your liking.
One more ps.map question. What is the best/easiest method to patch together multiple rasters with different colors?
I have two raster basemaps plus a velocity raster map.
One basemap is the output of r.shade (a colored shaded relief map).
One basemap is the output of r.relief (a grayscale shaded map)
The velocity raster has its own color scale.
I'd like all three in ps.map, but understand there is a one-raster limitation (any good reason for this?). How do I patch them but maintain distinct colors?