Skip to content

Commit

Permalink
MVT generation: fix writing of point/multipoint geometries
Browse files Browse the repository at this point in the history
The number associated with the MOVETO command should be the number of
coordinate *pairs*. We wrote twice that number. This caused for
example the OGR MVT driver to reject such geometries.
  • Loading branch information
rouault authored and github-actions[bot] committed Aug 25, 2021
1 parent 292ea2e commit b21ab27
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion mapmvt.c
Original file line number Diff line number Diff line change
Expand Up @@ -319,7 +319,7 @@ int mvtWriteShape( layerObj *layer, shapeObj *shape, VectorTile__Tile__Layer *mv

if(layer->type == MS_LAYER_POINT) {
int idx=0, lastx=0, lasty=0;
mvt_feature->geometry[idx++] = COMMAND(MOVETO, mvt_feature->n_geometry-1);
mvt_feature->geometry[idx++] = COMMAND(MOVETO, (mvt_feature->n_geometry-1) / 2);
for(i=0;i<shape->numlines;i++) {
for(j=0;j<shape->line[i].numpoints;j++) {
mvt_feature->geometry[idx++] = PARAMETER(MS_NINT(shape->line[i].point[j].x)-lastx);
Expand Down

0 comments on commit b21ab27

Please sign in to comment.