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!
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.
https://go.documentation.sas.com/doc/en/pgmmvacdc/9.4/grmapref/n1em0w0lpfi8qdn1jhervlg4lsyw.htm
Koen
Join us for SAS Innovate 2025, our biggest and most exciting global event of the year, in Orlando, FL, from May 6-9. Sign up by March 14 for just $795.
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.
Ready to level-up your skills? Choose your own adventure.