[GRASS-dev] convergence angle

Hamish hamish_b at yahoo.com
Wed Oct 22 01:07:21 EDT 2008


Hamish:
> > I am trying to add this as "g.region -n" now, some questions:
> > 
> > 1) local_proto.h: what's next in this series:
> > #define PRINT_REG    0x01
> > #define PRINT_SH     0x02
> > #define PRINT_LL     0x04
> > #define PRINT_EXTENT 0x08
> > #define PRINT_CENTER 0x10
> > #define PRINT_METERS 0x20
> > #define PRINT_3D     0x40
> > #define PRINT_MBBOX  0x80
> > 
> > #define PRINT_NANGLE 0x ???

Glynn:
> #define PRINT_NANGLE 0x100

ok, thanks. I'd tried that but a local braindead bug made it seem not to
work.


> > 3) The compiler complains that arg 2 of pj_factors(, oproj.pj,) is of
> > an incompatible pointer type. If I make it *oproj.pj it doesn't
> > complain but the output fact.conv is always 0.00000.
> 
> This is a bug in GRASS' gprojects.h. It uses projPJ* where it should
> use projPJ. projPJ is already a pointer:
> 
> 	#if !defined(PROJECTS_H)
> 	    ...
> 	    typedef void *projPJ;
> 	    ...
> 	#else
> 	    ...
> 	    typedef PJ *projPJ;
> 	    ...
> 	#endif
> 
> I've applied this in 7.0:
> 
> 	--- include/gprojects.h	(revision 33947)
> 	+++ include/gprojects.h	(working copy)
> 	@@ -32,7 +32,7 @@
> 	 
> 	 struct pj_info
> 	 {
> 	-    projPJ *pj;
> 	+    projPJ pj;
> 	     double meters;
> 	     int zone;
> 	     char proj[100];
> 
> It doesn't result in a warning in GRASS because PROJECTS_H isn't
> defined, so the void* version is used, and implicit casts to/from
> void* never generate a warning.
> 
> Your code should be using oproj.pj, not *oproj.pj.


hmm, I wonder if these are still ok-
general/g.proj/output.c:102
general/g.region/printwindow.c:263
general/g.region/printwindow.c:646
lib/proj/convert.c:112
lib/proj/convert.c:229
raster/r.sun/main.c:490
raster/r.sunmask/g_solposition.c:119(+)



I have it working now, see attached (diff is vs. devbr6) "g.region -n"
comments?

spearfish example:  (angle is < 1 deg so not a great example)
eval `g.region -ng`
d.grid -g 0:01
echo -e "rotate $converge_angle\nsymbol extra/n_arrow1 150 50 50" | d.graph


TODO: The pj_* code in g.region/printwindow.c should be put into a
function as it is many lines long and repeated 3 times in that file.


thanks
Hamish



      
-------------- next part --------------
A non-text attachment was scrubbed...
Name: conv_angle.diff
Type: text/x-patch
Size: 6198 bytes
Desc: not available
Url : http://lists.osgeo.org/pipermail/grass-dev/attachments/20081021/93ccb828/conv_angle.bin


More information about the grass-dev mailing list