Skip to content

Segfault on rdp_simplify for GeoJSON #16

Closed
@rickogden

Description

@rickogden

rdp_simplify method segfaults when passing GeoJSON data as an array (returns NULL if object or a string). This works if you just pass the coordinate array, but this isn't as described in the documentation.

To recreate:

$geojson = json_decode('{"type":"LineString","coordinates":[[0,0],[1,0],[2,0],[2,1],[2,2],[1,2],[0,2],[0,1],[0,0]]}', true);

var_dump(rdp_simplify($geojson, 1)); //segfault
var_dump(rdp_simplify($geojson['coordinates'], 1)); //works

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions