[mapguide-users] Distinct query combined with spatial query?
Trent Pingenot
pintj at hotmail.com
Fri Aug 24 14:21:47 EDT 2007
Hello,I am building an application using the Web API using PHP. I am trying to build a query that can select features within a user supplied bounding box and summarize the selected features for a given attribute. For example, generate a list of distinct owners for the parcels within a given bounding box and the parcel count for each owner. I can successfully do either part (distinct or spatial) of the query using an MgFeatureAggregateOptions object and setting my query to be distinct or by using a spatial filter or a basic filter with a SHAPE INTERSECTS GEOMFROMTEXT('$geomtext') expression. However when I combine the two I simply get all the features in the area, which I believe boils down to distinct geometries, not distinct owners. I also experimented with the $featureService->ExecuteSqlQuery() command and select distinct records this way but to my knowledge this won't work for spatial selections such as"select distinct owner from parcels WHERE SHAPE INTERSECTS GEOMFROMTEXT('".$geomtext."')"Am I correct in thinking this functionality doesn't exist for FDO in straight up SQL?Does anyone have suggestions on how to accomplish this type of selection using the API? In this application I'm using Google Earth as the front end so I don't have a MGOS viewer with a map and layers that I can utilize within my code. Do I need to create a temporary feature store with my spatial selection then run a separate distinct query on it, or is there a more straight forward answer?Thanks in advance!Trent
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/mapguide-users/attachments/20070824/3735f340/attachment.html
More information about the mapguide-users
mailing list