Skip to content

Commit

Permalink
v.in.ogr: fix main.c
Browse files Browse the repository at this point in the history
  • Loading branch information
lbartoletti authored and Charlie Root committed Nov 1, 2023
1 parent b48aeee commit 78fddaa
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions vector/v.in.ogr/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -1249,7 +1249,6 @@ int main(int argc, char *argv[])
/* Ogr_geometry from OGR_F_GetGeomFieldRef() should not be
* modified. */
Ogr_geometry = OGR_F_GetGeomFieldRef(Ogr_feature, i);
Ogr_geometry = OGR_F_GetGeometryRef(Ogr_feature);
if (Ogr_geometry == NULL) {
nogeom++;
}
Expand Down Expand Up @@ -1558,8 +1557,9 @@ int main(int argc, char *argv[])
Ogr_featuredefn = OGR_L_GetLayerDefn(Ogr_layer);

igeom = -1;
igeom =
OGR_FD_GetGeomFieldIndex(Ogr_featuredefn, param.geom->answer);
if (param.geom->answer)
igeom = OGR_FD_GetGeomFieldIndex(Ogr_featuredefn,
param.geom->answer);

cat = 0; /* field = layer + 1 */
feature_count = 0;
Expand Down Expand Up @@ -1606,7 +1606,6 @@ int main(int argc, char *argv[])
continue; /* use only geometry defined via param.geom */

Ogr_geometry = OGR_F_GetGeomFieldRef(Ogr_feature, i);
Ogr_geometry = OGR_F_GetGeometryRef(Ogr_feature);
if (Ogr_geometry != NULL) {
centroid(Ogr_geometry, Centr, &si, layer + 1, area_cat,
min_area, type);
Expand Down

0 comments on commit 78fddaa

Please sign in to comment.