<html>
<head>
<style>
P
{
margin:0px;
padding:0px
}
body
{
FONT-SIZE: 10pt;
FONT-FAMILY:Tahoma
}
</style>
</head>
<body>Hello,<br><br>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. <br><br>For example, generate a list of distinct owners for the parcels within a given bounding box and the parcel count for each owner. <br><br> 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. <br><br>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<br><br>"select distinct owner from parcels WHERE SHAPE INTERSECTS GEOMFROMTEXT('".$geomtext."')"<br><br>Am I correct in thinking this functionality doesn't exist for FDO in straight up SQL?<br><br>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?<br><br>Thanks in advance!<br><br>Trent<br></body>
</html>