Stand With Ukraine

Wednesday, August 24, 2011

To which cell the point belongs

Recently I was relating measurement points and grid cells, using shapely's Polygon.intersect method. And was lucky enough to bump into the situation where the point, which corresponds to a real observation station, was not inside any grid cell. Though it was inside the simulation domain judging by its coordinates. Fortunately we got Polygon.buffer method, which allowed me to extend the polygons, in order to make sure that every point inside the domain will fall into some cell. The length of the buffer was selected as 0.01 * (cell edge).




No comments: