Opened 15 years ago

Closed 7 years ago

#524 closed patch (fixed)

Covers support for Polygon-on-polygon, line on line, point on line for geography

Reported by: nick Owned by: pramsey
Priority: medium Milestone: PostGIS 2.4.0
Component: postgis Version: master
Keywords: geography polygon st_coveredby history Cc:

Description

As discussed, ST_CoveredBy has restrictions for geography and we desire polygon on polygon coverage tests.

http://postgis.refractions.net/pipermail/postgis-users/2010-May/026639.html

Attachments (4)

geograpy_covers_poly.patch (24.5 KB ) - added by dangerground 7 years ago.
geograpy_covers_poly.2.patch (39.8 KB ) - added by dangerground 7 years ago.
geograpy_covers_poly.3.patch (15.2 KB ) - added by dangerground 7 years ago.
geograpy_covers_poly.4.patch (16.1 KB ) - added by dangerground 7 years ago.

Download all attachments as: .zip

Change History (18)

comment:1 by pramsey, 15 years ago

Milestone: PostGIS 1.5.2PostGIS 2.0.0
Type: defectenhancement

comment:2 by pramsey, 13 years ago

Milestone: PostGIS 2.0.0PostGIS 2.1.0

comment:3 by robe, 12 years ago

Milestone: PostGIS 2.1.0PostGIS 2.2.0

comment:4 by pramsey, 10 years ago

Milestone: PostGIS 2.2.0PostGIS Future

comment:5 by dangerground, 7 years ago

I created a patch to add support for missing poly in poly, line in poly, line in line, point in line and point in point as function parameters. I added it as 2.4 Enhancement to the docs, but if it's to late for 2.4 I can change it to any later version.

by dangerground, 7 years ago

Attachment: geograpy_covers_poly.patch added

by dangerground, 7 years ago

comment:6 by dangerground, 7 years ago

ignore the first file (I can't delete it and forgot to overwrite when uploading the correct patch)

comment:7 by robe, 7 years ago

Milestone: PostGIS FuturePostGIS 2.4.0
Version: 1.5.Xtrunk

It's not too late for 2.4. We only released an alpha which means we can still have more features in it before final release.

comment:8 by robe, 7 years ago

Keywords: history added
Type: enhancementpatch

We'll look at this during the code sprint on Saturday - https://wiki.osgeo.org/wiki/FOSS4G_2017_Code_Sprint#PostGIS

One change I request for you patch. You have a delete of update_geocoder.bat file mixed in here, which I assume is unintended

https://trac.osgeo.org/postgis/attachment/ticket/524/geograpy_covers_poly.2.patch

Can you submit a 3rd version of patch without that.

Thanks, Regina

by dangerground, 7 years ago

comment:9 by robe, 7 years ago

Danny,

I still need to test this to make sure it behaves as expected. I haven't forgotten.

pramsey,

If you can verify the code lives up to your high standards that would be swell.

Thanks, Regina

comment:10 by robe, 7 years ago

Okay I see something wrong here:

A geography should cover itself and this test fails that.

WITH c(id,geog) AS ( VALUES ( 1, ST_MakeLine(ST_Point(-10,2), ST_Point(-8, 80) )::geography),
             ( 2, ST_Segmentize(ST_MakeLine(ST_Point(-10,2), ST_Point(-8, 80) )::geography,50000) ) 
 )
SELECT c1.id, c2.id As c2_id
FROM c As c1 INNER JOIN c AS c2 ON ST_Covers(c1.geog, c2.geog)

I get:

 id | c2_id
----+-------
  2 |     1
(1 row)

when I would expect

1  1
1  2
2  1
2  2

The 1 2 is possible might be left out because of rounding issues.

comment:11 by dangerground, 7 years ago

Ok, I had a simpler versions of linestrings in mind when designing the algorithm. I fixed that, so it does also accept segmented lines. I also fixed the self coverage for polygons and added the related regression tests.

by dangerground, 7 years ago

comment:12 by robe, 7 years ago

Summary: Polygon-on-polygon covers for geographyCovers support for Polygon-on-polygon, line on line, point on line, point on point for geography

comment:13 by robe, 7 years ago

Summary: Covers support for Polygon-on-polygon, line on line, point on line, point on point for geographyCovers support for Polygon-on-polygon, line on line, point on line for geography

comment:14 by robe, 7 years ago

Resolution: fixed
Status: newclosed

In 15599:

Covers support for Polygon-on-polygon, line on line, point on line, point on point for geography
Patch from Danny Götte
Closes #524

Note: See TracTickets for help on using tickets.