{"action":"created","issue":{"url":"https://api.github.com/repos/CartoDB/cartoframes/issues/449","repository_url":"https://api.github.com/repos/CartoDB/cartoframes","labels_url":"https://api.github.com/repos/CartoDB/cartoframes/issues/449/labels{/name}","comments_url":"https://api.github.com/repos/CartoDB/cartoframes/issues/449/comments","events_url":"https://api.github.com/repos/CartoDB/cartoframes/issues/449/events","html_url":"https://github.com/CartoDB/cartoframes/issues/449","id":331333094,"node_id":"MDU6SXNzdWUzMzEzMzMwOTQ=","number":449,"title":"GeoSeries.touches(other) and GeoSeries.intersects(other) unexpected behavior","user":{"login":"MichaelSpichiger","id":18369460,"node_id":"MDQ6VXNlcjE4MzY5NDYw","avatar_url":"https://avatars2.githubusercontent.com/u/18369460?v=4","gravatar_id":"","url":"https://api.github.com/users/MichaelSpichiger","html_url":"https://github.com/MichaelSpichiger","followers_url":"https://api.github.com/users/MichaelSpichiger/followers","following_url":"https://api.github.com/users/MichaelSpichiger/following{/other_user}","gists_url":"https://api.github.com/users/MichaelSpichiger/gists{/gist_id}","starred_url":"https://api.github.com/users/MichaelSpichiger/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/MichaelSpichiger/subscriptions","organizations_url":"https://api.github.com/users/MichaelSpichiger/orgs","repos_url":"https://api.github.com/users/MichaelSpichiger/repos","events_url":"https://api.github.com/users/MichaelSpichiger/events{/privacy}","received_events_url":"https://api.github.com/users/MichaelSpichiger/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2018-06-11T20:13:45Z","updated_at":"2018-06-11T20:24:38Z","closed_at":null,"author_association":"NONE","body":"So using these two datasets, we ran into some unexpected behavior of the intersect and touches functions.\r\n```python\r\nassigned_bins = cc.read('assigned_hexbins')\r\nunassigned_bins = cc.read('unassigned_hexbins')\r\n```\r\n\r\n[assigned_hexbins.csv.zip](https://github.com/CartoDB/cartoframes/files/2091578/assigned_hexbins.csv.zip)\r\n[unassigned_hexbins.csv.zip](https://github.com/CartoDB/cartoframes/files/2091579/unassigned_hexbins.csv.zip)\r\n\r\nWe converted the dataframes into geodataframes \r\n```python\r\nunassigned_bins =cc.query('SELECT *, ST_AsText(the_geom) as geom FROM mspichigercarto.unassigned_hexbins').reset_index()\r\nassigned_bins =cc.query('SELECT *, ST_AsText(the_geom) as geom FROM mspichigercarto.assigned_hexbins').reset_index()\r\n\r\nimport shapely.wkt\r\n\r\ngeometry = unassigned_bins['geom'].map(shapely.wkt.loads)\r\nunassigned_bins = unassigned_bins.drop('geom', axis=1)\r\ncrs = {'init': 'epsg:4326'}\r\nunassigned_bins_geo = gpd.GeoDataFrame(unassigned_bins, crs=crs, geometry=geometry)`\r\nimport shapely.wkt\r\n\r\ngeometry = assigned_bins['geom'].map(shapely.wkt.loads)\r\nassigned_bins = assigned_bins.drop('geom', axis=1)\r\ncrs = {'init': 'epsg:4326'}\r\nassigned_bins_geo = gpd.GeoDataFrame(assigned_bins, crs=crs, geometry=geometry)\r\n```\r\n\r\nThen we tried running touches and intersects on them, but instead of returning expected values it would return false for everything and none of the geometries intersected. \r\n\r\n`assigned_bins_geo.touches(unassigned_bins_geo)`\r\n\r\nWe then ran this query in cartoframes\r\n\r\n```python\r\nst_touch_query = '''\r\nSELECT assigned_hexbins.*,\r\n      unassigned_hexbins.cartodb_id as index_unassigned\r\nFROM assigned_hexbins, unassigned_hexbins\r\nWHERE ST_Touches(assigned_hexbins.the_geom, unassigned_hexbins.the_geom)\r\n'''\r\n```\r\naccording to this query, the hexbins are touching so touches and intersects are not working as expected."},"comment":{"url":"https://api.github.com/repos/CartoDB/cartoframes/issues/comments/396374843","html_url":"https://github.com/CartoDB/cartoframes/issues/449#issuecomment-396374843","issue_url":"https://api.github.com/repos/CartoDB/cartoframes/issues/449","id":396374843,"node_id":"MDEyOklzc3VlQ29tbWVudDM5NjM3NDg0Mw==","user":{"login":"andy-esch","id":1041056,"node_id":"MDQ6VXNlcjEwNDEwNTY=","avatar_url":"https://avatars2.githubusercontent.com/u/1041056?v=4","gravatar_id":"","url":"https://api.github.com/users/andy-esch","html_url":"https://github.com/andy-esch","followers_url":"https://api.github.com/users/andy-esch/followers","following_url":"https://api.github.com/users/andy-esch/following{/other_user}","gists_url":"https://api.github.com/users/andy-esch/gists{/gist_id}","starred_url":"https://api.github.com/users/andy-esch/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/andy-esch/subscriptions","organizations_url":"https://api.github.com/users/andy-esch/orgs","repos_url":"https://api.github.com/users/andy-esch/repos","events_url":"https://api.github.com/users/andy-esch/events{/privacy}","received_events_url":"https://api.github.com/users/andy-esch/received_events","type":"User","site_admin":false},"created_at":"2018-06-11T20:24:38Z","updated_at":"2018-06-11T20:24:38Z","author_association":"MEMBER","body":"Hey @MichaelSpichiger thanks for finding this.\r\n\r\nCould you do a couple of things to debug:\r\n\r\n1. Download the data as a shapefiles or GeoJSONs directly and load it with GeoPandas' `.read_file` method\r\n2. Try out the touches code to see if you get the same as above.\r\n\r\nIf you get the same result with that process, it's not a cartoframes bug. Looking forward to seeing the results :)"}}
{"actor":{"display_login":"andy-esch"}}