Mercurial > gemma
comparison pkg/imports/wa.go @ 2661:542d3441c2d8
Bring context.Context parameters to front.
author | Sascha L. Teichmann <sascha.teichmann@intevation.de> |
---|---|
date | Thu, 14 Mar 2019 18:31:59 +0100 |
parents | 00b0a7b2225a |
children | 2b6f73c30016 |
comparison
equal
deleted
inserted
replaced
2660:2b4b9fa9812c | 2661:542d3441c2d8 |
---|---|
229 case "Polygon": | 229 case "Polygon": |
230 var p polygonSlice | 230 var p polygonSlice |
231 if err := json.Unmarshal(*feature.Geometry.Coordinates, &p); err != nil { | 231 if err := json.Unmarshal(*feature.Geometry.Coordinates, &p); err != nil { |
232 return err | 232 return err |
233 } | 233 } |
234 if err := Savepoint(tx, ctx, featureSavepoint); err != nil { | 234 if err := Savepoint(ctx, tx, featureSavepoint); err != nil { |
235 return err | 235 return err |
236 } | 236 } |
237 if _, err := insertStmt.ExecContext( | 237 if _, err := insertStmt.ExecContext( |
238 ctx, | 238 ctx, |
239 p.asWKB(), | 239 p.asWKB(), |
240 epsg, | 240 epsg, |
241 catccl, | 241 catccl, |
242 dirimp, | 242 dirimp, |
243 ); err != nil { | 243 ); err != nil { |
244 feedback.Warn(handleError(err).Error()) | 244 feedback.Warn(handleError(err).Error()) |
245 if err = RollbackToSavepoint(tx, ctx, featureSavepoint); err != nil { | 245 if err = RollbackToSavepoint(ctx, tx, featureSavepoint); err != nil { |
246 return err | 246 return err |
247 } | 247 } |
248 } else { | 248 } else { |
249 if err = ReleaseSavepoint(tx, ctx, featureSavepoint); err != nil { | 249 if err = ReleaseSavepoint(ctx, tx, featureSavepoint); err != nil { |
250 return err | 250 return err |
251 } | 251 } |
252 features++ | 252 features++ |
253 } | 253 } |
254 default: | 254 default: |