Changeset 68131
- Timestamp:
- Mar 24, 2016, 7:12:07 AM (8 years ago)
- File:
-
- 1 edited
-
grass/trunk/lib/proj/convert.c (modified) (7 diffs)
Legend:
- Unmodified
- Added
- Removed
-
grass/trunk/lib/proj/convert.c
r68128 r68131 142 142 } 143 143 G_free(proj4mod); 144 sysname = G_find_key_value("name", proj_info); 145 if (sysname) 146 OSRSetProjCS(hSRS, sysname); 144 147 145 148 if ((errcode = OSRExportToWkt(hSRS, &wkt)) != OGRERR_NONE) { … … 153 156 haveparams = GPJ__get_datum_params(proj_info, &datum, ¶ms); 154 157 155 if (ellpskv != NULL)158 if (ellpskv != NULL) 156 159 ellps = G_store(ellpskv); 157 160 else … … 279 282 char *pszProj4 = NULL, *pszRemaining; 280 283 char *pszProj = NULL; 284 const char *pszProjCS = NULL; 281 285 char *datum = NULL; 282 286 struct gpj_datum dstruct; … … 358 362 pszValue = "defined"; 359 363 360 364 /* projection name */ 361 365 if (G_strcasecmp(pszToken, "proj") == 0) { 362 366 /* The ll projection is known as longlat in PROJ.4 */ … … 365 369 366 370 pszProj = pszValue; 367 continue;368 371 } 369 372 … … 384 387 G_set_key_value(pszToken, pszValue, temp_projinfo); 385 388 } 389 if (!pszProj) 390 G_warning(_("No projection name! Projection parameters likely to be meaningless.")); 386 391 387 392 *projinfo = G_create_key_value(); 388 393 389 394 /* -------------------------------------------------------------------- */ 390 /* Derive the user name for the projection. */ 391 /* -------------------------------------------------------------------- */ 392 if (pszProj) { 395 /* Derive the user name for the coordinate system. */ 396 /* -------------------------------------------------------------------- */ 397 pszProjCS = OSRGetAttrValue(hSRS, "PROJCS", 0); 398 if (!pszProjCS) 399 pszProjCS = OSRGetAttrValue(hSRS, "GEOGCS", 0); 400 401 if (pszProjCS) { 402 G_set_key_value("name", pszProjCS, *projinfo); 403 } 404 else if (pszProj) { 393 405 char path[4095]; 394 406 char name[80]; 407 408 /* use name of the projection as name for the coordinate system */ 395 409 396 410 sprintf(path, "%s/etc/proj/projections", G_gisbase()); … … 400 414 else 401 415 G_set_key_value("name", pszProj, *projinfo); 402 403 G_set_key_value("proj", pszProj, *projinfo); 404 } 405 else 406 G_warning(_("No projection name! Projection parameters likely to be meaningless.")); 416 } 407 417 408 418
Note:
See TracChangeset
for help on using the changeset viewer.
