[GRASS-dev] Re: [GRASS-windows] Problems with Mapcanvas

Doug_Newcomb at fws.gov Doug_Newcomb at fws.gov
Mon Nov 26 12:21:49 EST 2007


Glynn,
      Sorry to be so tardy.  Out for a long Thanksgiving weekend.  Hope
this helps.  I will try to create a new mapset with the wingrass 6.3-RC2
and see if the problem persists.

      Doug


[dnewcomb at yoda2 grass]$ od -t x1z PROJ_INFO
0000000 6e 61 6d 65 3a 20 4c 61 6d 62 65 72 74 20 43 6f  >name: Lambert Co<
0000020 6e 66 6f 72 6d 61 6c 20 43 6f 6e 69 63 0d 0a 70  >nformal Conic..p<
0000040 72 6f 6a 3a 20 6c 63 63 0a 64 61 74 75 6d 3a 20  >roj: lcc.datum: <
0000060 6e 61 64 38 33 0a 65 6c 6c 70 73 3a 20 67 72 73  >nad83.ellps: grs<
0000100 38 30 0a 6c 61 74 5f 31 3a 20 33 36 2e 31 36 36  >80.lat_1: 36.166<
0000120 36 36 36 36 36 36 36 36 36 36 36 0a 6c 61 74 5f  >66666666666.lat_<
0000140 32 3a 20 33 34 2e 33 33 33 33 33 33 33 33 33 33  >2: 34.3333333333<
0000160 33 33 33 34 0a 6c 61 74 5f 30 3a 20 33 33 2e 37  >3334.lat_0: 33.7<
0000200 35 0a 6c 6f 6e 5f 30 3a 20 2d 37 39 0a 78 5f 30  >5.lon_0: -79.x_0<
0000220 3a 20 36 30 39 36 30 31 2e 32 32 0a 79 5f 30 3a  >: 609601.22.y_0:<
0000240 20 30 0a 6e 6f 5f 64 65 66 73 3a 20 64 65 66 69  > 0.no_defs: defi<
0000260 6e 65 64 0a 74 6f 77 67 73 38 34 3a 20 30 2e 30  >ned.towgs84: 0.0<
0000300 30 30 2c 30 2e 30 30 30 2c 30 2e 30 30 30 0a     >00,0.000,0.000.<
0000317
[dnewcomb at yoda2 grass]$ od -t x1z PROJ_INFO|grep 0d
0000020 6e 66 6f 72 6d 61 6c 20 43 6f 6e 69 63 0d 0a 70  >nformal Conic..p<



Doug Newcomb
USFWS
Raleigh, NC
919-856-4520 ext. 14 doug_newcomb at fws.gov
---------------------------------------------------------------------------------------------------------

The opinions I express are my own and are not representative of the
official policy of the U.S.Fish and Wildlife Service or Dept. of Interior.
Life is too short for undocumented, proprietary data formats.


                                                                           
             Glynn Clements                                                
             <glynn at gclements.                                             
             plus.com>                                                  To 
             Sent by:                  Hamish <hamish_nospam at yahoo.com>    
             grass-windows-bou                                          cc 
             nces at lists.osgeo.         Doug_Newcomb at fws.gov,               
             org                       grass-dev at lists.osgeo.org,          
                                       grass-windows at lists.osgeo.org       
                                                                   Subject 
             11/21/2007 02:05          Re: [GRASS-dev] Re: [GRASS-windows] 
             PM                        Problems with Mapcanvas             
                                                                           
                                                                           
                                                                           
                                                                           
                                                                           
                                                                           





Hamish wrote:

> > > Contents of PERMANENT/PROJ_INFO file:
> > >
> > > name: Lambert Conformal Conic
> > > proj: lcc
> > > datum: nad83
> > > ellps: grs80
> > > lat_1: 36.16666666666666
> > > lat_2: 34.33333333333334
> > > lat_0: 33.75
> > > lon_0: -79
> > > x_0: 609601.22
> > > y_0: 0
> > > no_defs: defined
> > > towgs84: 0.000,0.000,0.000
>
> Glynn:
> > That doesn't tell me the one thing I really need to know: whether
> > there are CR characters in the file.
> >
> > Try "od -t x1z PROJ_INFO"; look for any occurrences of "0d" in the
> > output.
>
>
> perhaps this patch helps:
>
> Index: lib/gis/key_value2.c
> ===================================================================
> RCS file: /home/grass/grassrepository/grass6/lib/gis/key_value2.c,v
> retrieving revision 2.3
> diff -u -r2.3 key_value2.c
> --- lib/gis/key_value2.c        14 Apr 2007 23:01:59 -0000      2.3
> +++ lib/gis/key_value2.c        21 Nov 2007 01:11:54 -0000
> @@ -32,7 +32,7 @@
>      kv = G_create_key_value();
>      if (kv == NULL)
>         return NULL;
> -    while (G_getl(buf, sizeof buf, fd) != 0)
> +    while (G_getl2(buf, sizeof buf, fd) != 0)
>      {
>         key = value = buf;
>         while (*value && *value != ':')

Probably. Although we should also change the code which is putting the
CRs there in the first place (assuming that's what's happening).

For 7.x, we should probably just rename G_getl2 -> G_getl. There can't
be many cases where we actually want to read native line ends.

> also, should that be using "(buf, sizeof(buf)-1, fd" ?

Yes and no. The current behaviour of G_getl2() requires it, but it's
G_getl2() which should be changed to match G_getl(), fgets() etc.

--
Glynn Clements <glynn at gclements.plus.com>
_______________________________________________
grass-windows mailing list
grass-windows at lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/grass-windows




More information about the grass-windows mailing list