Re: [mapserver-users] Asking for guidelines about a project
Thanks a lot for your informative answers. As u mentioned, it's going to be off topic (of mapserver, Postgis list sounds a better place for it), but unfortunately I'm still confused. According to what i understood from your Select(s), you are saving all vehicles with their points and timestamps in one table. Why not to partition this into some tables for preventing a large table? (because i have to deal a growing number of vehicles, this is of importance to me) Dear Ben Also, I'm so sorry, but i didn't find Regina Obe comments on running tracks in internet. Do u have any more information? With best wishes Best Regards From: Ben Madin li...@remoteinformation.com.au To: mapserver-users@lists.osgeo.org Sent: Tue, June 21, 2011 8:59:46 AM Subject: Re: [mapserver-users] Asking for guidelines about a project Brent et al, Becoming off topic, but ours went something like : DATA the_move FROM (select ST_MakeLine(the_geom) as the_move, sq.polltime FROM (SELECT the_geom, CAST(polltime AS date) as polltime FROM vms WHERE vesselname like '%pg_sql%' ORDER BY polltime LIMIT 36) sq GROUP BY sq.polltime) AS foo USING UNIQUE polltime USING SRID=4326 but all credit for the concept goes to Regina Obe - I think she was showing running tracks! try postgresonline or the postgis list. cheers Ben On 21/06/2011, at 11:15 AM, mapserver-users-requ...@lists.osgeo.org wrote: From: Brent Fraser bfra...@geoanalytic.com Date: 20 June 2011 11:43:52 PM AEST To: Ben Madin li...@remoteinformation.com.au Cc: mapserver-users@lists.osgeo.org Subject: Re: [mapserver-users] Asking for guidelines about a project Ben, Our setup was similar. We had a current_location table and a archive_location table. To filter the archive_location for positions in the last 24 hours we had a view: CREATE VIEW archive_v AS SELECT archive_location.vessel_id, archive_location.time_fix, archive_location.speed, archive_location.heading, archive_location.vessel_coordinate, archive_location.archive_sequence, vessel_cfg.vessel_name, owner.org_name FROM archive_location,owner,vessel_cfg WHERE archive_location.owner_id=owner.org_id AND archive_location.vessel_id=vessel_cfg.vessel_id AND ((now() AT TIME ZONE 'utc') - (archive_location.time_fix)) = '24 hour'; I can't recall how we created linestrings for the tracks from the above view, but I think we used the archive_sequence number (this was assigned at insert time, per vessel) to order the points into lines. Best Regards, Brent Fraser ___ mapserver-users mailing list mapserver-users@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/mapserver-users
Re: [mapserver-users] Asking for guidelines about a project
Mainly because adding a new vehicle is trivial from a site maintenance perspective if you have all vehicles in one table. Adding a table would likely mean you would need to add a layer in Mapserver, but it depends on your user interface needs. For my first implementation, I did have some concerns regarding performance if I put all the historical positions in a table with the current positions. That's why I had two tables: current_position table with about 6 to 20 rows (since I have 6 to 20 vehicles), and an archive_positions table that grew over time. Since the user was usually just concerned with displaying the current position, queries were handled very quickly. As it turned out, the archive_positions table grew to only several hundred thousand records (maybe a million?), and Postgresql had no problems with that. So if I did it again, I'd likely use one table, containing the current and historical positions. But as I mentioned earlier, it might depend on how may vehicles you anticipate tracking, and how often they report (and to some extent how fast they move). Do you have that information? Best Regards, Brent Fraser On 6/21/2011 12:21 PM, Saka Royban wrote: Thanks a lot for your informative answers. As u mentioned, it's going to be off topic (of mapserver, Postgis list sounds a better place for it), but unfortunately I'm still confused. According to what i understood from your Select(s), you are saving all vehicles with their points and timestamps in one table. Why not to partition this into some tables for preventing a large table? (because i have to deal a growing number of vehicles, this is of importance to me) Dear Ben Also, I'm so sorry, but i didn't find Regina Obe comments on running tracks in internet. Do u have any more information? With best wishes Best Regards *From:* Ben Madin li...@remoteinformation.com.au *To:* mapserver-users@lists.osgeo.org *Sent:* Tue, June 21, 2011 8:59:46 AM *Subject:* Re: [mapserver-users] Asking for guidelines about a project Brent et al, Becoming off topic, but ours went something like : DATA the_move FROM (select ST_MakeLine(the_geom) as the_move, sq.polltime FROM (SELECT the_geom, CAST(polltime AS date) as polltime FROM vms WHERE vesselname like '%pg_sql%' ORDER BY polltime LIMIT 36) sq GROUP BY sq.polltime) AS foo USING UNIQUE polltime USING SRID=4326 but all credit for the concept goes to Regina Obe - I think she was showing running tracks! try postgresonline or the postgis list. cheers Ben On 21/06/2011, at 11:15 AM, mapserver-users-requ...@lists.osgeo.org mailto:mapserver-users-requ...@lists.osgeo.org wrote: *From:*Brent Fraser bfra...@geoanalytic.com mailto:bfra...@geoanalytic.com *Date:*20 June 2011 11:43:52 PM AEST *To:*Ben Madin li...@remoteinformation.com.au mailto:li...@remoteinformation.com.au *Cc:*mapserver-users@lists.osgeo.org mailto:mapserver-users@lists.osgeo.org *Subject:**Re: [mapserver-users] Asking for guidelines about a project* Ben, Our setup was similar. We had a current_location table and a archive_location table. To filter the archive_location for positions in the last 24 hours we had a view: CREATE VIEW archive_v AS SELECT archive_location.vessel_id, archive_location.time_fix, archive_location.speed, archive_location.heading, archive_location.vessel_coordinate, archive_location.archive_sequence, vessel_cfg.vessel_name, owner.org_name FROM archive_location,owner,vessel_cfg WHERE archive_location.owner_id=owner.org_id AND archive_location.vessel_id=vessel_cfg.vessel_id AND ((now() AT TIME ZONE 'utc') - (archive_location.time_fix)) = '24 hour'; I can't recall how we created linestrings for the tracks from the above view, but I think we used the archive_sequence number (this was assigned at insert time, per vessel) to order the points into lines. Best Regards, Brent Fraser ___ mapserver-users mailing list mapserver-users@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/mapserver-users ___ mapserver-users mailing list mapserver-users@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/mapserver-users
Re: [mapserver-users] Asking for guidelines about a project
There is at least (and for now) 100 vehicles with update rate of 5-15 minute. That' why i'm so careful abut table design. Anyway, thanks a million for all your helpful answers. Regards From: Brent Fraser bfra...@geoanalytic.com To: Saka Royban sakaroy...@yahoo.com Cc: MapServer mapserver-users@lists.osgeo.org Sent: Tue, June 21, 2011 11:14:14 PM Subject: Re: [mapserver-users] Asking for guidelines about a project Mainly because adding a new vehicle is trivial from a site maintenance perspective if you have all vehicles in one table. Adding a table would likely mean you would need to add a layer in Mapserver, but it depends on your user interface needs. For my first implementation, I did have some concerns regarding performance if I put all the historical positions in a table with the current positions. That's why I had two tables: current_position table with about 6 to 20 rows (since I have 6 to 20 vehicles), and an archive_positions table that grew over time. Since the user was usually just concerned with displaying the current position, queries were handled very quickly. As it turned out, the archive_positions table grew to only several hundred thousand records (maybe a million?), and Postgresql had no problems with that. So if I did it again, I'd likely use one table, containing the current and historical positions. But as I mentioned earlier, it might depend on how may vehicles you anticipate tracking, and how often they report (and to some extent how fast they move). Do you have that information? Best Regards, Brent Fraser On 6/21/2011 12:21 PM, Saka Royban wrote: Thanks a lot for your informative answers. As u mentioned, it's going to be off topic (of mapserver, Postgis list sounds a better place for it), but unfortunately I'm still confused. According to what i understood from your Select(s), you are saving all vehicles with their points and timestamps in one table. Why not to partition this into some tables for preventing a large table? (because i have to deal a growing number of vehicles, this is of importance to me) Dear Ben Also, I'm so sorry, but i didn't find Regina Obe comments on running tracks in internet. Do u have any more information? With best wishes Best Regards From: Ben Madin li...@remoteinformation.com.au To: mapserver-users@lists.osgeo.org Sent: Tue, June 21, 2011 8:59:46 AM Subject: Re: [mapserver-users] Asking for guidelines about a project Brent et al, Becoming off topic, but ours went something like : DATA the_move FROM (select ST_MakeLine(the_geom) as the_move, sq.polltime FROM (SELECT the_geom, CAST(polltime AS date) as polltime FROM vms WHERE vesselname like '%pg_sql%' ORDER BY polltime LIMIT 36) sq GROUP BY sq.polltime) AS foo USING UNIQUE polltime USING SRID=4326 but all credit for the concept goes to Regina Obe - I think she was showing running tracks! try postgresonline or the postgis list. cheers Ben On 21/06/2011, at 11:15 AM, mapserver-users-requ...@lists.osgeo.org wrote: From: Brent Fraser bfra...@geoanalytic.com Date: 20 June 2011 11:43:52 PM AEST To: Ben Madin li...@remoteinformation.com.au Cc: mapserver-users@lists.osgeo.org Subject: Re: [mapserver-users] Asking for guidelines about a project Ben, Our setup was similar. We had a current_location table and a archive_location table. To filter the archive_location for positions in the last 24 hours we had a view: CREATE VIEW archive_v AS SELECT archive_location.vessel_id, archive_location.time_fix, archive_location.speed, archive_location.heading, archive_location.vessel_coordinate, archive_location.archive_sequence, vessel_cfg.vessel_name, owner.org_name FROM archive_location,owner,vessel_cfg WHERE archive_location.owner_id=owner.org_id AND archive_location.vessel_id=vessel_cfg.vessel_id AND ((now() AT TIME ZONE 'utc') - (archive_location.time_fix)) = '24 hour'; I can't recall how we created linestrings for the tracks from the above view, but I think we used the archive_sequence number (this was assigned at insert time, per vessel) to order the points into lines. Best Regards, Brent Fraser
Re: [mapserver-users] Asking for guidelines about a project
I don't know how to express my thanks to your helpful answer and Brent Fraser, as well. specially, i wasn't careful about using views in this application. 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. 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) Do you want a fixed map extent just show vehicles in that region? Do you want to have the map automatically zoom to an extent covering all currently displayed vehicles? Do you want the map to automatically recenter on a vehicle point as the point nears an edge of the map? Of course, user selects some vehicles, and if not in current displayed region, map automatically changes the displayed extent. 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. Best Regards Saka From: Brent Wood pcr...@yahoo.com To: MapServer mapserver-users@lists.osgeo.org; Saka Royban sakaroy...@yahoo.com Sent: Sat, June 18, 2011 3:08:47 AM Subject: Re: [mapserver-users] Asking for guidelines about a project 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. 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. 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 start/end times to show where they have been as well as where they are, or where were they at a specified time. With respect to automatic on screen map updates, it can get complicated: Do you want a fixed map extent just show vehicles in that region? Do you want to have the map automatically zoom to an extent covering all currently displayed vehicles? Do you want the map to automatically recenter on a vehicle point as the point nears an edge of the map? A fixed extent is relatively easy, can be done with a just mapfile HTML (have the web page retrieve the map automatically as a URL via WMS as often as desired) 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. More powerful flexible approaches are more complicated, but can be done. It very much depends on what you want to do. Cheers, Brent Wood --- On Sat, 6/18/11, Saka Royban sakaroy...@yahoo.com wrote: From: Saka Royban sakaroy...@yahoo.com Subject: Re: [mapserver-users] Asking for guidelines about a project To: MapServer mapserver-users@lists.osgeo.org Date: Saturday, June 18, 2011, 4:56 AM Thanks for ur answer and also Josh's answer. 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. Do u think any more idea? Best Regards From: Brent Fraser bfra...@geoanalytic.com To: Saka Royban sakaroy...@yahoo.com Cc: MapServer mapserver-users@lists.osgeo.org Sent: Fri, June 17, 2011 7:49:20 PM Subject: Re: [mapserver-users] Asking for guidelines about a project The database schema depends on what you want to do with the data (display current position? A track of historical positions?), and how much data you expect (how may objects will be tracked? how often will they report?). A simple schema would have one table (e.g. vehicles), with one row per tracked object Table: Vehicles ID:Name: Position: Status: UpdateTime: 1 My Carpoint(51,-115) active2011-06-16 10:23:54+02 2 Another Car point(52,-116) inactive 2010-05-15 11:13:12+02 With this schema, when a new position arrives for My Car, an update statement is issued to change the row's Position and UpdateTime (and possibly Status). The table is treated as a PostGIS point layer by mapserver. 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
Re: [mapserver-users] Asking for guidelines about a project
Ben, Our setup was similar. We had a current_location table and a archive_location table. To filter the archive_location for positions in the last 24 hours we had a view: CREATE VIEW archive_v AS SELECT archive_location.vessel_id, archive_location.time_fix, archive_location.speed, archive_location.heading, archive_location.vessel_coordinate, archive_location.archive_sequence, vessel_cfg.vessel_name, owner.org_name FROM archive_location,owner,vessel_cfg WHERE archive_location.owner_id=owner.org_id AND archive_location.vessel_id=vessel_cfg.vessel_id AND ((now() AT TIME ZONE 'utc') - (archive_location.time_fix)) = '24 hour'; I can't recall how we created linestrings for the tracks from the above view, but I think we used the archive_sequence number (this was assigned at insert time, per vessel) to order the points into lines. Best Regards, Brent Fraser On 6/19/2011 7:31 AM, Ben Madin wrote: I've done similar to Brent's suggestions, but tracking boats with 2 hourly updates. We just stored all the location data in one table with a reference id to a boat name and details in another project. The default setting showed the current location and the last 72 hours of track... Using a query like select blah order by recordtime desc limit 36. we then created a linestring and mapped those. It was a bit heavy on the poor old (really old) server, but there were only about 70 boats all up. In retrospect (and if I had more boats or users), I would create two tables, one holding the all the point locations, and one holding the default tracks. The default tracks would be updated by a trigger on insertion of the new records into the locations table, rather than all being computed on the fly. Anyway, 101 ways to skin a cat. cheers Ben On 18/06/2011, at 11:31 AM, mapserver-users-requ...@lists.osgeo.org mailto:mapserver-users-requ...@lists.osgeo.org wrote: *From:*Brent Fraser bfra...@geoanalytic.com mailto:bfra...@geoanalytic.com *Date:*18 June 2011 3:27:00 AM AEST *To:*Saka Royban sakaroy...@yahoo.com mailto:sakaroy...@yahoo.com *Cc:*MapServer mapserver-users@lists.osgeo.org mailto:mapserver-users@lists.osgeo.org *Subject:**Re: [mapserver-users] Asking for guidelines about a project* Well, it's up to you how to model the objects (that's the great thing about relational databases). Typically, I've added a table of Historical Positions with basically the same structure as the vehicle table (but in that case the unique key is not the vehicle ID, but instead just a system assigned key like OID). As for the points passed by, I would not save that information in a table, instead consider it the result of a spatial query (say in a PostGIS view) at display time. A system like this usually takes a large of amount of time for requirements, investigation, design, and prototyping. And of course, construction, testing, documentation, and training. If you want something more packaged you can just download and install, you may want to do some searching on the web. Best Regards, Brent Fraser On 6/17/2011 10:56 AM, Saka Royban wrote: Thanks for ur answer and also Josh's answer. 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. Do u think any more idea? Best Regards *From:*Brent Fraserbfra...@geoanalytic.com *To:*Saka Roybansakaroy...@yahoo.com *Cc:*MapServermapserver-users@lists.osgeo.org *Sent:*Fri, June 17, 2011 7:49:20 PM *Subject:*Re: [mapserver-users] Asking for guidelines about a project The database schema depends on what you want to do with the data (display current position? A track of historical positions?), and how much data you expect (how may objects will be tracked? how often will they report?). A simple schema would have one table (e.g. vehicles), with one row per tracked object Table: Vehicles ID:Name: Position: Status: UpdateTime: 1 My Carpoint(51,-115) active2011-06-16 10:23:54+02 2 Another Car point(52,-116) inactive 2010-05-15 11:13:12+02 With this schema, when a new position arrives for My Car, an update statement is issued to change the row's Position and UpdateTime (and possibly Status). The table is treated as a PostGIS point layer by mapserver. 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
Re: [mapserver-users] Asking for guidelines about a project
I've done similar to Brent's suggestions, but tracking boats with 2 hourly updates. We just stored all the location data in one table with a reference id to a boat name and details in another project. The default setting showed the current location and the last 72 hours of track... Using a query like select blah order by recordtime desc limit 36. we then created a linestring and mapped those. It was a bit heavy on the poor old (really old) server, but there were only about 70 boats all up. In retrospect (and if I had more boats or users), I would create two tables, one holding the all the point locations, and one holding the default tracks. The default tracks would be updated by a trigger on insertion of the new records into the locations table, rather than all being computed on the fly. Anyway, 101 ways to skin a cat. cheers Ben On 18/06/2011, at 11:31 AM, mapserver-users-requ...@lists.osgeo.org wrote: From: Brent Fraser bfra...@geoanalytic.com Date: 18 June 2011 3:27:00 AM AEST To: Saka Royban sakaroy...@yahoo.com Cc: MapServer mapserver-users@lists.osgeo.org Subject: Re: [mapserver-users] Asking for guidelines about a project Well, it's up to you how to model the objects (that's the great thing about relational databases). Typically, I've added a table of Historical Positions with basically the same structure as the vehicle table (but in that case the unique key is not the vehicle ID, but instead just a system assigned key like OID). As for the points passed by, I would not save that information in a table, instead consider it the result of a spatial query (say in a PostGIS view) at display time. A system like this usually takes a large of amount of time for requirements, investigation, design, and prototyping. And of course, construction, testing, documentation, and training. If you want something more packaged you can just download and install, you may want to do some searching on the web. Best Regards, Brent Fraser On 6/17/2011 10:56 AM, Saka Royban wrote: Thanks for ur answer and also Josh's answer. 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. Do u think any more idea? Best Regards From: Brent Fraser bfra...@geoanalytic.com To: Saka Royban sakaroy...@yahoo.com Cc: MapServer mapserver-users@lists.osgeo.org Sent: Fri, June 17, 2011 7:49:20 PM Subject: Re: [mapserver-users] Asking for guidelines about a project The database schema depends on what you want to do with the data (display current position? A track of historical positions?), and how much data you expect (how may objects will be tracked? how often will they report?). A simple schema would have one table (e.g. vehicles), with one row per tracked object Table: Vehicles ID:Name: Position: Status: UpdateTime: 1 My Carpoint(51,-115) active2011-06-16 10:23:54+02 2 Another Car point(52,-116) inactive 2010-05-15 11:13:12+02 With this schema, when a new position arrives for My Car, an update statement is issued to change the row's Position and UpdateTime (and possibly Status). The table is treated as a PostGIS point layer by mapserver. 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. You may be able to configure OpenLayers to do a CGI request to mapserver every few seconds, but I've never done that. Best Regards, Brent Fraser On 6/16/2011 11:52 PM, Saka Royban wrote: Thanks a lot brent I checked provided link and i;m gonna give it a try. About ur helpful advices, i'm confused about how to save data in PostGIS? with what schema? 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 ? 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?) Best Regards From: Brent Fraser bfra...@geoanalytic.com To: Saka Royban sakaroy...@yahoo.com Cc: MapServer mapserver-users@lists.osgeo.org Sent: Tue, June 14, 2011 7:14:08 PM Subject: Re: [mapserver-users] Asking for guidelines about a project Saka, I've had good success using PostGIS for data storage in implementing tracking systems. 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
Re: [mapserver-users] Asking for guidelines about a project
The database schema depends on what you want to do with the data (display current position? A track of historical positions?), and how much data you expect (how may objects will be tracked? how often will they report?). A simple schema would have one table (e.g. vehicles), with one row per tracked object Table: Vehicles ID:Name: Position: Status: UpdateTime: 1 My Carpoint(51,-115) active2011-06-16 10:23:54+02 2 Another Car point(52,-116) inactive 2010-05-15 11:13:12+02 With this schema, when a new position arrives for My Car, an update statement is issued to change the row's Position and UpdateTime (and possibly Status). The table is treated as a PostGIS point layer by mapserver. 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. You may be able to configure OpenLayers to do a CGI request to mapserver every few seconds, but I've never done that. Best Regards, Brent Fraser On 6/16/2011 11:52 PM, Saka Royban wrote: Thanks a lot brent I checked provided link and i;m gonna give it a try. About ur helpful advices, i'm confused about how to save data in PostGIS? with what schema? 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 ? 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?) Best Regards *From:* Brent Fraser bfra...@geoanalytic.com *To:* Saka Royban sakaroy...@yahoo.com *Cc:* MapServer mapserver-users@lists.osgeo.org *Sent:* Tue, June 14, 2011 7:14:08 PM *Subject:* Re: [mapserver-users] Asking for guidelines about a project Saka, I've had good success using PostGIS for data storage in implementing tracking systems. 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. There are other solutions too, like OpenGTS (http://opengts.sourceforge.net/index.html) Best Regards, Brent Fraser On 6/14/2011 12:08 AM, Saka Royban wrote: Hi all. Strictly Speaking, i have a project that i should display some moving objects on a map via browser. 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? Any help woudbe greatly appreciated. Thanks in advance ___ mapserver-users mailing list mapserver-users@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/mapserver-users ___ mapserver-users mailing list mapserver-users@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/mapserver-users ___ mapserver-users mailing list mapserver-users@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/mapserver-users
Re: [mapserver-users] Asking for guidelines about a project
Thanks for ur answer and also Josh's answer. 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. Do u think any more idea? Best Regards From: Brent Fraser bfra...@geoanalytic.com To: Saka Royban sakaroy...@yahoo.com Cc: MapServer mapserver-users@lists.osgeo.org Sent: Fri, June 17, 2011 7:49:20 PM Subject: Re: [mapserver-users] Asking for guidelines about a project The database schema depends on what you want to do with the data (display current position? A track of historical positions?), and how much data you expect (how may objects will be tracked? how often will they report?). A simple schema would have one table (e.g. vehicles), with one row per tracked object Table: Vehicles ID:Name: Position: Status: UpdateTime: 1 My Carpoint(51,-115) active2011-06-16 10:23:54+02 2 Another Car point(52,-116) inactive 2010-05-15 11:13:12+02 With this schema, when a new position arrives for My Car, an update statement is issued to change the row's Position and UpdateTime (and possibly Status). The table is treated as a PostGIS point layer by mapserver. 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. You may be able to configure OpenLayers to do a CGI request to mapserver every few seconds, but I've never done that. Best Regards, Brent Fraser On 6/16/2011 11:52 PM, Saka Royban wrote: Thanks a lot brent I checked provided link and i;m gonna give it a try. About ur helpful advices, i'm confused about how to save data in PostGIS? with what schema? 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 ? 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?) Best Regards From: Brent Fraser bfra...@geoanalytic.com To: Saka Royban sakaroy...@yahoo.com Cc: MapServer mapserver-users@lists.osgeo.org Sent: Tue, June 14, 2011 7:14:08 PM Subject: Re: [mapserver-users] Asking for guidelines about a project Saka, I've had good success using PostGIS for data storage in implementing tracking systems. 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. There are other solutions too, like OpenGTS (http://opengts.sourceforge.net/index.html) Best Regards, Brent Fraser On 6/14/2011 12:08 AM, Saka Royban wrote: Hi all. Strictly Speaking, i have a project that i should display some moving objects on a map via browser. 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? Any help woudbe greatly appreciated. Thanks in advance ___ mapserver-users mailing list mapserver-users@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/mapserver-users ___ mapserver-users mailing list mapserver-users@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/mapserver-users ___ mapserver-users mailing list mapserver-users@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/mapserver-users
Re: [mapserver-users] Asking for guidelines about a project
Well, it's up to you how to model the objects (that's the great thing about relational databases). Typically, I've added a table of Historical Positions with basically the same structure as the vehicle table (but in that case the unique key is not the vehicle ID, but instead just a system assigned key like OID). As for the points passed by, I would not save that information in a table, instead consider it the result of a spatial query (say in a PostGIS view) at display time. A system like this usually takes a large of amount of time for requirements, investigation, design, and prototyping. And of course, construction, testing, documentation, and training. If you want something more packaged you can just download and install, you may want to do some searching on the web. Best Regards, Brent Fraser On 6/17/2011 10:56 AM, Saka Royban wrote: Thanks for ur answer and also Josh's answer. 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. Do u think any more idea? Best Regards *From:* Brent Fraser bfra...@geoanalytic.com *To:* Saka Royban sakaroy...@yahoo.com *Cc:* MapServer mapserver-users@lists.osgeo.org *Sent:* Fri, June 17, 2011 7:49:20 PM *Subject:* Re: [mapserver-users] Asking for guidelines about a project The database schema depends on what you want to do with the data (display current position? A track of historical positions?), and how much data you expect (how may objects will be tracked? how often will they report?). A simple schema would have one table (e.g. vehicles), with one row per tracked object Table: Vehicles ID:Name: Position: Status: UpdateTime: 1 My Carpoint(51,-115) active2011-06-16 10:23:54+02 2 Another Car point(52,-116) inactive 2010-05-15 11:13:12+02 With this schema, when a new position arrives for My Car, an update statement is issued to change the row's Position and UpdateTime (and possibly Status). The table is treated as a PostGIS point layer by mapserver. 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. You may be able to configure OpenLayers to do a CGI request to mapserver every few seconds, but I've never done that. Best Regards, Brent Fraser On 6/16/2011 11:52 PM, Saka Royban wrote: Thanks a lot brent I checked provided link and i;m gonna give it a try. About ur helpful advices, i'm confused about how to save data in PostGIS? with what schema? 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 ? 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?) Best Regards *From:* Brent Fraser bfra...@geoanalytic.com *To:* Saka Royban sakaroy...@yahoo.com *Cc:* MapServer mapserver-users@lists.osgeo.org *Sent:* Tue, June 14, 2011 7:14:08 PM *Subject:* Re: [mapserver-users] Asking for guidelines about a project Saka, I've had good success using PostGIS for data storage in implementing tracking systems. 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. There are other solutions too, like OpenGTS (http://opengts.sourceforge.net/index.html) Best Regards, Brent Fraser On 6/14/2011 12:08 AM, Saka Royban wrote: Hi all. Strictly Speaking, i have a project that i should display some moving objects on a map via browser. 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? Any help woudbe greatly appreciated. Thanks in advance ___ mapserver-users mailing list mapserver-users@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/mapserver-users ___ mapserver-users mailing list mapserver-users@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/mapserver-users ___ mapserver-users mailing list mapserver-users@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/mapserver
[mapserver-users] Asking for guidelines about a project
Hi all. Strictly Speaking, i have a project that i should display some moving objects on a map via browser. 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? Any help woudbe greatly appreciated. Thanks in advance ___ mapserver-users mailing list mapserver-users@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/mapserver-users