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 have a requirement for users to be able to select a point within a state within the US on a map (which would be an openlayers web application) and once they clicked on the map it would derive the following: a.) the latitude and longitude of the point that was clicked on the map b.) the county that contained this click point

What possible ways could the above be implemented?

share|improve this question

You would have to set up some sort of service or polygon layer for the US counties. One possible solution (if you don't have your own US counties data) is to find a public WFS or WMS service. Here's one that doesn't contain counties, but is a good example of how you'd do it using OpenLayers.

Also helpful if by chance you're mapping fire stations in Medford, Oregon ;).

Here's a public US counties boundary WMS, but I couldn't get it to work.

Here's another example on the OpenLayers examples page:

If you're using your own data and don't want to make a WMS out of it, I think you could do something similar with KML. I'm not terribly sure of that, however.

Yet another possible implementation would involve PostGIS and some simple spatial queries, but I'm not sure whether that's even feasible for your setup.

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.