Skip to content

Commit

Permalink
libgis: add read/write functions for WKT and srid (#976)
Browse files Browse the repository at this point in the history
GRASS native projection information is reaching its limits in representing CRS's, while PROJ and GDAL have been substantially enhanced.Use WKT or authority code if possible to convert to different formats

+ libgis: read/write functions for WKT and spatial reference id as recognized by PROJ

+ g.proj: use WKT or authority code if possible
  • Loading branch information
metzm committed Feb 19, 2021
1 parent 31c1ec2 commit 92dfbd8
Show file tree
Hide file tree
Showing 11 changed files with 750 additions and 108 deletions.
12 changes: 10 additions & 2 deletions general/g.proj/create.c
Expand Up @@ -10,8 +10,8 @@ void create_location(const char *location)
{
int ret;

ret = G_make_location_epsg(location, &cellhd, projinfo, projunits,
projepsg);
ret = G_make_location_crs(location, &cellhd, projinfo, projunits,
projepsg, projwkt, projsrid);
if (ret == 0)
G_message(_("Location <%s> created"), location);
else if (ret == -1)
Expand Down Expand Up @@ -59,6 +59,14 @@ void modify_projinfo()
G_write_key_value_file(path, projepsg);
}

if (projwkt != NULL) {
G_write_projwkt(NULL, projwkt);
}

if (projsrid != NULL) {
G_write_projsrid(NULL, projsrid);
}

if ((old_cellhd.zone != cellhd.zone) ||
(old_cellhd.proj != cellhd.proj)) {
/* Recreate the default, and current window files if projection
Expand Down

0 comments on commit 92dfbd8

Please sign in to comment.