javalatitude-longitudejtsboundinggeographic-lib

Java - Generate internal bounding boxes starting from a bigger geographic bounding box


I need a way to generate internal bounding boxes (e.g. 1x1km squares) starting from a bigger geographic bounding box.

For example, starting from London bounding box, I want to get all the 1x1km bounding boxes within that geographic area.

Formats:

Is there a Java library implementing that feature or even just an algorithm? I also tried Java JTS, but it seems useless for that purpose.

Thanks in advance.


Solution

  • Your requirements are contradictionary:

    Either you have a lat,lon grid where all cells have same longitudial Span and latiudinal span. or you have a meter based grid, where all cells have meter based coordinates, using an coordinate transformation. E.g UTM.

    Both at the same time is not possible, especially for the longitude coordinate component.

    The simplest approach is to use lat, lon units.
    You have to implement that for yourself.