4

Abstract

I've decided to use PostGIS for a hobby game project. It requires a lot of units allocated on the surface of a planet. I'd like to model not only the units (simple points), but also their areas of effect (vision, firing range etc.) and the planet's terrain using spatial data and queries.

The problem

I'd like to have a few sampled layers for things like the plant density. I've done a few GIS exercises on my university and observed that raster representation was most commonly used for such data.

The proposed solution and question

The problem with regular raster data is that it's best suited for smaller areas, which are almost flat, whereas I need a full sphere. I've learned about Geodesic Grid technique, which seems to fit my needs perfectly. However, I am not sure how to approach its creation and use in PostGIS. I've found this question, but it doesn't answer all of my needs.

In short, what I'd like to do is to create a model (with a chosen density) and define operations that would allow me to generate (fill in) the data in it, and then sample it back with some filtering.

Remark #1

I can imagine that some sort of clustering (variable density) models could be much more efficient in my scenario (some regions being much more important than the others, and thus needing more data). Would creating such a thing be much more difficult?

Remark #2

The Wikipedia article outlines the icosahedron tesselation procedure. I think I could implement it, but I am wondering if there are any caveats related.

2 Answers 2

2

See the Discrete Global Grids site, specially their software and the grids they've pre-generated. These generate the grids as vectors and you should be able to import them into postgres.

1

I've built an R package called dggridR which wraps around the DGGRID software that Craig suggests in their answer, making it easy to compile and work with. It may be useful to you in exploring different grid possibilities. An example of choosing random cells and plotting them is available here.

A sampling on a discrete global grid

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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