-1

I am using Java, Geotools and JTS.

I have the envelope geometry of a large polygon's geometry.

I want to split it up into a collection of polygons that are all 1 km by 1 km wide.

Any idea for how to do this? Thank you. Peter

Michael-O
  • 18,123
  • 6
  • 55
  • 121
Peter
  • 21
  • 3

2 Answers2

0

I noticed that my approach is nonsense !

As the earth is not flat, you can not split a polygon into real squares with identical width/length !

If you did, the squares would overlap.

Peter
  • 21
  • 3
0

You need to use a planar projection and the GeoTools vector GridFeatureBuilder.

There is example code (using India) in my answer to this question.

enter image description here

Ian Turton
  • 10,018
  • 1
  • 28
  • 47