Scenario: I am given a layer of point locations called "problems." These will be displayed on a web map. Users will then use the web map interface to create and populate field information for a point layer called "solutions." The difficulty is that one problem can have many solutions, and one solution can solve many problems. The underlying database (PostGIS, in my case) must reflect this.

I have built a few, simple web applications before (including some that allow simple user editing/feature-creation), but I would still classify my experience level with application-development as fairly novice. I am using PostGIS as my database, and I would like to implement the front-end in either Geo-Ext, the OpenGeo Client SDK, or using GeoDjango, but can't figure out how to do it. Any advice?

I am new to this forum, as well. If I can do anything to enhance the quality or clarify the purpose of this post, please let me know.

3 Answers 3


There is a good example on how to implement a many-to many relationship just below your question: your post has different tags, which all relate to different posts. In a database you would implement this with a table which has the id's of posts and labels.

Implementing this in GIS is not really different. You can easily display maps of all solutions or problems this way. The nice thing about spatial databases is that the logic is identical to non-spatial databases.

Combining the info of both in one map will be a bigger challenge. Maybe piecharts can help, but I think you would get much better proposals if you give a more concrete description of what your application actually wants to do.

  • Thanks for the quick response! I had experimented with the idea of using a junction table, but am not sure how that would work with the front end. Would you mind showing me which post had the solution to the many-to-many relationship? I can't seem to find it.
    – user21949
    Nov 19, 2013 at 20:09

Here are some old discussion about this topic that may help you out:

The first one is about MapFish, and it seems that it's not been done yet. The second one is about GeoAlchemy (related to SQLalchemy), but not sure if it can be an easy task to do. If you work with GeoDjango you shouldn't have any troubles in getting it working based on this: http://www.eivanov.com/2009/01/manytomany-relations-in-django.html

Afaik your bigger problem would be to make the many-to-many model working, ie. to pass/update/delete/etc data in the front-end and this to be reflected in your db.

Hope this helps,


In reply to user21947's comment asking "Would you mind showing me which post...": johanvdw meant that the tags you added to your gis.stackexchange post themselves illustrate a many-to-many relationship. You post is linked to any other post with any matching tag.

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.