|
@@ -298,8 +298,11 @@ OGRGeometryH create_polygon(struct Map_info *In, int area,
|
|
|
|
|
|
/* Area */
|
|
/* Area */
|
|
for (j = 0; j < Points->n_points; j++) {
|
|
for (j = 0; j < Points->n_points; j++) {
|
|
- OGR_G_AddPoint(ring, Points->x[j], Points->y[j],
|
|
|
|
- Points->z[j]);
|
|
|
|
|
|
+ if (Vect_is_3d(In))
|
|
|
|
+ OGR_G_AddPoint(ring, Points->x[j], Points->y[j],
|
|
|
|
+ Points->z[j]);
|
|
|
|
+ else
|
|
|
|
+ OGR_G_AddPoint_2D(ring, Points->x[j], Points->y[j]);
|
|
}
|
|
}
|
|
|
|
|
|
OGR_G_AddGeometryDirectly(Ogr_geometry, ring);
|
|
OGR_G_AddGeometryDirectly(Ogr_geometry, ring);
|
|
@@ -311,8 +314,11 @@ OGRGeometryH create_polygon(struct Map_info *In, int area,
|
|
|
|
|
|
ring = OGR_G_CreateGeometry(wkbLinearRing);
|
|
ring = OGR_G_CreateGeometry(wkbLinearRing);
|
|
for (j = 0; j < Points->n_points; j++) {
|
|
for (j = 0; j < Points->n_points; j++) {
|
|
- OGR_G_AddPoint(ring, Points->x[j], Points->y[j],
|
|
|
|
- Points->z[j]);
|
|
|
|
|
|
+ if(Vect_is_3d(In))
|
|
|
|
+ OGR_G_AddPoint(ring, Points->x[j], Points->y[j],
|
|
|
|
+ Points->z[j]);
|
|
|
|
+ else
|
|
|
|
+ OGR_G_AddPoint_2D(ring, Points->x[j], Points->y[j]);
|
|
}
|
|
}
|
|
OGR_G_AddGeometryDirectly(Ogr_geometry, ring);
|
|
OGR_G_AddGeometryDirectly(Ogr_geometry, ring);
|
|
}
|
|
}
|