<html><head><style type="text/css"><!-- DIV {margin:0px;} --></style></head><body><div style="font-family:times new roman,new york,times,serif;font-size:12pt"><div>I don't know how to express my thanks to your helpful answer and Brent Fraser, as well. <br>specially, i wasn't careful about using views in this application. <br></div><div style="font-family:times new roman, new york, times, serif;font-size:12pt"><br>&gt;&gt;You don't need a table per vehicle, as all share the same columns, you 
just need to have a vehicle id &gt;&gt;column to be able to select the required 
vehicle from the table.<br><br>I didn't get what ur meaning. No table per vehicle? while i have to store every point with its time, so it means 1 record for each point. (Can i have an array of time in one cell? if so, it means i have a line of points in one cell, and corresponding array of times in another cell)<br><br>&gt;&gt;Do you want a fixed map extent &amp; just show vehicles in that region?<br>&gt;&gt;Do you want to have
 the map automatically zoom to an extent covering all currently displayed vehicles?<br>&gt;&gt;Do you want the map to automatically recenter on a vehicle point as the point nears an edge of the map?<br><br>Of course, user selects some vehicles, and if not in current displayed region, map automatically changes the displayed extent.<br>Around recentering map when a vehicle reaches map edges, I think (if i'm wrong Plz correct me) it would be done via Openlayers with some scripting. As it knows current extent and new position of vehicles, it is possible computing whether vehicle reaches edge or not.<br><br>Best Regards<br>Saka<br><div style="font-family:times new roman, new york, times, serif;font-size:12pt"><font face="Tahoma" size="2"><hr size="1"><b><span style="font-weight: bold;">From:</span></b> Brent Wood &lt;pcreso@yahoo.com&gt;<br><b><span style="font-weight: bold;">To:</span></b> MapServer &lt;mapserver-users@lists.osgeo.org&gt;; Saka Royban
 &lt;sakaroyban@yahoo.com&gt;<br><b><span style="font-weight: bold;">Sent:</span></b> Sat, June 18, 2011 3:08:47 AM<br><b><span style="font-weight: bold;">Subject:</span></b> Re: [mapserver-users] Asking for guidelines about a project<br></font><br>
<meta http-equiv="x-dns-prefetch-control" content="off"><table border="0" cellpadding="0" cellspacing="0"><tbody><tr><td style="font:inherit;" valign="top">Given how these sorts of things tend to grow, it may also be worth planning for a system to store the vehicle/points/times, as well as maintain the "live" table of vehicle positions.<br><br>In fact the table of live positions can simply be a view on the historic table providing the current situation instead of a physical table.<br><br>From this you can automatically generate hourly or daily tracklines (linestrings made up from the points within an interval ordered by time) which can also be made available by mapserver, via an interface allowing users to select vehicles &amp; start/end times to show where they have been as well as where they are, or where were they at a specified time.<br><br>With respect to automatic on screen map updates, it can get complicated: <br>Do you want a fixed map extent
 &amp; just show vehicles in that region?<br>Do you want to have
 the map automatically zoom to an extent covering all currently displayed vehicles?<br>Do you want the map to automatically recenter on a vehicle point as the point nears an edge of the map?<br><br>A fixed extent is relatively easy, &amp; can be done with a just mapfile &amp; HTML (have the web page retrieve the map automatically as a URL via WMS as often as desired)<br><br>You don't need a table per vehicle, as all share the same columns, you just need to have a vehicle id column to be able to select the required vehicle from the table.<br><br>More powerful &amp; flexible approaches are more complicated, but can be done. It very much depends on what you want to do.<br><br>Cheers,<br><br>Brent Wood<br><br><br>--- On <b>Sat, 6/18/11, Saka Royban <i>&lt;sakaroyban@yahoo.com&gt;</i></b> wrote:<br><blockquote style="border-left:2px solid rgb(16, 16, 255);margin-left:5px;padding-left:5px;"><br>From: Saka Royban &lt;sakaroyban@yahoo.com&gt;<br>Subject:
 Re: [mapserver-users] Asking for guidelines about a project<br>To: "MapServer" &lt;mapserver-users@lists.osgeo.org&gt;<br>Date: Saturday, June 18, 2011, 4:56 AM<br><br><div id="yiv699034962"><style type="text/css"><!--#yiv699034962 DIV {margin:0px;}--></style><div style="font-family:times new roman, new york, times, serif;font-size:12pt;"><div>Thanks for ur answer and also Josh's answer.<br>In fact, i should be able to display path of vehicles (usually more than 1 vehicle in display area) and also be able to save points passed by vehicles and time of passing (for some queries). Cause of that, i thought maybe i need one table per vehicle.<br>Do u think any more idea?<br><br>Best Regards<br></div><div style="font-family:times new roman, new york, times, serif;font-size:12pt;"><br><div style="font-family:times new roman, new york, times, serif;font-size:12pt;"><font face="Tahoma" size="2"><hr size="1"><b><span style="font-weight:bold;">From:</span></b>
 Brent Fraser &lt;bfraser@geoanalytic.com&gt;<br><b><span style="font-weight:bold;">To:</span></b> Saka Royban &lt;sakaroyban@yahoo.com&gt;<br><b><span style="font-weight:bold;">Cc:</span></b> MapServer &lt;mapserver-users@lists.osgeo.org&gt;<br><b><span style="font-weight:bold;">Sent:</span></b> Fri, June 17, 2011 7:49:20 PM<br><b><span style="font-weight:bold;">Subject:</span></b> Re: [mapserver-users] Asking for guidelines about a project<br></font><br>
 

  

    
    <title></title>
  
  
    The database schema depends on what you want to do with the data
    (display current position?&nbsp; A track of historical positions?), and
    how much data you expect (how may objects will be tracked?&nbsp; how
    often will they report?).<br>
    <br>
    A simple schema would have one table (e.g. "vehicles"), with one row
    per tracked object<br>
    <br>
    Table: Vehicles<br>
    <br>
    <tt>ID:&nbsp;&nbsp;&nbsp; Name:&nbsp; &nbsp; &nbsp;&nbsp;&nbsp;&nbsp; Position:&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Status:&nbsp;&nbsp; UpdateTime:<br>
      1&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; My Car&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; point(51,-115)&nbsp; active&nbsp;&nbsp;&nbsp; 2011-06-16
      10:23:54+02<br>
      2&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Another Car&nbsp;&nbsp; point(52,-116)&nbsp; inactive&nbsp; </tt><tt>2010-05-15
      11:13:12+02</tt><br>
    <tt><br>
    </tt>With this schema, when a new position arrives for&nbsp; "My Car", an
    update statement is issued to change the row's Position and
    UpdateTime (and possibly Status).<br>
    <br>
    &nbsp; The table is treated as a PostGIS point layer by mapserver.<br>
    <br>
    &nbsp; In my implementations, the position data was updated every 30 to
    60 minutes (they were ships and construction vehicles), so there was
    no need to ask mapserver to regenerate a graphic every second; an
    updated map was shown whenever a user did a pan or zoom.&nbsp; You may be
    able to configure OpenLayers to do a CGI request to mapserver every
    few seconds, but I've never done that.<br>
    <br>
    <pre class="yiv699034962moz-signature">Best Regards,<br>Brent Fraser</pre>
    <br>
    On 6/16/2011 11:52 PM, Saka Royban wrote:
    <blockquote type="cite">
      
      <div style="font-family:times new roman, new york, times, serif;font-size:12pt;">
        <div>Thanks a lot brent<br>
          I checked provided link and i;m gonna give it a try.<br>
          About ur helpful advices, i'm confused about how to save data
          in PostGIS? with what schema? <br>
          I mean i have to keep track of each paced point by moving
          objects. Should i record each point as a record, so it means
          one table per moving object ?<br>
          Also for displaying these varaiant data, there should some
          sort of plan. I don't think i'm able to say to MapServer CGI
          at each second connect to PostGIS and read the new data, then
          i have to use MapScript. Am i right? (Can this process be done
          via OpenLayers?)<br>
          <br>
          Best Regards<br>
        </div>
        <div style="font-family:times new roman, new york, times, serif;font-size:12pt;"><br>
          <div style="font-family:times new roman, new york, times, serif;font-size:12pt;"><font face="Tahoma" size="2">
              <hr size="1"><b><span style="font-weight:bold;">From:</span></b>
              Brent Fraser <a rel="nofollow" class="yiv699034962moz-txt-link-rfc2396E">&lt;bfraser@geoanalytic.com&gt;</a><br>
              <b><span style="font-weight:bold;">To:</span></b> Saka
              Royban <a rel="nofollow" class="yiv699034962moz-txt-link-rfc2396E">&lt;sakaroyban@yahoo.com&gt;</a><br>
              <b><span style="font-weight:bold;">Cc:</span></b>
              MapServer <a rel="nofollow" class="yiv699034962moz-txt-link-rfc2396E">&lt;mapserver-users@lists.osgeo.org&gt;</a><br>
              <b><span style="font-weight:bold;">Sent:</span></b> Tue,
              June 14, 2011 7:14:08 PM<br>
              <b><span style="font-weight:bold;">Subject:</span></b>
              Re: [mapserver-users] Asking for guidelines about a
              project<br>
            </font><br>
            
            <title></title>
            Saka,<br>
            <br>
            &nbsp; I've had good success using PostGIS for data storage in
            implementing tracking systems.&nbsp; While you'll need to create
            your own code for updating the positions in the database,
            mapserver can read points from PostGIS and can render the
            points into a map image for use with the OpenLayers client.<br>
            <br>
            <span><span><span> &nbsp; There are other solutions too, like OpenGTS (<a target="_blank" href="http://opengts.sourceforge.net/index.html">http://opengts.sourceforge.net/index.html</a>)</span></span></span><br>
            <pre class="yiv699034962moz-signature">Best Regards,<br>Brent Fraser</pre>
            <br>
            On 6/14/2011 12:08 AM, Saka Royban wrote:
            <blockquote type="cite">
              <div style="font-family:times new roman, new york, times, serif;font-size:12pt;">
                <div>Hi all.<br>
                  Strictly Speaking, i have a project that i should
                  display some moving objects on a map via browser.<br>
                  Generally, i don't know how to start? i mean how
                  should i save these time-based objects in DB and how
                  to retrieve and display them via Mapserver? where
                  should i use client side scripting like OpneLayers?<br>
                  Any help woudbe greatly appreciated.<br>
                  <br>
                  Thanks in advance<br>
                </div>
              </div>
              <pre><fieldset class="yiv699034962mimeAttachmentHeader"></fieldset><br>_______________________________________________<br>mapserver-users mailing list<br><a rel="nofollow" class="yiv699034962moz-txt-link-abbreviated">mapserver-users@lists.osgeo.org</a><span><span><br><span><a target="_blank" href="http://lists.osgeo.org/mailman/listinfo/mapserver-users">http://lists.osgeo.org/mailman/listinfo/mapserver-users</a></span><br></span></span></pre>
            </blockquote>
            
          </div>
        </div>
      </div>
      <pre><fieldset class="yiv699034962mimeAttachmentHeader"></fieldset><br>_______________________________________________<br>mapserver-users mailing list<br><a rel="nofollow" class="yiv699034962moz-txt-link-abbreviated">mapserver-users@lists.osgeo.org</a><br><a rel="nofollow" class="yiv699034962moz-txt-link-freetext" target="_blank" href="http://lists.osgeo.org/mailman/listinfo/mapserver-users">http://lists.osgeo.org/mailman/listinfo/mapserver-users</a><br></pre>
    </blockquote>
  

</div></div> 



</div></div><br>-----Inline Attachment Follows-----<br><br><div class="plainMail">_______________________________________________<br>mapserver-users mailing list<br><a rel="nofollow">mapserver-users@lists.osgeo.org</a><br><a rel="nofollow" target="_blank" href="http://lists.osgeo.org/mailman/listinfo/mapserver-users">http://lists.osgeo.org/mailman/listinfo/mapserver-users</a><br></div></blockquote></td></tr></tbody></table><meta http-equiv="x-dns-prefetch-control" content="on"></div></div>



</div></body></html>