According to the plugin Indexed Vector Grid which builds a polygon raster from shape bounds and name every cell as "A1, A2, A3 ...", I need a more advance solution, which I can use for hundreds of maps. I'm working with a PostGIS database and would like to have a (fast) SQL solution for that issue.

The final result should look like this:

The final result should look like this:

For every overview (bounding box of a city), I need a grid of 6x6 cells.

The table ('ov_boxes') of my bounding boxes looks like that:

table of my bounding boxes

Is there a SQL solution possible? Or do I have to go the python way?


There are some posts around that mention functions for so-called fishnets. For instance: How to create a regular polygon grid in PostGIS?

With that function you could do something like: SELECT name, scale, id_qgis, (ST_CreateFishnet(6,6,width/6,height/6)).* FROM boundingboxes You output would have numbers for columns and rows which you can easily translate into something like A1


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.