comparison pkg/imports/fm.go @ 5712:6270951dda28 revive-cleanup

/interface{}/any/
author Sascha L. Teichmann <sascha.teichmann@intevation.de>
date Tue, 20 Feb 2024 22:37:51 +0100
parents 1222b777f51f
children
comparison
equal deleted inserted replaced
5711:2dd155cc95ec 5712:6270951dda28
233 createInsertFMSQL("bcnlat_hydro", 233 createInsertFMSQL("bcnlat_hydro",
234 "colour", "colpat", "condtn", "bcnshp", "catlam"), 234 "colour", "colpat", "condtn", "bcnshp", "catlam"),
235 ), 235 ),
236 consume, 236 consume,
237 createInvalidation("bcnlat_hydro"), 237 createInvalidation("bcnlat_hydro"),
238 newPointFeature(func() interface{} { return new(bcnlatHydroProperties) }), 238 newPointFeature(func() any { return new(bcnlatHydroProperties) }),
239 ), 239 ),
240 }) 240 })
241 241
242 RegisterJobCreator(BCNLATIENCJobKind, 242 RegisterJobCreator(BCNLATIENCJobKind,
243 &WFSFeatureJobCreator{ 243 &WFSFeatureJobCreator{
249 "colour", "colpat", "condtn", "bcnshp", "catlam"), 249 "colour", "colpat", "condtn", "bcnshp", "catlam"),
250 insertBcnlatDirimpSQL, 250 insertBcnlatDirimpSQL,
251 ), 251 ),
252 consume, 252 consume,
253 createInvalidation("bcnlat_ienc"), 253 createInvalidation("bcnlat_ienc"),
254 newPointFeature(func() interface{} { return new(bcnlatIencProperties) }), 254 newPointFeature(func() any { return new(bcnlatIencProperties) }),
255 ), 255 ),
256 }) 256 })
257 257
258 RegisterJobCreator(BOYLATHYDROJobKind, 258 RegisterJobCreator(BOYLATHYDROJobKind,
259 &WFSFeatureJobCreator{ 259 &WFSFeatureJobCreator{
265 "colour", "colpat", "conrad", 265 "colour", "colpat", "conrad",
266 "marsys", "boyshp", "catlam"), 266 "marsys", "boyshp", "catlam"),
267 ), 267 ),
268 consume, 268 consume,
269 createInvalidation("boylat_hydro"), 269 createInvalidation("boylat_hydro"),
270 newPointFeature(func() interface{} { return new(boylatHydroProperties) }), 270 newPointFeature(func() any { return new(boylatHydroProperties) }),
271 ), 271 ),
272 }) 272 })
273 273
274 RegisterJobCreator(BOYLATIENCJobKind, 274 RegisterJobCreator(BOYLATIENCJobKind,
275 &WFSFeatureJobCreator{ 275 &WFSFeatureJobCreator{
281 "colour", "colpat", "conrad", 281 "colour", "colpat", "conrad",
282 "marsys", "boyshp", "catlam"), 282 "marsys", "boyshp", "catlam"),
283 ), 283 ),
284 consume, 284 consume,
285 createInvalidation("boylat_ienc"), 285 createInvalidation("boylat_ienc"),
286 newPointFeature(func() interface{} { return new(boylatIencProperties) }), 286 newPointFeature(func() any { return new(boylatIencProperties) }),
287 ), 287 ),
288 }) 288 })
289 289
290 RegisterJobCreator(BOYCARJobKind, 290 RegisterJobCreator(BOYCARJobKind,
291 &WFSFeatureJobCreator{ 291 &WFSFeatureJobCreator{
297 "colour", "colpat", "conrad", 297 "colour", "colpat", "conrad",
298 "marsys", "boyshp", "catcam"), 298 "marsys", "boyshp", "catcam"),
299 ), 299 ),
300 consume, 300 consume,
301 createInvalidation("boycar"), 301 createInvalidation("boycar"),
302 newPointFeature(func() interface{} { return new(boycarProperties) }), 302 newPointFeature(func() any { return new(boycarProperties) }),
303 ), 303 ),
304 }) 304 })
305 305
306 RegisterJobCreator(BOYSAWJobKind, 306 RegisterJobCreator(BOYSAWJobKind,
307 &WFSFeatureJobCreator{ 307 &WFSFeatureJobCreator{
312 createInsertFMSQL("boysaw", 312 createInsertFMSQL("boysaw",
313 "colour", "colpat", "conrad", "marsys", "boyshp"), 313 "colour", "colpat", "conrad", "marsys", "boyshp"),
314 ), 314 ),
315 consume, 315 consume,
316 createInvalidation("boysaw"), 316 createInvalidation("boysaw"),
317 newPointFeature(func() interface{} { return new(boysawProperties) }), 317 newPointFeature(func() any { return new(boysawProperties) }),
318 ), 318 ),
319 }) 319 })
320 320
321 RegisterJobCreator(BOYSPPJobKind, 321 RegisterJobCreator(BOYSPPJobKind,
322 &WFSFeatureJobCreator{ 322 &WFSFeatureJobCreator{
328 "colour", "colpat", "conrad", 328 "colour", "colpat", "conrad",
329 "marsys", "boyshp", "catspm"), 329 "marsys", "boyshp", "catspm"),
330 ), 330 ),
331 consume, 331 consume,
332 createInvalidation("boyspp"), 332 createInvalidation("boyspp"),
333 newPointFeature(func() interface{} { return new(boysppProperties) }), 333 newPointFeature(func() any { return new(boysppProperties) }),
334 ), 334 ),
335 }) 335 })
336 336
337 RegisterJobCreator(DAYMARHYDROJobKind, 337 RegisterJobCreator(DAYMARHYDROJobKind,
338 &WFSFeatureJobCreator{ 338 &WFSFeatureJobCreator{
343 createInsertFMSQL("daymar_hydro", 343 createInsertFMSQL("daymar_hydro",
344 "colour", "colpat", "condtn", "topshp"), 344 "colour", "colpat", "condtn", "topshp"),
345 ), 345 ),
346 consume, 346 consume,
347 createInvalidation("daymar_hydro"), 347 createInvalidation("daymar_hydro"),
348 newPointFeature(func() interface{} { return new(daymarHydroProperties) }), 348 newPointFeature(func() any { return new(daymarHydroProperties) }),
349 ), 349 ),
350 }) 350 })
351 351
352 RegisterJobCreator(DAYMARIENCJobKind, 352 RegisterJobCreator(DAYMARIENCJobKind,
353 &WFSFeatureJobCreator{ 353 &WFSFeatureJobCreator{
359 "colour", "colpat", "condtn", "topshp", "orient"), 359 "colour", "colpat", "condtn", "topshp", "orient"),
360 insertDaymarDirimpSQL, 360 insertDaymarDirimpSQL,
361 ), 361 ),
362 consume, 362 consume,
363 createInvalidation("daymar_ienc"), 363 createInvalidation("daymar_ienc"),
364 newPointFeature(func() interface{} { return new(daymarIencProperties) }), 364 newPointFeature(func() any { return new(daymarIencProperties) }),
365 ), 365 ),
366 }) 366 })
367 367
368 RegisterJobCreator(LIGHTSJobKind, 368 RegisterJobCreator(LIGHTSJobKind,
369 &WFSFeatureJobCreator{ 369 &WFSFeatureJobCreator{
378 "sectr2", "siggrp", "sigper", 378 "sectr2", "siggrp", "sigper",
379 "sigseq", "status"), 379 "sigseq", "status"),
380 ), 380 ),
381 consume, 381 consume,
382 createInvalidation("lights"), 382 createInvalidation("lights"),
383 newPointFeature(func() interface{} { return new(lightsProperties) }), 383 newPointFeature(func() any { return new(lightsProperties) }),
384 ), 384 ),
385 }) 385 })
386 386
387 RegisterJobCreator(NOTMRKJobKind, 387 RegisterJobCreator(NOTMRKJobKind,
388 &WFSFeatureJobCreator{ 388 &WFSFeatureJobCreator{
397 "disbk2", "fnctnm", "bnkwtw"), 397 "disbk2", "fnctnm", "bnkwtw"),
398 insertNotmrkDirimpSQL, 398 insertNotmrkDirimpSQL,
399 ), 399 ),
400 consume, 400 consume,
401 createInvalidation("notmrk"), 401 createInvalidation("notmrk"),
402 newPointFeature(func() interface{} { return new(notmrkProperties) }), 402 newPointFeature(func() any { return new(notmrkProperties) }),
403 ), 403 ),
404 }) 404 })
405 405
406 RegisterJobCreator(RTPBCNJobKind, 406 RegisterJobCreator(RTPBCNJobKind,
407 &WFSFeatureJobCreator{ 407 &WFSFeatureJobCreator{
412 createInsertFMSQL("rtpbcn", 412 createInsertFMSQL("rtpbcn",
413 "condtn", "siggrp", "catrtb", "radwal"), 413 "condtn", "siggrp", "catrtb", "radwal"),
414 ), 414 ),
415 consume, 415 consume,
416 createInvalidation("rtpbcn"), 416 createInvalidation("rtpbcn"),
417 newPointFeature(func() interface{} { return new(rtpbcnProperties) }), 417 newPointFeature(func() any { return new(rtpbcnProperties) }),
418 ), 418 ),
419 }) 419 })
420 420
421 RegisterJobCreator(TOPMARJobKind, 421 RegisterJobCreator(TOPMARJobKind,
422 &WFSFeatureJobCreator{ 422 &WFSFeatureJobCreator{
427 createInsertFMSQL("topmar", 427 createInsertFMSQL("topmar",
428 "colour", "colpat", "condtn", "topshp"), 428 "colour", "colpat", "condtn", "topshp"),
429 ), 429 ),
430 consume, 430 consume,
431 createInvalidation("topmar"), 431 createInvalidation("topmar"),
432 newPointFeature(func() interface{} { return new(topmarProperties) }), 432 newPointFeature(func() any { return new(topmarProperties) }),
433 ), 433 ),
434 }) 434 })
435 } 435 }
436 436
437 const ( 437 const (
581 } 581 }
582 } 582 }
583 583
584 func consume( 584 func consume(
585 spc *SQLGeometryConsumer, 585 spc *SQLGeometryConsumer,
586 geom, properties interface{}, 586 geom, properties any,
587 epsg int, 587 epsg int,
588 ) error { 588 ) error {
589 var fmid int64 589 var fmid int64
590 err := spc.savepoint(func() error { 590 err := spc.savepoint(func() error {
591 return spc.stmts[0].QueryRowContext( 591 return spc.stmts[0].QueryRowContext(
592 spc.ctx, 592 spc.ctx,
593 append( 593 append(
594 []interface{}{ 594 []any{
595 geom.(interface{ asWKB() []byte }).asWKB(), 595 geom.(interface{ asWKB() []byte }).asWKB(),
596 epsg, 596 epsg,
597 }, 597 },
598 structs.Values(properties)...)..., 598 structs.Values(properties)...)...,
599 ).Scan(&fmid) 599 ).Scan(&fmid)