[mapguide-users] Vehicle Tracking

Kenneth Skovhede, GEOGRAF A/S ks at geograf.dk
Tue Jun 17 05:58:31 EDT 2008


So you want to display only the most recent vehicle positions?

You can do that with a filter on the layer.
I suspect you have a datastructure like:
x double
y double
vehicleid integer
timestamp datetime

You should have a filter like: "timestamp = (select top 1 timestamp from 
table where vehicleid = id)".
How this filter should look, depends on your database.
I suspect you will have a hard time figuring this out (if it is even 
possible) directly in MapGuide.
I would advise you to add a column that indicates that this is the most 
recent entry:
mostrecent integer

then you can update the database upon arival of requests:
update table set mostrecent = 0 where vehicleid=id
and insert
insert into table (x,y,vehicleid,timestamp,mostrecent) values 
(x,y,id,now(),1)

This will allow you to have a filter like this in your layer:
"mostrecent = 1"

Regards, Kenneth Skovhede, GEOGRAF A/S



Vishaal skrev:
> Hi Kenneth,
>
> i am successful in displaying the points on a button click all at once. what
> i want is that on the button click my points should get displayed one by one
> as per the data and only the latest point should be visible. i am not able
> to this part. can you help me with some code example?
>
> thanks.
>
>
> Kenneth Skovhede, GEOGRAF A/S wrote:
>   
>> If you only have to consider the current position of vehicles, you can 
>> easily use a database.
>> Just add an x,y columns, and perhaps speed and other data to a table.
>> Then make a service that accepts coordinates from vehicles, and update 
>> the correct row in the database.
>>
>> In MapGuide, make a layer that reads the x,y points, and perhaps color 
>> code according to speed.
>> You can then get away with refreshing the map periodically.
>>
>> If you can read in the direction, you could throw in a rotation on a 
>> symbol in the layer.
>>
>> Regards, Kenneth Skovhede, GEOGRAF A/S
>>
>>
>>
>> Vishaal skrev:
>>     
>>> Hi List,
>>>
>>> i want to develop a vehicle tracking system using MGOS 1.2 and Visual
>>> Studio
>>> 2005. if any one can guide me about how to start for the application,
>>> then
>>> it will be very helpful to me. thanks for all your support.
>>>   
>>>       
>> _______________________________________________
>> mapguide-users mailing list
>> mapguide-users at lists.osgeo.org
>> http://lists.osgeo.org/mailman/listinfo/mapguide-users
>>
>>
>>     
>
>   
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/mapguide-users/attachments/20080617/bf5aafab/attachment.html


More information about the mapguide-users mailing list