Opened 14 years ago

Last modified 3 years ago

#66 new enhancement

v.out.svg: Standardise the `type' option interpretation

Reported by: 1gray Owned by: grass-dev@…
Priority: minor Milestone: 7.6.2
Component: Vector Version: unspecified
Keywords: v.out.svg Cc:
CPU: Unspecified Platform: Unspecified

Description

Currently v.out.svg interprets its type option in a non-standard way, namely:

  • it's not allowed to specify multiple types per v.out.svg invocation;
  • the name for the area feature type is poly, while it should be area.
  • there's no way to choose only points or centroids for output, only both; similarly for lines and boundaries.

Hence, I suggest the following patch.

Since the patch breaks the compatibility with the former versions of the module, I believe it should only be considered for GRASS 7.

Attachments (2)

v.out.svg-standard-type.diff.gz (1.2 KB ) - added by 1gray 14 years ago.
v.out.svg-standard-type.diff (3.5 KB ) - added by neteler 13 years ago.
Patch redone for current 6.5/7

Download all attachments as: .zip

Change History (15)

by 1gray, 14 years ago

by neteler, 13 years ago

Patch redone for current 6.5/7

comment:1 by neteler, 13 years ago

CPU: Unspecified
Platform: Unspecified

Patch redone for current 6.5/7 (and uploaded uncompressed for easier review). Compiling, I get this warning:

main.c:122: warning: assignment from incompatible pointer type

in reply to:  1 ; comment:2 by glynn, 13 years ago

Replying to neteler:

Patch redone for current 6.5/7 (and uploaded uncompressed for easier review). Compiling, I get this warning:

main.c:122: warning: assignment from incompatible pointer type

The ->answers field is char ** which isn't compatible with const char **.

You can implicitly cast char * to const char *, but not with additional levels of indirection. In theory, a const char * could be wider than a char *, so you can cast these types, but not pointers to them.

char * const * should work.

in reply to:  2 ; comment:3 by 1gray, 13 years ago

Replying to glynn:

Replying to neteler:

Patch redone for current 6.5/7 (and uploaded uncompressed for easier review). Compiling, I get this warning:

main.c:122: warning: assignment from incompatible pointer type

The ->answers field is char ** which isn't compatible with const char **.

You can implicitly cast char * to const char *, but not with additional levels of indirection. In theory, a const char * could be wider than a char *, so you can cast these types, but not pointers to them.

Is this actually permitted by some standard (either C89 or C99)?

char * const * should work.

Do I understand it correctly that it means variable pointer to constant pointer to variable character data?

I think that the part of code in question, once extracted into a separate function, could occasionally be useful when processing constant data. And I'm quite surprised that two functions would be necessary to achieve that instead of just one.

in reply to:  3 comment:4 by glynn, 13 years ago

Replying to 1gray:

You can implicitly cast char * to const char *, but not with additional levels of indirection. In theory, a const char * could be wider than a char *, so you can cast these types, but not pointers to them.

Is this actually permitted by some standard (either C89 or C99)?

Is what permitted? Implicit casts or pointer size varying depending upon whether the target is "const"? The answers are "sometimes" and "yes" respectively, for both C89 and C99.

char * const * should work.

Do I understand it correctly that it means variable pointer to constant pointer to variable character data?

Yes.

comment:5 by martinl, 13 years ago

Component: defaultVector
Keywords: v.out.svg added

comment:6 by martinl, 6 years ago

Milestone: 7.0.07.0.5

comment:7 by martinl, 6 years ago

Milestone: 7.0.57.3.0

comment:8 by martinl, 6 years ago

Milestone: 7.3.07.4.0

Milestone renamed

comment:9 by neteler, 4 years ago

Milestone: 7.4.07.4.1

Ticket retargeted after milestone closed

comment:10 by neteler, 4 years ago

Milestone: 7.4.17.4.2

comment:11 by martinl, 4 years ago

Milestone: 7.4.27.6.0

All enhancement tickets should be assigned to 7.6 milestone.

comment:12 by martinl, 3 years ago

Milestone: 7.6.07.6.1

Ticket retargeted after milestone closed

comment:13 by martinl, 3 years ago

Milestone: 7.6.17.6.2

Ticket retargeted after milestone closed

Note: See TracTickets for help on using tickets.