I have a whole set of line segments or tracks that represent real tracks or, in some case, boundaries between areas.

These segments form a network of lines on the map.

I have a number of GIS layers, e.g. walking tracks, vehicle tracks and a variety of zones (areas delimited by a set of segments) with a many to many relationship between segments and layers.

I figure the best way to deal with this is to put all the segments into a postgis table as individual features and then create a link table for each layer that lists then segments needed for that layer.

That way I have just one copy of each segment to maintain.

Is there a better way of doing this? Can anyone point me to some tutorial material in this area.

More clarification:

Indeed, views (or sql queries - which amount to the same thing) were what I was assuming that I would use to build the layers. I am pretty sure I know how to do what I want.

My questions was more along the lines of "Is the approach sound?". As a GIS novice but with a extensive IT background it seems to me that this must be a common situation i.e. having features that are used in multiple layers where you only want to maintain one copy of the feature. I was wondering if the obvious approach (from a relational database point of view) was what people used in practice or if there were other approaches.

  • 2
    If I understand you right, PostGIS topology might be what you are looking for. – Nicklas Avén Apr 6 '13 at 5:55
  • Can you clarify what you mean by "segments" and "layers". It's not clear to me what you are trying to achieve. In any case, as a "stab in the dark" I see some database VIEWs in your future... – Micha Apr 6 '13 at 14:48
  • I have just looked at PostGIS Topology and yes that fits the bill but I suspect it is overkill for what I need. But it does answer the question. "How do professionals do it?". Thanks Nicklas. – Russell Fulton Apr 7 '13 at 0:18
  • 1
    As you say it is a common case, but mostly it is just ignored and the redundant information is accepted. That can cause problems when editing with separate polygons, but is much easier to implement and port between different formats and needs. – Nicklas Avén Apr 8 '13 at 7:09

Your Answer

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

Browse other questions tagged or ask your own question.