Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I am creating an Esri Flex API application (not the viewer), and have been creating a tool to use the World Places Locator.

For now, I am just zooming to the top scoring candidate returned.

If you search for Brighton, it returns you 20 candidates, sorted by score.

I read on an older blog post:

You can also filter the results by extent using client logic. The candidates field to look for in this case are North_Lat, South_Lat, East_Lon, and West_Lon. Source.

I am thinking it would be a good idea to have a tickbox on my search, that limits the results to the current extent of the map in the Flex app. (Or maybe buffer a litte out from the view).

I understand the logic on how to go about this, but was wondering if anyone has already done this (does not have to be Flex) so that I can save some time coding it.

If not, I will have a go at this next weekend and post my answer.

share|improve this question
up vote 1 down vote accepted

I have done something similar using C# and LINQ. Basically, I just get the extent from the map, then using LINQ, I queried for the X and Y values that fall within the extent. A crude way to do it would be with if statements. I just googled and found this implementation of linq for ActionScript called ActionLinq:

So here is some pseudo code without using Linq:

candidatesInExtent = new List;

foreach (candidate in returnedCandidates)
  if(candidate.x > extent.minX || candidate.y > extent.minY)
    if(candidate.x < extent.maxX || candidate.y < extent.maxY)
share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.