0

I am storing the bbox of layers as strings, as the following string :

var layerExtent='[768039.2602094524, 5772524.37609651, 2313901.7202488566, 7435794.111581946]'

and I'm using this method to create a polygon from this bbox(extent) :

var bboxPolygon = turf.bboxPolygon(layerExtent);

but the polygon created has a weird coordinates so I can't use it to check intersection with other polygon with turf using:

var intersection = turf.intersect(bboxPolygon , item);

The structure of this polygon is as following: enter image description here

so no intersection is detected, can you please give me ideas how make this work ? can I create a proper polygon from extents so I could use it to check for intersection with other polygons ?

1
  • Welcome to GIS SE! As a new user be sure to take the Tour to learn about our focussed Q&A format. Please include any code or error messages as text rather than pictures so that they are available to future searches.
    – PolyGeo
    Jun 3, 2016 at 8:36

1 Answer 1

-1

The reason was that the turf.bboxPolygon takes a list of floats/numbers and not a string

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.