Take the 2-minute tour ×
Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. It's 100% free, no registration required.

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
add comment

1 Answer 1

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: http://dev.openlayers.org/releases/OpenLayers-2.12/examples/getfeatureinfo-popup.html

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
add comment

Your Answer

 
discard

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.