소스 검색

vlib/ogr: don't try to write attributes if no dblink is defined

git-svn-id: https://svn.osgeo.org/grass/grass/trunk@48941 15284696-431f-4ddb-bdfa-cd5b030d7da7
Martin Landa 13 년 전
부모
커밋
10ca6e50be
1개의 변경된 파일1개의 추가작업 그리고 1개의 파일을 삭제
  1. 1 1
      lib/vector/Vlib/write_ogr.c

+ 1 - 1
lib/vector/Vlib/write_ogr.c

@@ -72,7 +72,7 @@ off_t V1_write_line_ogr(struct Map_info *Map, int type,
     }
 
     cat = -1; /* no attributes to be written */
-    if (cats->n_cats > 0) {
+    if (cats->n_cats > 0 && Map->dblnk->n_fields > 0) {
 	/* check for attributes */
 	Fi = Vect_get_dblink(Map, 0);
 	if (Fi) {