简体   繁体   English

如何将大型 JTS 多边形拆分为多个 1 km x 1 km 的几何图形?

[英]How to split a large JTS polygon into multiple 1 km by 1 km geometries?

I am using Java, Geotools and JTS.我正在使用 Java、Geotools 和 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.我想把它分成一个多边形的集合,这些多边形都是 1 公里 x 1 公里宽。

Any idea for how to do this?知道如何做到这一点吗? Thank you.谢谢你。 Peter彼得

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.如果你这样做了,方块就会重叠。

You need to use a planar projection and the GeoTools vector GridFeatureBuilder .您需要使用平面投影和 GeoTools 矢量GridFeatureBuilder

There is example code (using India) in my answer to this question .我对这个问题的回答中有示例代码(使用印度)。

在此处输入图片说明

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM