-
Notifications
You must be signed in to change notification settings - Fork 925
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
intersection not returning true on polygons that have 1 point in common #317
Comments
@davidanderson-1701 Would it be possible to provide a reproducible, self-contained example? (runnable code). Because it is difficult to say what is going on without knowing exactly what is inside Anyway, two remarks:
|
I've attached a shapefile with some representative data. The process I used is `def slink_union(slink_list): spatial_data = gpd.read_file(r'F:\workspace\lb_test.shp') The three polygons are arranged like this: So one corner touching and one line touching. The code produces two polygons. One that is a single and one that is the Really the issue is that unary_union is not seeing those polygons as intersecting and thus not combining them. On Mon, May 16, 2016 at 1:05 PM, Joris Van den Bossche <
|
I am processing a largish spatial dataset wherein group together various polygons based on attributes, then do a spatial union. For the case where the polygons touch at just point, the union is creating two polygons and not one.
Checking the data for individual cases, the polygons neither intersect nor are disjoint.
Here is the data in wkt
array([ 'POLYGON ((503988.2057999996500000 5214800.2800999992000000, 503838.2706000004000000 5214797.4101000000000000, 503835.3997999997800000 5214947.3000000007000000, 503985.3349000001300000 5214950.1699999999000000, 503988.2057999996500000 5214800.28009999
array([ 'POLYGON ((504141.0118000004400000 5214653.2601999994000000, 503991.0766000002600000 5214650.3902000003000000, 503988.2057999996500000 5214800.2800999992000000, 504138.1409000000000000 5214803.1501000002000000, 504141.0118000004400000 5214653.2601999994000000))'], dtype=object)
The common point is :
503988.2057999996500000 5214800.2800999992000000
Here are the commands that I tried:
spatial_data[spatial_data['SIMPLE_ID']==4309842].intersects(spatial_data[spatial_data['SIMPLE_ID']==4305747])
Out[20]:
77007 False
77681 False
spatial_data[spatial_data['SIMPLE_ID']==4309842].disjoint(spatial_data[spatial_data['SIMPLE_ID']==4305747])
Out[21]:
77007 False
77681 False
spatial_data[spatial_data['SIMPLE_ID']==4309842].touches(spatial_data[spatial_data['SIMPLE_ID']==4305747])
Out[22]:
77007 False
77681 False
Loading the data into Spatialite to test (since it uses the same geos library) does result in two polygons intersecting.
The text was updated successfully, but these errors were encountered: