We are using SQL Anywhere v12.01.
We have captured a list of GPS coordinates that define a sales territory. I want to determine if a customer's coordinate will be inside that territory. Looking for some direction on how this might possibly be implemented. I am new to spatial data, is that is possible solution and how would I go about converting my list of GPS coordinates to a special data?
Thanks in advance for any guidance.
asked 24 Apr '15, 18:21
I think we have a pretty solid implementation started for this project.
We are capturing gps coordinates for our territory boundaries for a given territory. We load these into a table using a column of type st_polygon. Here is an example:
insert into sy_territory
(territory_id, territory_name, boundaries)
We can then compare our customer table which contains a column of type st_point which hold the gps coordinate of the customer against the sy_territory table:
select customer.customer, customer_name, customer.city, customer.location, customer_in_territory = (select customer.location.st_within(boundaries) from sy_territory where territory_id = 10) from customer