PostGIS - unique constraint for spatial equalityInserting Geometry into PostGIS Table Violates Check...
Book about a time-travel war fought by computers
What does each site of a vanilla 9.1 installation do?
Can a space-faring robot still function over a billion years?
How to merge row in the first column in LaTeX
Can I solder 12/2 Romex to extend wire 5 ft?
Is there a way to find out the age of climbing ropes?
“I had a flat in the centre of town, but I didn’t like living there, so …”
Practical reasons to have both a large police force and bounty hunting network?
Are small insurances worth it
When do _WA_Sys_ statistics Get Updated?
Why is it "take a leak?"
Can a Trickery Domain cleric cast a spell through the Invoke Duplicity clone while inside a Forcecage?
Where is the fallacy here?
PTIJ: What’s wrong with eating meat and couscous?
I encountered my boss during an on-site interview at another company. Should I bring it up when seeing him next time?
How to fix my table, centering of columns
Deal the cards to the players
Inconsistent behaviour between dict.values() and dict.keys() equality in Python 3.x and Python 2.7
What is the minimum amount of skill points per HD?
Draw bounding region by list of points
Is every open circuit a capacitor?
Misplaced tyre lever - alternatives?
How does insurance birth control work?
Do AL rules let me pick different starting equipment?
PostGIS - unique constraint for spatial equality
Inserting Geometry into PostGIS Table Violates Check Constraint “enforce_geotype_geom”violates check constraintHow to compute equality of polygons in PostGIS independently of their orientation?Appending to a cartodb table - duplicate key value violates unique key constraintQGIS - Split a line having attributes with UNIQUE constraintPostGIS treating unique geometries as equalOracle spatial to PostgisEnforce PostGIS constraint that geometries do not overlapUnique constraint on geometry column in PostgreSQL/PostGISSpatial query using PostGIS
I have a polygon column for which I would like to add a unique constraint that tests for spatial equality akin to ST_Equals
so that it ignores vertex order. For instance, I would like these polygons to count as duplicates:
ST_GeomFromText('POLYGONZ((0 0 1, 1 0 1, 1 1 1, 0 1 1, 0 0 1))')
ST_GeomFromText('POLYGONZ((1 0 1, 1 1 1, 0 1 1, 0 0 1, 1 0 1))')
Is there a standard way to implement this other than a GIST index, which the docs say only indexes the bounding box?
One solution I'm thinking of is to index on a function that returns a sorted array of polygon vertices, but it seems like a hack.
postgis polygon
add a comment |
I have a polygon column for which I would like to add a unique constraint that tests for spatial equality akin to ST_Equals
so that it ignores vertex order. For instance, I would like these polygons to count as duplicates:
ST_GeomFromText('POLYGONZ((0 0 1, 1 0 1, 1 1 1, 0 1 1, 0 0 1))')
ST_GeomFromText('POLYGONZ((1 0 1, 1 1 1, 0 1 1, 0 0 1, 1 0 1))')
Is there a standard way to implement this other than a GIST index, which the docs say only indexes the bounding box?
One solution I'm thinking of is to index on a function that returns a sorted array of polygon vertices, but it seems like a hack.
postgis polygon
add a comment |
I have a polygon column for which I would like to add a unique constraint that tests for spatial equality akin to ST_Equals
so that it ignores vertex order. For instance, I would like these polygons to count as duplicates:
ST_GeomFromText('POLYGONZ((0 0 1, 1 0 1, 1 1 1, 0 1 1, 0 0 1))')
ST_GeomFromText('POLYGONZ((1 0 1, 1 1 1, 0 1 1, 0 0 1, 1 0 1))')
Is there a standard way to implement this other than a GIST index, which the docs say only indexes the bounding box?
One solution I'm thinking of is to index on a function that returns a sorted array of polygon vertices, but it seems like a hack.
postgis polygon
I have a polygon column for which I would like to add a unique constraint that tests for spatial equality akin to ST_Equals
so that it ignores vertex order. For instance, I would like these polygons to count as duplicates:
ST_GeomFromText('POLYGONZ((0 0 1, 1 0 1, 1 1 1, 0 1 1, 0 0 1))')
ST_GeomFromText('POLYGONZ((1 0 1, 1 1 1, 0 1 1, 0 0 1, 1 0 1))')
Is there a standard way to implement this other than a GIST index, which the docs say only indexes the bounding box?
One solution I'm thinking of is to index on a function that returns a sorted array of polygon vertices, but it seems like a hack.
postgis polygon
postgis polygon
asked 16 mins ago
user3747260user3747260
915
915
add a comment |
add a comment |
0
active
oldest
votes
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%2f314662%2fpostgis-unique-constraint-for-spatial-equality%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
0
active
oldest
votes
0
active
oldest
votes
active
oldest
votes
active
oldest
votes
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%2f314662%2fpostgis-unique-constraint-for-spatial-equality%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