PDA

View Full Version : QueryShape dont work as expected



Bed007
10-20-2005, 08:49 AM
Hi,

I have a problem with QueryShape (in C#). What I do is that I add some shapes to a new map. Those shapes are use to detect whether or not a vehicle is entering a zone (using GPS coordinates). When I receive a coord from the vehicle, I add a pushpin and call QueryShape on the "My Pushpins" dataset with each shapes. When there is a pushpin inside a shape, the recordset is empty.

It looks like it is because the shapes are added BEFORE the pushpin. When I add a pushpin and THEN I add the shapes, it works. But I don't want to erase and re-add shapes every time I get a new vehicle position!!

Does anyone have any idea on that problem ?

Jean Bédard, Ing jr.
Kolombo Technologies
Québec, QC, Canada

Wilfried
10-21-2005, 12:30 PM
Hi,

While there is maybe a workaround for your prblem, I should calculate myself wheter the vehicle is in the area or not. Probably mutch faster and you have control yourself. If the area's are circular or rectangle it is very easy, if it is irregular shape somewhat more difficult 8)

Bed007
10-21-2005, 01:00 PM
Calculating latitude distances is easy as we can approx 1 degree of latitude to be 111.325 km. But calculating longitude distances depends on the latitude and can change from 111.325 km (at equator) to 0 km at north and south poles.

How to approximate longitudes distances ??

Wilfried
10-23-2005, 02:39 PM
Hi,

DistanceLongitude * Cosinus(Latitude);