Suggestions on splitting a polygon into rectangles

06-19-2019 08:05 PM
New Contributor II

I'm currently using turf.js to split a polygon into rectangles of a specified length & width. It's a modification of the squareGrid function:

I'm hoping there is a way to achieve this using the ArcGIS JS API. It would avoid some messy converting code to get the polygon into GeoJSON for Turf.js to process.

Does anyone have any suggestions on where to look?


0 Kudos
1 Reply
Occasional Contributor

Hi Adam,

You can use the cut property of the GeometryService class of Esri JavaScript API 4.11 (or 3.28, I prefer 4.11) to do this. Here is some documentation for you: GeometryService | ArcGIS API for JavaScript 4.11 & GeometryService | API Reference | ArcGIS API for JavaScript 3.28 

0 Kudos