<html>
  <head>

  </head>
  <body style="margin-left: 4px; margin-top: 4px; margin-right: 4px; margin-bottom: 1px; font-variant: normal; line-height: normal">
    <p style="margin-top: 0; margin-bottom: 0">
      <font face="Comic Sans MS" size="3">All,</font>    </p>
<br>      
    <p style="margin-top: 0; margin-bottom: 0">
      <font face="Comic Sans MS" size="3">You probably want to add in lines as well, for doing buffered searches from along Railraod routes for example.</font>    </p>
<br>      
    <p style="margin-top: 0; margin-bottom: 0">
      <font face="Comic Sans MS" size="3">bobb</font>    </p>
<br>      
    <p style="margin-top: 0; margin-bottom: 0">
      <br>
      <br>
      >>> Michal Kubenka <mkubenka@gmail.com> wrote:<br>    </p>
    <table bgcolor="#f3f3f3" style="font-size: 1em; margin-left: 15px; margin-top: 0; margin-right: 0; margin-bottom: 0" border="0">
      <tr>
        <td>
          <div style="padding-left: 7px; border-left: solid 1px #050505">
            <p style="margin-top: 0; margin-bottom: 0">
              Actually what we need is some hierarchical base for relationship between countries, cities, regions, etc. Main goal of the application will be collecting data from many sources about specific cities, regions, countries and so on, and store it in database. Let's say we will have city Rome, we collect some info about this city into database from couple sources. And we need to know that Rome is in province Rome, sub-region Lazio in region Lazio, country Italy. So system should be flexible to allow create such relation from real world.            </p>
            <div>
              <p style="margin-top: 0; margin-bottom: 0">
                <br>
                              </p>
            </div>
            <div>
              <p style="margin-top: 0; margin-bottom: 0">
                That's why I would choose two tables:              </p>
            </div>
            <div>
              <p style="margin-top: 0; margin-bottom: 0">
                <br>
                              </p>
            </div>
            <div>
              <p style="margin-top: 0; margin-bottom: 0">
                1) `polygons` - which can store countries, regions, sub-regions, provinces etc.              </p>
            </div>
            <div>
              <p style="margin-top: 0; margin-bottom: 0">
                2) `points` - which can store cities and POIs              </p>
            </div>
            <div>
              <p style="margin-top: 0; margin-bottom: 0">
                <br>
                              </p>
            </div>
            <div>
              <p style="margin-top: 0; margin-bottom: 0">
                Thanks.              </p>
            </div>
            <div>
              <p style="margin-top: 0; margin-bottom: 0">
                <br>
                              </p>
            </div>
            <div>
              <p style="margin-top: 0; margin-bottom: 0">
                Michal K.              </p>
            </div>
            <p style="margin-top: 0; margin-bottom: 0">
              <br>
                          </p>
            <div class="gmail_quote">
              <p style="margin-top: 0; margin-bottom: 0">
                On Mon, Apr 9, 2012 at 8:11 PM, <span dir="ltr"><<a href="mailto:pcreso@pcreso.com">pcreso@pcreso.com</a>></span> wrote:<br>              </p>
              <blockquote class="gmail_quote" style="margin-left: 0; padding-left: 0; margin-top: 0; border-left: 1px #ccc solid; margin-right: 0; margin-bottom: 0">
                <table cellspacing="0" cellpadding="0" border="0">
                  <tr>
                    <td valign="top" style="font-style: normal; font-size: inherit; font-family: SansSerif; font-weight: normal; font-variant: normal; line-height: normal">
                      <p style="margin-top: 0; margin-bottom: 0">
                        Are you planning to store multiple versions of these polygons, for zoom layers?<br><br>Generally you need a high res version (eg: coastline) when zoomed in (large scale) and a lower resolution version when zoomed out (you can't see & don't need the detail.<br><br>This may or may not have an impact on your eventual data model, but it is worth ensuring you take this into account during the data modeling process. You can have a model where each feature has multiple geometry columns associated with it in the one table, or an approach which has the geometries in separate tables, using ID's to link to the aspatial attributes. The former is a simpler, monolithic solution, the latter is more complex but allows more use of tablespaces & underlying Postgres optimisation.<br><br>You may also find you need to carry out joins (identify relationships between types of polygon, eg: cities within counties within states within countries, and this may perform better with a denormalised structure with separate tables for different categories of polygon.<br><br>One example you might look at is the OSM data model. Not quite what you are describing, but a robust & well tested model for global roads & related spatial data, which does not use Postgis at all.<br><br><a target="_blank" href="http://booki.flossmanuals.net/openstreetmap/_draft/_v/1.0/the-osm-data-model/">http://booki.flossmanuals.net/openstreetmap/_draft/_v/1.0/the-osm-data-model/</a><br><br>--- On <b>Mon, 4/9/12, mkubenka <i><<a target="_blank" href="mailto:mkubenka@gmail.com">mkubenka@gmail.com</a>></i></b> wrote:<br>                      </p>
                      <blockquote style="margin-left: 5px; padding-left: 5px; border-left: 2px solid rgb(16,16,255)">
                        <p style="margin-top: 0; margin-bottom: 0">
                          <br>
                          From: mkubenka <<a target="_blank" href="mailto:mkubenka@gmail.com">mkubenka@gmail.com</a>><br>Subject: [postgis-users] How to design a database for continents, countries, regions, cities and POIs?<br>To: <a target="_blank" href="mailto:postgis-users@postgis.refractions.net">postgis-users@postgis.refractions.net</a><br>Date: Monday, April 9, 2012, 11:31 PM                        </p>
                        <div>
                          <div class="h5">
                            <p style="margin-top: 0; margin-bottom: 0">
                              <br>
                              <br>
                                                          </p>
                            <div>
                              <p style="margin-top: 0; margin-bottom: 0">
                                I'm brand new to GIS programming and I am designing a GIS application. Target<br>is to create system with continents, countries, regions (including states,<br>sub-regions, provinces), cities and places in cities. Each of this elements<br>will contain some text information and related stuff. As database we are<br>going to use PostgreSQL with PostGIS.<br><br>My question is how to design database for this system? I was thinking of 2<br>tables polygons and points, but I'm not sure if it's good way of thinking.<br><br>--<br>View this message in context: <a target="_blank" href="http://postgis.17.n6.nabble.com/How-to-design-a-database-for-continents-countries-regions-cities-and-POIs-tp4715669p4715669.html">http://postgis.17.n6.nabble.com/How-to-design-a-database-for-continents-countries-regions-cities-and-POIs-tp4715669p4715669.html</a><br>Sent from the PostGIS - User mailing list archive at Nabble.com.<br>_______________________________________________<br>postgis-users mailing list<br><a target="_blank" href="http://mc/compose?to=postgis-users@postgis.refractions.net">postgis-users@postgis.refractions.net</a><br><a target="_blank" href="http://postgis.refractions.net/mailman/listinfo/postgis-users">http://postgis.refractions.net/mailman/listinfo/postgis-users</a><br>                              </p>
                            </div>
                          </div>
                        </div>
                      </blockquote>
                    </td>
                  </tr>
                </table>
              </blockquote>
            </div>
            <p style="margin-top: 0; margin-bottom: 0">
              <br>
            </p>
          </div>
        </td>
      </tr>
    </table>
  </body>
</html>