Mapping Toolbox    

Geographically Filtering Datasets

Often, a set of data will contain unwanted data mixed in with the desired values. For example, your data might include points for the entire United States, but you only want to work with those points falling in Alabama, or perhaps the dataset is untidy- out of 4,000 points, you notice that 3 or 4 obviously fall outside of reality (for example, one of your city-points is in the middle of the ocean). It can be quite a chore to look at each dataset element individually. Perhaps selecting a portion of the data is part of your analysis.

The filterm command works with a matrix map to filter a vector dataset. The form is of the following:

In short, each location defined by lats and lons is compared to the value at that point in map. If the value is allowed, that point is included in flats and flons.

The map might be a politically indexed map, and the allowed values might be the code or codes corresponding to the states or countries desired (e.g., Alabama). The map might also be a valued map, or a logical condition thereon, and the allowed value might be 1 for true. Here's what an example might look like using the topo map:

The result would be those points corresponding to land.


  Equal-Areas in Geographic Statistics Navigation