Opened 9 years ago

Closed 19 months 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: trunk
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 19 months ago.
geograpy_covers_poly.2.patch (39.8 KB) - added by dangerground 19 months ago.
geograpy_covers_poly.3.patch (15.2 KB) - added by dangerground 19 months ago.
geograpy_covers_poly.4.patch (16.1 KB) - added by dangerground 19 months ago.

Download all attachments as: .zip

Change History (18)

comment:1 Changed 9 years ago by pramsey

Milestone: PostGIS 1.5.2PostGIS 2.0.0
Type: defectenhancement

comment:2 Changed 7 years ago by pramsey

Milestone: PostGIS 2.0.0PostGIS 2.1.0

comment:3 Changed 6 years ago by robe

Milestone: PostGIS 2.1.0PostGIS 2.2.0

comment:4 Changed 4 years ago by pramsey

Milestone: PostGIS 2.2.0PostGIS Future

comment:5 Changed 19 months ago by dangerground

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.

Changed 19 months ago by dangerground

Attachment: geograpy_covers_poly.patch added

Changed 19 months ago by dangerground

comment:6 Changed 19 months ago by dangerground

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

comment:7 Changed 19 months ago by robe

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 Changed 19 months ago by robe

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

Changed 19 months ago by dangerground

comment:9 Changed 19 months ago by robe

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 Changed 19 months ago by robe

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 Changed 19 months ago by dangerground

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.

Changed 19 months ago by dangerground

comment:12 Changed 19 months ago by robe

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 Changed 19 months ago by robe

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 Changed 19 months ago by robe

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.