def process_row(self, r): row = cleanup_row(r, replace=True) pk = row[0] status = row[14] if status not in self.status_choices: log.warn( "Meetbout {} references non-existing status {}; skipping".format( pk, status)) return bouwblok = row[15] return models.Meetbout( pk=pk, buurt=row[1], x_coordinaat=parse_decimal(row[2]), y_coordinaat=parse_decimal(row[3]), hoogte_nap=parse_decimal(row[4]), zakking_cumulatief=parse_decimal(row[5]), datum=uva_datum(row[6]), bouwblokzijde=row[7], eigenaar=row[8], beveiligd=uva_indicatie(row[9]), stadsdeel=row[10], adres=row[11], locatie=row[12], zakkingssnelheid=parse_decimal(row[13]), status=status, bouwbloknummer=bouwblok, rollaag_id=self.rollagen.get(bouwblok), blokeenheid=row[16] or 0, geometrie=GEOSGeometry(row[17]), )
def process_row(self, r): row = cleanup_row(r, replace=True) pk = row[0] meting_type = row[2] if meting_type not in self.type_choices: log.warn( "Meting {} references non-existing type {}; skipping".format(pk, meting_type)) return meetbout_id = row[5] if meetbout_id not in self.meetbouten: log.warn( "Meting {} references non-existing meetbout {}; skipping".format( pk, meetbout_id)) return meting = models.Meting.objects.create( pk=pk, datum=uva_datum(row[1]), type=meting_type, hoogte_nap=parse_decimal(row[3]), zakking=parse_decimal(row[4]), meetbout_id=meetbout_id, zakkingssnelheid=parse_decimal(row[9]), zakking_cumulatief=parse_decimal(row[10]), ploeg=row[11], type_int=int(row[12]) if row[12] else None, dagen_vorige_meting=int(row[13]) if row[13] else None, pandmsl=row[14], stadsdeel=row[15], wvi=row[16], ) for i in range(6, 9): self.create_relation(meting, row[i]) return meting
def process_row(self, r): row = cleanup_row(r, replace=True) pk = row[1] bouwblok = row[0] return models.Rollaag( pk=pk, bouwblok=bouwblok, x_coordinaat=parse_decimal(row[2]), y_coordinaat=parse_decimal(row[3]), geometrie=GEOSGeometry(row[4]), )
def process_row(self, r): row = cleanup_row(r, replace=True) pk = row[0] return models.Referentiepunt( pk=pk, x_coordinaat=parse_decimal(row[1]), y_coordinaat=parse_decimal(row[2]), hoogte_nap=parse_decimal(row[3]), datum=uva_datum(row[4]), locatie=row[5], geometrie=GEOSGeometry(row[6]), )
def process_row(self, r): row = cleanup_row(r, replace=True) pk = row[0] merk = int(row[3]) if merk not in self.merk_choices: log.warn( "Peilmerk {} references non-existing merk {}; skipping".format( pk, merk)) return # PEILMERKNR,HOOGTE,JAAR,MERK,OMSCHRIJVING,WINDRICHTING,X_MUURVLAK,Y_MUURVLAK,RWSNR,GEOMETRIE return Peilmerk( pk=pk, hoogte=parse_decimal(row[1]), jaar=int(row[2]), merk=int(row[3]), omschrijving=row[4], windrichting=row[5], muurvlak_x=int(row[6] or 0), muurvlak_y=int(row[7] or 0), rws_nummer=row[8], geometrie=GEOSGeometry(row[9]), )