Identifying “long and narrow” polygons in with PostGISlength and width of polygonWhy postgis st_overlaps reports Qgis' “avoid intersections” generated polygon as overlapping with others?Adjusting polygons to boundary and filling holesDrawing polygons with fixed area?How to remove spikes in Polygons with PostGISDeleting sliver polygons after difference operation in QGIS?Snapping boundaries in PostGISSplit polygon into parts adding attributes based on underlying polygon in QGISSplitting overlap between polygons and assign to nearest polygon using PostGIS?Expanding polygons and clipping at midpoint?Removing Intersection of Buffers in Same Layers
Mimic lecturing on blackboard, facing audience
How do I tell my boss that I'm quitting soon, especially given that a colleague just left this week
Multiplicative persistence
Why is the "ls" command showing permissions of files in a FAT32 partition?
US tourist/student visa
What (the heck) is a Super Worm Equinox Moon?
Shouldn’t conservatives embrace universal basic income?
Find the next value of this number series
How much theory knowledge is actually used while playing?
How does electrical safety system work on ISS?
Is it necessary to use pronouns with the verb "essere"?
How to get directions in deep space?
Is there a RAID 0 Equivalent for RAM?
What is Cash Advance APR?
Is there any evidence that Cleopatra and Caesarion considered fleeing to India to escape the Romans?
A Trivial Diagnosis
Why do ¬, ∀ and ∃ have the same precedence?
Non-trope happy ending?
Can I cause damage to electrical appliances by unplugging them when they are turned on?
Giving feedback to someone without sounding prejudiced
How can I, as DM, avoid the Conga Line of Death occurring when implementing some form of flanking rule?
What features enable the Su-25 Frogfoot to operate with such a wide variety of fuels?
Review your own paper in Mathematics
How to draw a matrix with arrows in limited space
Identifying “long and narrow” polygons in with PostGIS
length and width of polygonWhy postgis st_overlaps reports Qgis' “avoid intersections” generated polygon as overlapping with others?Adjusting polygons to boundary and filling holesDrawing polygons with fixed area?How to remove spikes in Polygons with PostGISDeleting sliver polygons after difference operation in QGIS?Snapping boundaries in PostGISSplit polygon into parts adding attributes based on underlying polygon in QGISSplitting overlap between polygons and assign to nearest polygon using PostGIS?Expanding polygons and clipping at midpoint?Removing Intersection of Buffers in Same Layers
I have a set of polygons representing large areas, say city neighborhoods. I want to identify the large overlapping areas between them.
But there's a problem: sometimes these polygons will overlap along their perimeters (because they were drawn with little precision). This will generate long and narrow overlaps that I do not care about.
But other times there will be big overlaps of robust polygons, meaning large areas where a neighborhood's polygon overlaps another. I want to select only these.
See the picture below of just the overlaps. Imagine I wanted to select only the blue polygon in the lower left corner.
I could look at areas, but sometimes the narrow ones are so long they end up having areas as large as the blue polygon. I've tried to do a ratio of area / perimeter, but that has also yielded mixed results.
I've even tried using ST_MinimumClearance
, but sometimes the large areas will have a narrow part attached to it, or two very close vertices.
Any ideas of other approaches?
In the end what worked best for me was using a negative buffer, as suggested by @Cyril and @FGreg below.
I used something like:
ST_Area(ST_Buffer(geom, -10)) as neg_buffer_area
In my case, units were meters, so 10 m negative buffer.
For narrow polygons, this area returned zero (also, the geometry would be empty). Then I used this column to filter out the narrow polygons.
qgis postgis slivers
add a comment |
I have a set of polygons representing large areas, say city neighborhoods. I want to identify the large overlapping areas between them.
But there's a problem: sometimes these polygons will overlap along their perimeters (because they were drawn with little precision). This will generate long and narrow overlaps that I do not care about.
But other times there will be big overlaps of robust polygons, meaning large areas where a neighborhood's polygon overlaps another. I want to select only these.
See the picture below of just the overlaps. Imagine I wanted to select only the blue polygon in the lower left corner.
I could look at areas, but sometimes the narrow ones are so long they end up having areas as large as the blue polygon. I've tried to do a ratio of area / perimeter, but that has also yielded mixed results.
I've even tried using ST_MinimumClearance
, but sometimes the large areas will have a narrow part attached to it, or two very close vertices.
Any ideas of other approaches?
In the end what worked best for me was using a negative buffer, as suggested by @Cyril and @FGreg below.
I used something like:
ST_Area(ST_Buffer(geom, -10)) as neg_buffer_area
In my case, units were meters, so 10 m negative buffer.
For narrow polygons, this area returned zero (also, the geometry would be empty). Then I used this column to filter out the narrow polygons.
qgis postgis slivers
4
Certainly the area/perimeter ratio could be used for this.
– Vince
yesterday
It's hard to tell where the distinct polygons are from the image, but doing something like this gis.stackexchange.com/a/265233/64838 might work? Calculate minimum rotated bounding box then discard ones with small width or height.
– FGreg
yesterday
You could also try using a negative buffer as described here: How can I identify really thin polygons in my shape file?
– FGreg
yesterday
add a comment |
I have a set of polygons representing large areas, say city neighborhoods. I want to identify the large overlapping areas between them.
But there's a problem: sometimes these polygons will overlap along their perimeters (because they were drawn with little precision). This will generate long and narrow overlaps that I do not care about.
But other times there will be big overlaps of robust polygons, meaning large areas where a neighborhood's polygon overlaps another. I want to select only these.
See the picture below of just the overlaps. Imagine I wanted to select only the blue polygon in the lower left corner.
I could look at areas, but sometimes the narrow ones are so long they end up having areas as large as the blue polygon. I've tried to do a ratio of area / perimeter, but that has also yielded mixed results.
I've even tried using ST_MinimumClearance
, but sometimes the large areas will have a narrow part attached to it, or two very close vertices.
Any ideas of other approaches?
In the end what worked best for me was using a negative buffer, as suggested by @Cyril and @FGreg below.
I used something like:
ST_Area(ST_Buffer(geom, -10)) as neg_buffer_area
In my case, units were meters, so 10 m negative buffer.
For narrow polygons, this area returned zero (also, the geometry would be empty). Then I used this column to filter out the narrow polygons.
qgis postgis slivers
I have a set of polygons representing large areas, say city neighborhoods. I want to identify the large overlapping areas between them.
But there's a problem: sometimes these polygons will overlap along their perimeters (because they were drawn with little precision). This will generate long and narrow overlaps that I do not care about.
But other times there will be big overlaps of robust polygons, meaning large areas where a neighborhood's polygon overlaps another. I want to select only these.
See the picture below of just the overlaps. Imagine I wanted to select only the blue polygon in the lower left corner.
I could look at areas, but sometimes the narrow ones are so long they end up having areas as large as the blue polygon. I've tried to do a ratio of area / perimeter, but that has also yielded mixed results.
I've even tried using ST_MinimumClearance
, but sometimes the large areas will have a narrow part attached to it, or two very close vertices.
Any ideas of other approaches?
In the end what worked best for me was using a negative buffer, as suggested by @Cyril and @FGreg below.
I used something like:
ST_Area(ST_Buffer(geom, -10)) as neg_buffer_area
In my case, units were meters, so 10 m negative buffer.
For narrow polygons, this area returned zero (also, the geometry would be empty). Then I used this column to filter out the narrow polygons.
qgis postgis slivers
qgis postgis slivers
edited 3 hours ago
PolyGeo♦
53.7k1781244
53.7k1781244
asked yesterday
bplmpbplmp
885
885
4
Certainly the area/perimeter ratio could be used for this.
– Vince
yesterday
It's hard to tell where the distinct polygons are from the image, but doing something like this gis.stackexchange.com/a/265233/64838 might work? Calculate minimum rotated bounding box then discard ones with small width or height.
– FGreg
yesterday
You could also try using a negative buffer as described here: How can I identify really thin polygons in my shape file?
– FGreg
yesterday
add a comment |
4
Certainly the area/perimeter ratio could be used for this.
– Vince
yesterday
It's hard to tell where the distinct polygons are from the image, but doing something like this gis.stackexchange.com/a/265233/64838 might work? Calculate minimum rotated bounding box then discard ones with small width or height.
– FGreg
yesterday
You could also try using a negative buffer as described here: How can I identify really thin polygons in my shape file?
– FGreg
yesterday
4
4
Certainly the area/perimeter ratio could be used for this.
– Vince
yesterday
Certainly the area/perimeter ratio could be used for this.
– Vince
yesterday
It's hard to tell where the distinct polygons are from the image, but doing something like this gis.stackexchange.com/a/265233/64838 might work? Calculate minimum rotated bounding box then discard ones with small width or height.
– FGreg
yesterday
It's hard to tell where the distinct polygons are from the image, but doing something like this gis.stackexchange.com/a/265233/64838 might work? Calculate minimum rotated bounding box then discard ones with small width or height.
– FGreg
yesterday
You could also try using a negative buffer as described here: How can I identify really thin polygons in my shape file?
– FGreg
yesterday
You could also try using a negative buffer as described here: How can I identify really thin polygons in my shape file?
– FGreg
yesterday
add a comment |
4 Answers
4
active
oldest
votes
I would try to create a negative buffer, if it eats thin polygons, then it’s good, if it doesn’t eat the polygon, then it’s mine ... :-)
run this script, having previously set 2/3 of the width of the linear polygons ...
create table name_table as
SELECT ST_Buffer(
(ST_Dump(
(ST_Union(
ST_Buffer(
(geom),-0.0001))))).geom,
0.0001)) as geom from source_table
OS :-)...
in the end your suggestion is what worked best for me. I ended using something likeST_Area(ST_Buffer(geom, -10))
, the -10 being -10 meters in my case. If anything returned 0 from that expression then I could filter it out.
– bplmp
11 hours ago
Thank you, I am glad that it helped you, use this approach in such cases, with respect ...
– Cyril
11 hours ago
add a comment |
Instead of area/perimeter, it is better to use the area divided by the square of the perimeter (or its inverse).
This is also called "shape index". The square of the perimeter divided by the area has a minimum value of 4*Pi() (in the case of a disk, which is the most compact 2D geometry), so it can be normalized by 4*Pi() for an easy interpretation (normalized values close to 1 then mean that you have very compact objects and squares have a values of approximately 1.27).
EDIT: A threshold on the area would be usefull to remove the very small artefacts, which could be compact. Then the shape index would show better contrast.
EDIT: in addition to this answer, the use of ST_Snap could help you solve the problem before it occurs.
Thanks! But I'm unsure how ST_Snap could help in this case... If I got it right, you're suggesting something like(o.overlap_perimeter^2 / o.overlap_area) / (4 * Pi()) as overlap_ratio
? This is having worse results for me than just area / perimeter.
– bplmp
yesterday
Now usingo.overlap_perimeter / (4 * sqrt(o.overlap_area)) as overlap_ratio
according to this paper, but still worse results (although that's hard to quantify what I mean by worse) isprs-ann-photogramm-remote-sens-spatial-inf-sci.net/I-7/135/…, page 183.
– bplmp
yesterday
2
Thank you for this, I had never heard of the "shape index". I had always thought that using a minimum bounding rectangle was the best way to answer this sort of question. I found this, repository.asu.edu/attachments/111230/content/…, which is interesting.
– John Powell
yesterday
@JohnPowell intersting paper, thanks. I see that what I know as a shape index is called circularity index in the paper. My problem with minimum bounding rectangles is that it doesn't work with very concave objects (e.g. U-shaped)
– radouxju
18 hours ago
@bplmp ST_Snap would help you snap the vertices of "nearly" adjacent polygons so that they do no overlap anymore. There is no scale on your figures, but your artefact look like lines, so I guess that you can use a tolerance value theat is enough to avoid artefacts but does not affect the large polygons.
– radouxju
17 hours ago
|
show 2 more comments
One option would be to use the ratio of the area of the polygon to the longest line that can be drawn using its extremities. Identifying long narrow polygons.
select * from polygons where ST_Length(ST_LongestLine(geom, geom)) < ST_Area(geom) * 4
This works pretty well for sliver polygons. You can adjust what the ratio (what you multiply the area with) to suit your needs and projection.
add a comment |
It sounds like this might match your use case: Eliminate selected polygons
Combines selected polygons of the input layer with certain adjacent polygons by erasing their common boundary. The adjacent polygon can be either the one with the largest or smallest area or the one sharing the largest common boundary with the polygon to be eliminated.
Eliminate is normally used to get rid of sliver polygons, i.e. tiny polygons that are a result of polygon intersection processes where boundaries of the inputs are similar but not identical.
It sounds like you'd want to try the "Largest Common Boundary" option.
New contributor
I realize now you were asking for postgis solutions not qgis solutions. My apologies, I don't think postgis has an equivalent function but I'll leave this up for posterity.
– FGreg
yesterday
add a comment |
Your Answer
StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "79"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);
else
createEditor();
);
function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: false,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: null,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);
);
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fgis.stackexchange.com%2fquestions%2f316128%2fidentifying-long-and-narrow-polygons-in-with-postgis%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
4 Answers
4
active
oldest
votes
4 Answers
4
active
oldest
votes
active
oldest
votes
active
oldest
votes
I would try to create a negative buffer, if it eats thin polygons, then it’s good, if it doesn’t eat the polygon, then it’s mine ... :-)
run this script, having previously set 2/3 of the width of the linear polygons ...
create table name_table as
SELECT ST_Buffer(
(ST_Dump(
(ST_Union(
ST_Buffer(
(geom),-0.0001))))).geom,
0.0001)) as geom from source_table
OS :-)...
in the end your suggestion is what worked best for me. I ended using something likeST_Area(ST_Buffer(geom, -10))
, the -10 being -10 meters in my case. If anything returned 0 from that expression then I could filter it out.
– bplmp
11 hours ago
Thank you, I am glad that it helped you, use this approach in such cases, with respect ...
– Cyril
11 hours ago
add a comment |
I would try to create a negative buffer, if it eats thin polygons, then it’s good, if it doesn’t eat the polygon, then it’s mine ... :-)
run this script, having previously set 2/3 of the width of the linear polygons ...
create table name_table as
SELECT ST_Buffer(
(ST_Dump(
(ST_Union(
ST_Buffer(
(geom),-0.0001))))).geom,
0.0001)) as geom from source_table
OS :-)...
in the end your suggestion is what worked best for me. I ended using something likeST_Area(ST_Buffer(geom, -10))
, the -10 being -10 meters in my case. If anything returned 0 from that expression then I could filter it out.
– bplmp
11 hours ago
Thank you, I am glad that it helped you, use this approach in such cases, with respect ...
– Cyril
11 hours ago
add a comment |
I would try to create a negative buffer, if it eats thin polygons, then it’s good, if it doesn’t eat the polygon, then it’s mine ... :-)
run this script, having previously set 2/3 of the width of the linear polygons ...
create table name_table as
SELECT ST_Buffer(
(ST_Dump(
(ST_Union(
ST_Buffer(
(geom),-0.0001))))).geom,
0.0001)) as geom from source_table
OS :-)...
I would try to create a negative buffer, if it eats thin polygons, then it’s good, if it doesn’t eat the polygon, then it’s mine ... :-)
run this script, having previously set 2/3 of the width of the linear polygons ...
create table name_table as
SELECT ST_Buffer(
(ST_Dump(
(ST_Union(
ST_Buffer(
(geom),-0.0001))))).geom,
0.0001)) as geom from source_table
OS :-)...
answered 17 hours ago
CyrilCyril
1,0051214
1,0051214
in the end your suggestion is what worked best for me. I ended using something likeST_Area(ST_Buffer(geom, -10))
, the -10 being -10 meters in my case. If anything returned 0 from that expression then I could filter it out.
– bplmp
11 hours ago
Thank you, I am glad that it helped you, use this approach in such cases, with respect ...
– Cyril
11 hours ago
add a comment |
in the end your suggestion is what worked best for me. I ended using something likeST_Area(ST_Buffer(geom, -10))
, the -10 being -10 meters in my case. If anything returned 0 from that expression then I could filter it out.
– bplmp
11 hours ago
Thank you, I am glad that it helped you, use this approach in such cases, with respect ...
– Cyril
11 hours ago
in the end your suggestion is what worked best for me. I ended using something like
ST_Area(ST_Buffer(geom, -10))
, the -10 being -10 meters in my case. If anything returned 0 from that expression then I could filter it out.– bplmp
11 hours ago
in the end your suggestion is what worked best for me. I ended using something like
ST_Area(ST_Buffer(geom, -10))
, the -10 being -10 meters in my case. If anything returned 0 from that expression then I could filter it out.– bplmp
11 hours ago
Thank you, I am glad that it helped you, use this approach in such cases, with respect ...
– Cyril
11 hours ago
Thank you, I am glad that it helped you, use this approach in such cases, with respect ...
– Cyril
11 hours ago
add a comment |
Instead of area/perimeter, it is better to use the area divided by the square of the perimeter (or its inverse).
This is also called "shape index". The square of the perimeter divided by the area has a minimum value of 4*Pi() (in the case of a disk, which is the most compact 2D geometry), so it can be normalized by 4*Pi() for an easy interpretation (normalized values close to 1 then mean that you have very compact objects and squares have a values of approximately 1.27).
EDIT: A threshold on the area would be usefull to remove the very small artefacts, which could be compact. Then the shape index would show better contrast.
EDIT: in addition to this answer, the use of ST_Snap could help you solve the problem before it occurs.
Thanks! But I'm unsure how ST_Snap could help in this case... If I got it right, you're suggesting something like(o.overlap_perimeter^2 / o.overlap_area) / (4 * Pi()) as overlap_ratio
? This is having worse results for me than just area / perimeter.
– bplmp
yesterday
Now usingo.overlap_perimeter / (4 * sqrt(o.overlap_area)) as overlap_ratio
according to this paper, but still worse results (although that's hard to quantify what I mean by worse) isprs-ann-photogramm-remote-sens-spatial-inf-sci.net/I-7/135/…, page 183.
– bplmp
yesterday
2
Thank you for this, I had never heard of the "shape index". I had always thought that using a minimum bounding rectangle was the best way to answer this sort of question. I found this, repository.asu.edu/attachments/111230/content/…, which is interesting.
– John Powell
yesterday
@JohnPowell intersting paper, thanks. I see that what I know as a shape index is called circularity index in the paper. My problem with minimum bounding rectangles is that it doesn't work with very concave objects (e.g. U-shaped)
– radouxju
18 hours ago
@bplmp ST_Snap would help you snap the vertices of "nearly" adjacent polygons so that they do no overlap anymore. There is no scale on your figures, but your artefact look like lines, so I guess that you can use a tolerance value theat is enough to avoid artefacts but does not affect the large polygons.
– radouxju
17 hours ago
|
show 2 more comments
Instead of area/perimeter, it is better to use the area divided by the square of the perimeter (or its inverse).
This is also called "shape index". The square of the perimeter divided by the area has a minimum value of 4*Pi() (in the case of a disk, which is the most compact 2D geometry), so it can be normalized by 4*Pi() for an easy interpretation (normalized values close to 1 then mean that you have very compact objects and squares have a values of approximately 1.27).
EDIT: A threshold on the area would be usefull to remove the very small artefacts, which could be compact. Then the shape index would show better contrast.
EDIT: in addition to this answer, the use of ST_Snap could help you solve the problem before it occurs.
Thanks! But I'm unsure how ST_Snap could help in this case... If I got it right, you're suggesting something like(o.overlap_perimeter^2 / o.overlap_area) / (4 * Pi()) as overlap_ratio
? This is having worse results for me than just area / perimeter.
– bplmp
yesterday
Now usingo.overlap_perimeter / (4 * sqrt(o.overlap_area)) as overlap_ratio
according to this paper, but still worse results (although that's hard to quantify what I mean by worse) isprs-ann-photogramm-remote-sens-spatial-inf-sci.net/I-7/135/…, page 183.
– bplmp
yesterday
2
Thank you for this, I had never heard of the "shape index". I had always thought that using a minimum bounding rectangle was the best way to answer this sort of question. I found this, repository.asu.edu/attachments/111230/content/…, which is interesting.
– John Powell
yesterday
@JohnPowell intersting paper, thanks. I see that what I know as a shape index is called circularity index in the paper. My problem with minimum bounding rectangles is that it doesn't work with very concave objects (e.g. U-shaped)
– radouxju
18 hours ago
@bplmp ST_Snap would help you snap the vertices of "nearly" adjacent polygons so that they do no overlap anymore. There is no scale on your figures, but your artefact look like lines, so I guess that you can use a tolerance value theat is enough to avoid artefacts but does not affect the large polygons.
– radouxju
17 hours ago
|
show 2 more comments
Instead of area/perimeter, it is better to use the area divided by the square of the perimeter (or its inverse).
This is also called "shape index". The square of the perimeter divided by the area has a minimum value of 4*Pi() (in the case of a disk, which is the most compact 2D geometry), so it can be normalized by 4*Pi() for an easy interpretation (normalized values close to 1 then mean that you have very compact objects and squares have a values of approximately 1.27).
EDIT: A threshold on the area would be usefull to remove the very small artefacts, which could be compact. Then the shape index would show better contrast.
EDIT: in addition to this answer, the use of ST_Snap could help you solve the problem before it occurs.
Instead of area/perimeter, it is better to use the area divided by the square of the perimeter (or its inverse).
This is also called "shape index". The square of the perimeter divided by the area has a minimum value of 4*Pi() (in the case of a disk, which is the most compact 2D geometry), so it can be normalized by 4*Pi() for an easy interpretation (normalized values close to 1 then mean that you have very compact objects and squares have a values of approximately 1.27).
EDIT: A threshold on the area would be usefull to remove the very small artefacts, which could be compact. Then the shape index would show better contrast.
EDIT: in addition to this answer, the use of ST_Snap could help you solve the problem before it occurs.
edited 14 hours ago
answered yesterday
radouxjuradouxju
41.1k144120
41.1k144120
Thanks! But I'm unsure how ST_Snap could help in this case... If I got it right, you're suggesting something like(o.overlap_perimeter^2 / o.overlap_area) / (4 * Pi()) as overlap_ratio
? This is having worse results for me than just area / perimeter.
– bplmp
yesterday
Now usingo.overlap_perimeter / (4 * sqrt(o.overlap_area)) as overlap_ratio
according to this paper, but still worse results (although that's hard to quantify what I mean by worse) isprs-ann-photogramm-remote-sens-spatial-inf-sci.net/I-7/135/…, page 183.
– bplmp
yesterday
2
Thank you for this, I had never heard of the "shape index". I had always thought that using a minimum bounding rectangle was the best way to answer this sort of question. I found this, repository.asu.edu/attachments/111230/content/…, which is interesting.
– John Powell
yesterday
@JohnPowell intersting paper, thanks. I see that what I know as a shape index is called circularity index in the paper. My problem with minimum bounding rectangles is that it doesn't work with very concave objects (e.g. U-shaped)
– radouxju
18 hours ago
@bplmp ST_Snap would help you snap the vertices of "nearly" adjacent polygons so that they do no overlap anymore. There is no scale on your figures, but your artefact look like lines, so I guess that you can use a tolerance value theat is enough to avoid artefacts but does not affect the large polygons.
– radouxju
17 hours ago
|
show 2 more comments
Thanks! But I'm unsure how ST_Snap could help in this case... If I got it right, you're suggesting something like(o.overlap_perimeter^2 / o.overlap_area) / (4 * Pi()) as overlap_ratio
? This is having worse results for me than just area / perimeter.
– bplmp
yesterday
Now usingo.overlap_perimeter / (4 * sqrt(o.overlap_area)) as overlap_ratio
according to this paper, but still worse results (although that's hard to quantify what I mean by worse) isprs-ann-photogramm-remote-sens-spatial-inf-sci.net/I-7/135/…, page 183.
– bplmp
yesterday
2
Thank you for this, I had never heard of the "shape index". I had always thought that using a minimum bounding rectangle was the best way to answer this sort of question. I found this, repository.asu.edu/attachments/111230/content/…, which is interesting.
– John Powell
yesterday
@JohnPowell intersting paper, thanks. I see that what I know as a shape index is called circularity index in the paper. My problem with minimum bounding rectangles is that it doesn't work with very concave objects (e.g. U-shaped)
– radouxju
18 hours ago
@bplmp ST_Snap would help you snap the vertices of "nearly" adjacent polygons so that they do no overlap anymore. There is no scale on your figures, but your artefact look like lines, so I guess that you can use a tolerance value theat is enough to avoid artefacts but does not affect the large polygons.
– radouxju
17 hours ago
Thanks! But I'm unsure how ST_Snap could help in this case... If I got it right, you're suggesting something like
(o.overlap_perimeter^2 / o.overlap_area) / (4 * Pi()) as overlap_ratio
? This is having worse results for me than just area / perimeter.– bplmp
yesterday
Thanks! But I'm unsure how ST_Snap could help in this case... If I got it right, you're suggesting something like
(o.overlap_perimeter^2 / o.overlap_area) / (4 * Pi()) as overlap_ratio
? This is having worse results for me than just area / perimeter.– bplmp
yesterday
Now using
o.overlap_perimeter / (4 * sqrt(o.overlap_area)) as overlap_ratio
according to this paper, but still worse results (although that's hard to quantify what I mean by worse) isprs-ann-photogramm-remote-sens-spatial-inf-sci.net/I-7/135/…, page 183.– bplmp
yesterday
Now using
o.overlap_perimeter / (4 * sqrt(o.overlap_area)) as overlap_ratio
according to this paper, but still worse results (although that's hard to quantify what I mean by worse) isprs-ann-photogramm-remote-sens-spatial-inf-sci.net/I-7/135/…, page 183.– bplmp
yesterday
2
2
Thank you for this, I had never heard of the "shape index". I had always thought that using a minimum bounding rectangle was the best way to answer this sort of question. I found this, repository.asu.edu/attachments/111230/content/…, which is interesting.
– John Powell
yesterday
Thank you for this, I had never heard of the "shape index". I had always thought that using a minimum bounding rectangle was the best way to answer this sort of question. I found this, repository.asu.edu/attachments/111230/content/…, which is interesting.
– John Powell
yesterday
@JohnPowell intersting paper, thanks. I see that what I know as a shape index is called circularity index in the paper. My problem with minimum bounding rectangles is that it doesn't work with very concave objects (e.g. U-shaped)
– radouxju
18 hours ago
@JohnPowell intersting paper, thanks. I see that what I know as a shape index is called circularity index in the paper. My problem with minimum bounding rectangles is that it doesn't work with very concave objects (e.g. U-shaped)
– radouxju
18 hours ago
@bplmp ST_Snap would help you snap the vertices of "nearly" adjacent polygons so that they do no overlap anymore. There is no scale on your figures, but your artefact look like lines, so I guess that you can use a tolerance value theat is enough to avoid artefacts but does not affect the large polygons.
– radouxju
17 hours ago
@bplmp ST_Snap would help you snap the vertices of "nearly" adjacent polygons so that they do no overlap anymore. There is no scale on your figures, but your artefact look like lines, so I guess that you can use a tolerance value theat is enough to avoid artefacts but does not affect the large polygons.
– radouxju
17 hours ago
|
show 2 more comments
One option would be to use the ratio of the area of the polygon to the longest line that can be drawn using its extremities. Identifying long narrow polygons.
select * from polygons where ST_Length(ST_LongestLine(geom, geom)) < ST_Area(geom) * 4
This works pretty well for sliver polygons. You can adjust what the ratio (what you multiply the area with) to suit your needs and projection.
add a comment |
One option would be to use the ratio of the area of the polygon to the longest line that can be drawn using its extremities. Identifying long narrow polygons.
select * from polygons where ST_Length(ST_LongestLine(geom, geom)) < ST_Area(geom) * 4
This works pretty well for sliver polygons. You can adjust what the ratio (what you multiply the area with) to suit your needs and projection.
add a comment |
One option would be to use the ratio of the area of the polygon to the longest line that can be drawn using its extremities. Identifying long narrow polygons.
select * from polygons where ST_Length(ST_LongestLine(geom, geom)) < ST_Area(geom) * 4
This works pretty well for sliver polygons. You can adjust what the ratio (what you multiply the area with) to suit your needs and projection.
One option would be to use the ratio of the area of the polygon to the longest line that can be drawn using its extremities. Identifying long narrow polygons.
select * from polygons where ST_Length(ST_LongestLine(geom, geom)) < ST_Area(geom) * 4
This works pretty well for sliver polygons. You can adjust what the ratio (what you multiply the area with) to suit your needs and projection.
answered yesterday
HeikkiVesantoHeikkiVesanto
8,9952145
8,9952145
add a comment |
add a comment |
It sounds like this might match your use case: Eliminate selected polygons
Combines selected polygons of the input layer with certain adjacent polygons by erasing their common boundary. The adjacent polygon can be either the one with the largest or smallest area or the one sharing the largest common boundary with the polygon to be eliminated.
Eliminate is normally used to get rid of sliver polygons, i.e. tiny polygons that are a result of polygon intersection processes where boundaries of the inputs are similar but not identical.
It sounds like you'd want to try the "Largest Common Boundary" option.
New contributor
I realize now you were asking for postgis solutions not qgis solutions. My apologies, I don't think postgis has an equivalent function but I'll leave this up for posterity.
– FGreg
yesterday
add a comment |
It sounds like this might match your use case: Eliminate selected polygons
Combines selected polygons of the input layer with certain adjacent polygons by erasing their common boundary. The adjacent polygon can be either the one with the largest or smallest area or the one sharing the largest common boundary with the polygon to be eliminated.
Eliminate is normally used to get rid of sliver polygons, i.e. tiny polygons that are a result of polygon intersection processes where boundaries of the inputs are similar but not identical.
It sounds like you'd want to try the "Largest Common Boundary" option.
New contributor
I realize now you were asking for postgis solutions not qgis solutions. My apologies, I don't think postgis has an equivalent function but I'll leave this up for posterity.
– FGreg
yesterday
add a comment |
It sounds like this might match your use case: Eliminate selected polygons
Combines selected polygons of the input layer with certain adjacent polygons by erasing their common boundary. The adjacent polygon can be either the one with the largest or smallest area or the one sharing the largest common boundary with the polygon to be eliminated.
Eliminate is normally used to get rid of sliver polygons, i.e. tiny polygons that are a result of polygon intersection processes where boundaries of the inputs are similar but not identical.
It sounds like you'd want to try the "Largest Common Boundary" option.
New contributor
It sounds like this might match your use case: Eliminate selected polygons
Combines selected polygons of the input layer with certain adjacent polygons by erasing their common boundary. The adjacent polygon can be either the one with the largest or smallest area or the one sharing the largest common boundary with the polygon to be eliminated.
Eliminate is normally used to get rid of sliver polygons, i.e. tiny polygons that are a result of polygon intersection processes where boundaries of the inputs are similar but not identical.
It sounds like you'd want to try the "Largest Common Boundary" option.
New contributor
New contributor
answered yesterday
FGregFGreg
1135
1135
New contributor
New contributor
I realize now you were asking for postgis solutions not qgis solutions. My apologies, I don't think postgis has an equivalent function but I'll leave this up for posterity.
– FGreg
yesterday
add a comment |
I realize now you were asking for postgis solutions not qgis solutions. My apologies, I don't think postgis has an equivalent function but I'll leave this up for posterity.
– FGreg
yesterday
I realize now you were asking for postgis solutions not qgis solutions. My apologies, I don't think postgis has an equivalent function but I'll leave this up for posterity.
– FGreg
yesterday
I realize now you were asking for postgis solutions not qgis solutions. My apologies, I don't think postgis has an equivalent function but I'll leave this up for posterity.
– FGreg
yesterday
add a comment |
Thanks for contributing an answer to Geographic Information Systems Stack Exchange!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fgis.stackexchange.com%2fquestions%2f316128%2fidentifying-long-and-narrow-polygons-in-with-postgis%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
4
Certainly the area/perimeter ratio could be used for this.
– Vince
yesterday
It's hard to tell where the distinct polygons are from the image, but doing something like this gis.stackexchange.com/a/265233/64838 might work? Calculate minimum rotated bounding box then discard ones with small width or height.
– FGreg
yesterday
You could also try using a negative buffer as described here: How can I identify really thin polygons in my shape file?
– FGreg
yesterday