How to obtain a place name (e.g. "New York City" or similar) given a location?

371
4
03-14-2014 07:09 AM
DanielMauer
New Contributor II
So, I have a map, which is being controlled/displayed via the Flex API.

The user has drawn a polygon on the map; this is working fine, I'm easily able to retrieve the coordinates of the points on the polygon, and so on.

What I'd like to accomplish -- but have zero idea HOW to accomplish -- is this.  I have no idea where place names would even come from, if I need to include another map layer, or some other external data source, or what... so please treat me as a bit of a newbie here.. :)

Given those polygon coordinates, I want to find a reasonable place name.  By "reasonable", I mean something vaguely similar to, say, finding the smallest named place whose boundaries completely encompass the polygon.  In other words, if we've got place names for New York State, New York City, Manhattan, and the Upper East Side, and I've drawn a polygon which is completely inside of Manhattan and contains parts of the Upper East Side, Central Park and Upper West Side, then the ideal name to return would be "Manhattan".  It would also be fine if I was to specify the "minimum size" of a named place, e.g. neighborhood level as opposed to, say, exact street address, and then I was able to get all the relevant place names that contain one of my polygon's vertices.

Is this something that can be done?  What resources (aside from the standard ArcGIS online satellite imagery map, which I'm currently using as my only map layer) will I need?

Thanks!

-Dan
Tags (2)
0 Kudos
4 Replies
RobertScheitlin__GISP
MVP Esteemed Contributor
Dan,

   You will need to publish (or find one that is already) a map service that has polygons for all those features you are describing, i.e. a polygon boundary of manhatten, east side, etc. Thenyou will do a quey against that mapservice using the drawn polygons as the queries geomorty. Once the results are returned you will need to detrmine the smallest level (likely a switch or if else statement).
0 Kudos
DanielMauer
New Contributor II
Thanks for the response.  So, for example, it appears the WorldTopoMap provided by ArcGIS online contains such place names and boundaries:

http://services.arcgisonline.com/ArcGIS/rest/services/World_Topo_Map/MapServer

...Given that, how would I go about querying against it?  And would I need to actually make that map visible, or could I just query against it without it being displayed?

Many thanks,
-dan

Dan,

   You will need to publish (or find one that is already) a map service that has polygons for all those features you are describing, i.e. a polygon boundary of manhatten, east side, etc. Thenyou will do a quey against that mapservice using the drawn polygons as the queries geomorty. Once the results are returned you will need to detrmine the smallest level (likely a switch or if else statement).
0 Kudos
RobertScheitlin__GISP
MVP Esteemed Contributor
Daniel,

   Here is a link to a sample that demonstrates a query:

https://developers.arcgis.com/flex/sample-code/query-result-in-table.htm

No you do not have to have that mapservice layer in your map to be able to query against it.
0 Kudos
PaulHastings1
Occasional Contributor
0 Kudos