Skip to content
This repository was archived by the owner on Aug 26, 2025. It is now read-only.
This repository was archived by the owner on Aug 26, 2025. It is now read-only.

Can't directly deal with Northern Hemisphere latitudes #35

@ghost

Description

It might be good to add a statement to the readme pointing out that this code employs a coordinate system in which Y axis values decrease from bottom to top. Thus, it will choke (silently) in conventional geomapping applications using lat/lon coordinates (because latitude increases from bottom to top of a north-at-top map).

Short of wading into the code to patch that, users can quickly and easily transform their sites and bbox latitudes via this function so that they will work with this library. Just use this function to transform your latitudes:
y2 = min + max - y1
where y1 = latitude, y2 = transformed latitude, min = minimum latitude (of the sites or bbox) and max = maximum latitude (of the sites or bbox). What this function does, in essence, is to flip your map vertically, so that the transformed map's y axis direction corresponds to the coordinate system the code expects. Then, after calculating the voronoi cells, transform their vertices' y coordinates back to map latitudes using the same function (i.e., flip the voronoi cells vertically, to conform to 'north up').

Note that no transformation of longitudes is required; this code's coordinate system expects x values to increase from left to right, which is what longitude does too, and the code handles negative longitudes just fine as is. But I have not looked into what happens if your map spans the equator or the prime meridian, nor have I checked whether it handles negative latitudes (okay, okay: I'm obviously U.S.-centric).

I know I would have found a sentence in the readme to this effect to be a real time-saver. But that said, thanks so much for this great code.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions