BookmarkSubscribeRSS Feed
Obsidian | Level 7

How to check if a location(latitude, longitude) in a map area(district/city/province)?


Have mapsgfk.china


input (lat, long)


want city name


Since proc gmap choro illustrates the map with color pretty nice, I guess there's a way to check if a point is in that color set, which refers to an area.


Thanks in advance! 

Super User

Easy : check if a point is inside map region (district/province/whatever) when you have a point coordinates in the same coordinate system the map uses and the boundaries of the area are in the map: Proc Ginside.


Since that map set you reference does not have anything I recognize as a city then it doesn't really help much if that is what you want.


If you have a source of city point coordinates you might investigate find the minimum distance to cities using the GEODIST function. This topic has also been discussed on the forum a few times.




Available on demand!

Missed SAS Innovate Las Vegas? Watch all the action for free! View the keynotes, general sessions and 22 breakouts on demand.


Register now!

What is Bayesian Analysis?

Learn the difference between classical and Bayesian statistical approaches and see a few PROC examples to perform Bayesian analysis in this video.

Find more tutorials on the SAS Users YouTube channel.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 3 replies
  • 4 in conversation