comparison pkg/pgxutils/errors.go @ 5095:e21cbb9768a2

Prevent duplicate fairway areas In principal, there can be only one or no fairway area at each point on the map. Since polygons from real data will often be topologically inexact, just disallow equal geometries. This will also help to avoid importing duplicates with concurrent imports, once the history of fairway dimensions will be preserved.
author Tom Gottfried <tom@intevation.de>
date Wed, 25 Mar 2020 18:10:02 +0100
parents 8c590ef35280
children 73563c4bba5b
comparison
equal deleted inserted replaced
5094:f59ba73ff692 5095:e21cbb9768a2
130 case "sections_name_staging_done_key": 130 case "sections_name_staging_done_key":
131 m = "A section with that name already exists" 131 m = "A section with that name already exists"
132 c = http.StatusConflict 132 c = http.StatusConflict
133 return 133 return
134 } 134 }
135 case "fairway_dimensions":
136 switch err.ConstraintName {
137 case "fairway_dimensions_area_unique":
138 m = "Duplicate fairway area"
139 c = http.StatusConflict
140 return
141 }
135 } 142 }
136 } 143 }
137 case exclusionViolation: 144 case exclusionViolation:
138 switch err.SchemaName { 145 switch err.SchemaName {
139 case "waterway": 146 case "waterway":