Created
August 23, 2018 13:35
-
-
Save sergiolucero/b82664d64a06eee7d083813bc2ddea91 to your computer and use it in GitHub Desktop.
point in geometry
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import geopandas | |
| import pandas as pd | |
| from shapely.geometry import Point | |
| gdf = gp.read_file('http://quant.cl/static/DATA/GEO/comunas13.json') | |
| rand = pd.np.random.randn | |
| points=[Point((-70.7+0.1*rand(),-33.4+0.1*rand())) for _ in range(10)] | |
| for point in points: | |
| for cid,comuna in gdf.iterrows(): | |
| if point.within(comuna['geometry']): | |
| print(point,comuna['NOMBRE']) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment