浏览代码

v.external.out: SRID lost when not exactly defined (see https://trac.osgeo.org/grass/ticket/3262)

git-svn-id: https://svn.osgeo.org/grass/grass/trunk@70385 15284696-431f-4ddb-bdfa-cd5b030d7da7
Martin Landa 8 年之前
父节点
当前提交
31c686d9bf
共有 1 个文件被更改,包括 9 次插入1 次删除
  1. 9 1
      lib/vector/Vlib/open.c

+ 9 - 1
lib/vector/Vlib/open.c

@@ -1395,8 +1395,16 @@ int map_format(struct Map_info *Map)
             
             /* srid (default: 0) */
             p = G_find_key_value("srid", key_val);
-            if (p)
+            if (p) {
                 pg_info->srid = atoi(p);
+            }
+            else {
+                /* not defined by v.external.out, so try if EPSG code
+                 * is defined */
+                p = G_database_epsg_code();
+                if (p)
+                    pg_info->srid = atoi(p);
+            }
             G_debug(1, "PG: srid = %d", pg_info->srid);
             
             /* table name */