[GRASS-dev] [GRASS GIS] #3016: Add option to set scalebar length

#3016: Add option to set scalebar length
-----------------------------------------------+-------------------------
Reporter: annakrat | Owner: grass-dev@…
     Type: enhancement | Status: new
Priority: normal | Milestone: 7.3.0
Component: Display | Version:
Keywords: d.barscale, gsoc2016, cartography | CPU: Unspecified
Platform: All |
-----------------------------------------------+-------------------------
Currently the scalebar automatically selects the right size. It would be
nice to be able to customize the length. Also adding custom label would be
useful, for example for cases when I don't want 'meters' but only 'm'.

--
Ticket URL: <https://trac.osgeo.org/grass/ticket/3016&gt;
GRASS GIS <https://grass.osgeo.org>

#3016: Add option to set scalebar length
--------------------------+-----------------------------------------------
  Reporter: annakrat | Owner: grass-dev@…
      Type: enhancement | Status: new
  Priority: normal | Milestone: 7.3.0
Component: Display | Version: unspecified
Resolution: | Keywords: d.barscale, gsoc2016, cartography
       CPU: Unspecified | Platform: All
--------------------------+-----------------------------------------------
Changes (by wenzeslaus):

* version: => unspecified

Comment:

I think the size should be specified in map units, for example user can
say `size=250` to get 250m scale bar. This seems like a simple and
actually a desired option. What are the units there probably depend on the
rest of the implementation or interface of d.barscale. With the current
implementation it would be probably meters by default but it should be
feet when the `-f` is used.

--
Ticket URL: <https://trac.osgeo.org/grass/ticket/3016#comment:1&gt;
GRASS GIS <https://grass.osgeo.org>

#3016: Add option to set scalebar length
--------------------------+-----------------------------------------------
  Reporter: annakrat | Owner: grass-dev@…
      Type: enhancement | Status: new
  Priority: normal | Milestone: 7.3.0
Component: Display | Version: unspecified
Resolution: | Keywords: d.barscale, gsoc2016, cartography
       CPU: Unspecified | Platform: All
--------------------------+-----------------------------------------------
Changes (by lazaa):

* Attachment "d.barscale.diff" added.

Added options length and segment to customate barscale. Added -u flag for
display unit symbol/name.

--
Ticket URL: <https://trac.osgeo.org/grass/ticket/3016&gt;
GRASS GIS <https://grass.osgeo.org>

#3016: Add option to set scalebar length
--------------------------+-----------------------------------------------
  Reporter: annakrat | Owner: grass-dev@…
      Type: enhancement | Status: new
  Priority: normal | Milestone: 7.3.0
Component: Display | Version: unspecified
Resolution: | Keywords: d.barscale, gsoc2016, cartography
       CPU: Unspecified | Platform: All
--------------------------+-----------------------------------------------

Comment (by lazaa):

Replying to [comment:1 wenzeslaus]:
> I think the size should be specified in map units, for example user can
say `size=250` to get 250m scale bar. This seems like a simple and
actually a desired option. What are the units there probably depend on the
rest of the implementation or interface of d.barscale. With the current
implementation it would be probably meters by default but it should be
feet when the `-f` is used.

I added option{{{length}}}, so the size can be specified in map units. By
defaults in meters, with {{{-f}}} flag in feet. I'm not sure it's the best
solution. If user wants a barscale of size let's say 150 miles he has to
convert 150 miles into feet.

--
Ticket URL: <https://trac.osgeo.org/grass/ticket/3016#comment:2&gt;
GRASS GIS <https://grass.osgeo.org>

#3016: Add option to set scalebar length
--------------------------+-----------------------------------------------
  Reporter: annakrat | Owner: grass-dev@…
      Type: enhancement | Status: new
  Priority: normal | Milestone: 7.3.0
Component: Display | Version: unspecified
Resolution: | Keywords: d.barscale, gsoc2016, cartography
       CPU: Unspecified | Platform: All
--------------------------+-----------------------------------------------
Changes (by lazaa):

* Attachment "d.barscale.2.diff" added.

Updated patch with flag -n to display small north-arrow symbol next to
barscale.

--
Ticket URL: <https://trac.osgeo.org/grass/ticket/3016&gt;
GRASS GIS <https://grass.osgeo.org>

#3016: Add option to set scalebar length
--------------------------+-----------------------------------------------
  Reporter: annakrat | Owner: grass-dev@…
      Type: enhancement | Status: new
  Priority: normal | Milestone: 7.3.0
Component: Display | Version: unspecified
Resolution: | Keywords: d.barscale, gsoc2016, cartography
       CPU: Unspecified | Platform: All
--------------------------+-----------------------------------------------

Comment (by annakrat):

Replying to [comment:2 lazaa]:
> Replying to [comment:1 wenzeslaus]:
> > I think the size should be specified in map units, for example user
can say `size=250` to get 250m scale bar. This seems like a simple and
actually a desired option. What are the units there probably depend on the
rest of the implementation or interface of d.barscale. With the current
implementation it would be probably meters by default but it should be
feet when the `-f` is used.
>
> I added option{{{length}}}, so the size can be specified in map units.
By defaults in meters, with {{{-f}}} flag in feet. I'm not sure it's the
best solution. If user wants a barscale of size let's say 150 miles he has
to convert 150 miles into feet.

I was thinking it would be good to add new option `units` with options
meters, kilometers, feet and miles instead of the flag `-f`. This flag
would have to stay there for compatibility reasons but would be marked
obsolete. By default it would use map units, see m.measure for example.

Also having option to set custom label (overriding the unit) would enable
working in XY location with mm for example. I think it would bring more
flexibility comparing to the `-u` flag, so users could choose whether they
want 'meters' (current default) or 'm' or name of the units in other
languages.

--
Ticket URL: <https://trac.osgeo.org/grass/ticket/3016#comment:3&gt;
GRASS GIS <https://grass.osgeo.org>

#3016: Add option to set scalebar length
--------------------------+-----------------------------------------------
  Reporter: annakrat | Owner: grass-dev@…
      Type: enhancement | Status: new
  Priority: normal | Milestone: 7.3.0
Component: Display | Version: unspecified
Resolution: | Keywords: d.barscale, gsoc2016, cartography
       CPU: Unspecified | Platform: All
--------------------------+-----------------------------------------------

Comment (by mlennert):

All of Adam's patches concerning d.barscale give a lot of fails when
trying to apply them to trunk. Maybe this is linked to the recent running
of the indent script on the version in trunk ?

--
Ticket URL: <https://trac.osgeo.org/grass/ticket/3016#comment:4&gt;
GRASS GIS <https://grass.osgeo.org>

#3016: Add option to set scalebar length
--------------------------+-----------------------------------------------
  Reporter: annakrat | Owner: grass-dev@…
      Type: enhancement | Status: new
  Priority: normal | Milestone: 7.3.0
Component: Display | Version: unspecified
Resolution: | Keywords: d.barscale, gsoc2016, cartography
       CPU: Unspecified | Platform: All
--------------------------+-----------------------------------------------

Comment (by annakrat):

Replying to [comment:4 mlennert]:
> All of Adam's patches concerning d.barscale give a lot of fails when
trying to apply them to trunk. Maybe this is linked to the recent running
of the indent script on the version in trunk ?

I think so. He used indent script on his working copy, so he has a lot of
whitespace changes. So I decided to commit the whitespace changes
separately. Adam should upload the new patches just with the real code
changes. I am not sure what's the best way to get rid of whitespace
changes in a patch for now, probably apply it to older version of the file
and create a new diff without whitespace or use meld.

--
Ticket URL: <https://trac.osgeo.org/grass/ticket/3016#comment:5&gt;
GRASS GIS <https://grass.osgeo.org>

#3016: Add option to set scalebar length
--------------------------+-----------------------------------------------
  Reporter: annakrat | Owner: grass-dev@…
      Type: enhancement | Status: new
  Priority: normal | Milestone: 7.3.0
Component: Display | Version: unspecified
Resolution: | Keywords: d.barscale, gsoc2016, cartography
       CPU: Unspecified | Platform: All
--------------------------+-----------------------------------------------

Comment (by lazaa):

Replying to [comment:3 annakrat]:
> Replying to [comment:2 lazaa]:
> > Replying to [comment:1 wenzeslaus]:
> > > I think the size should be specified in map units, for example user
can say `size=250` to get 250m scale bar. This seems like a simple and
actually a desired option. What are the units there probably depend on the
rest of the implementation or interface of d.barscale. With the current
implementation it would be probably meters by default but it should be
feet when the `-f` is used.
> >
> > I added option{{{length}}}, so the size can be specified in map units.
By defaults in meters, with {{{-f}}} flag in feet. I'm not sure it's the
best solution. If user wants a barscale of size let's say 150 miles he has
to convert 150 miles into feet.
>
> I was thinking it would be good to add new option `units` with options
meters, kilometers, feet and miles instead of the flag `-f`. This flag
would have to stay there for compatibility reasons but would be marked
obsolete. By default it would use map units, see m.measure for example.
>

Why the flag {{{-f}}} would have to stay? If I add option {{{units}}} it's
not necessary anymore, is it?

> Also having option to set custom label (overriding the unit) would
enable working in XY location with mm for example. I think it would bring
more flexibility comparing to the `-u` flag, so users could choose whether
they want 'meters' (current default) or 'm' or name of the units in other
languages.

--
Ticket URL: <https://trac.osgeo.org/grass/ticket/3016#comment:6&gt;
GRASS GIS <https://grass.osgeo.org>

On Wed, Jun 1, 2016 at 11:46 AM, GRASS GIS <trac@osgeo.org> wrote:

#3016: Add option to set scalebar length
--------------------------+-----------------------------------------------
  Reporter: annakrat | Owner: grass-dev@…
      Type: enhancement | Status: new
  Priority: normal | Milestone: 7.3.0
Component: Display | Version: unspecified
Resolution: | Keywords: d.barscale, gsoc2016, cartography
       CPU: Unspecified | Platform: All
--------------------------+-----------------------------------------------

Comment (by lazaa):

Replying to [comment:3 annakrat]:
> Replying to [comment:2 lazaa]:
> > Replying to [comment:1 wenzeslaus]:
> > > I think the size should be specified in map units, for example user
can say `size=250` to get 250m scale bar. This seems like a simple and
actually a desired option. What are the units there probably depend on the
rest of the implementation or interface of d.barscale. With the current
implementation it would be probably meters by default but it should be
feet when the `-f` is used.
> >
> > I added option{{{length}}}, so the size can be specified in map units.
By defaults in meters, with {{{-f}}} flag in feet. I'm not sure it's the
best solution. If user wants a barscale of size let's say 150 miles he has
to convert 150 miles into feet.
>
> I was thinking it would be good to add new option `units` with options
meters, kilometers, feet and miles instead of the flag `-f`. This flag
would have to stay there for compatibility reasons but would be marked
obsolete. By default it would use map units, see m.measure for example.
>

Why the flag {{{-f}}} would have to stay? If I add option {{{units}}} it's
not necessary anymore, is it?

I can't post on Trac from university (IndexError: list index out of range)

The flag should stay there (and work as before) to keep backwards
compatibility until grass 8 is released. If you remove it, some user
scripts will break.

> Also having option to set custom label (overriding the unit) would
enable working in XY location with mm for example. I think it would bring
more flexibility comparing to the `-u` flag, so users could choose whether
they want 'meters' (current default) or 'm' or name of the units in other
languages.

--
Ticket URL: <https://trac.osgeo.org/grass/ticket/3016#comment:6&gt;
GRASS GIS <https://grass.osgeo.org>

_______________________________________________
grass-dev mailing list
grass-dev@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/grass-dev

#3016: Add option to set scalebar length
--------------------------+-----------------------------------------------
  Reporter: annakrat | Owner: grass-dev@…
      Type: enhancement | Status: new
  Priority: normal | Milestone: 7.3.0
Component: Display | Version: unspecified
Resolution: | Keywords: d.barscale, gsoc2016, cartography
       CPU: Unspecified | Platform: All
--------------------------+-----------------------------------------------

Comment (by neteler):

Copied here from ML due to trac problems:

On Wed, Jun 1, 2016 at 6:29 PM, Anna Petrášová wrote:
> The flag should stay there (and work as before) to keep backwards
> compatibility until grass 8 is released. If you remove it, some user
> scripts will break.

--
Ticket URL: <https://trac.osgeo.org/grass/ticket/3016#comment:7&gt;
GRASS GIS <https://grass.osgeo.org>

#3016: Add option to set scalebar length
--------------------------+-----------------------------------------------
  Reporter: annakrat | Owner: grass-dev@…
      Type: enhancement | Status: new
  Priority: normal | Milestone: 7.3.0
Component: Display | Version: unspecified
Resolution: | Keywords: d.barscale, gsoc2016, cartography
       CPU: Unspecified | Platform: All
--------------------------+-----------------------------------------------
Changes (by lazaa):

* Attachment "d.barscale3.diff" added.

Added option units

--
Ticket URL: <https://trac.osgeo.org/grass/ticket/3016&gt;
GRASS GIS <https://grass.osgeo.org>

#3016: Add option to set scalebar length
--------------------------+-----------------------------------------------
  Reporter: annakrat | Owner: grass-dev@…
      Type: enhancement | Status: new
  Priority: normal | Milestone: 7.3.0
Component: Display | Version: unspecified
Resolution: | Keywords: d.barscale, gsoc2016, cartography
       CPU: Unspecified | Platform: All
--------------------------+-----------------------------------------------

Comment (by annakrat):

Committed in r68570 with small modifications.

Known issue is that when using `-f`, `label` is ignored.

Testing is very welcome.

--
Ticket URL: <https://trac.osgeo.org/grass/ticket/3016#comment:8&gt;
GRASS GIS <https://grass.osgeo.org>

#3016: Add option to set scalebar length
--------------------------+-----------------------------------------------
  Reporter: annakrat | Owner: grass-dev@…
      Type: enhancement | Status: closed
  Priority: normal | Milestone: 7.3.0
Component: Display | Version: unspecified
Resolution: fixed | Keywords: d.barscale, gsoc2016, cartography
       CPU: Unspecified | Platform: All
--------------------------+-----------------------------------------------
Changes (by annakrat):

* status: new => closed
* resolution: => fixed

Comment:

Backported in r69051.

--
Ticket URL: <https://trac.osgeo.org/grass/ticket/3016#comment:9&gt;
GRASS GIS <https://grass.osgeo.org>

#3016: Add option to set scalebar length
--------------------------+-----------------------------------------------
  Reporter: annakrat | Owner: grass-dev@…
      Type: enhancement | Status: closed
  Priority: normal | Milestone: 7.2.0
Component: Display | Version: unspecified
Resolution: fixed | Keywords: d.barscale, gsoc2016, cartography
       CPU: Unspecified | Platform: All
--------------------------+-----------------------------------------------
Changes (by annakrat):

* milestone: 7.3.0 => 7.2.0

--
Ticket URL: <http://trac.osgeo.org/grass/ticket/3016#comment:10&gt;
GRASS GIS <https://grass.osgeo.org>