Empty value egon fix
* adds support for missing values so that EGON can properly handle these entries
This commit is contained in:
		
							parent
							
								
									5e48202226
								
							
						
					
					
						commit
						acb022ea13
					
				@ -178,6 +178,23 @@ class EgonGmlBuilder:
 | 
			
		||||
        reg_date = self.intervention.legal.registration_date
 | 
			
		||||
        bind_date = self.intervention.legal.binding_date
 | 
			
		||||
 | 
			
		||||
        # EGON needs special treatment in case of missing data
 | 
			
		||||
        if reg_office is None:
 | 
			
		||||
            reg_office_element = {}
 | 
			
		||||
        else:
 | 
			
		||||
            reg_office_element = {
 | 
			
		||||
                "@xlink:href": f"http://register.naturschutz.rlp.de/repository/services/referenzliste/1053/{reg_office.atom_id}",
 | 
			
		||||
                "#text": reg_office.long_name
 | 
			
		||||
            }
 | 
			
		||||
 | 
			
		||||
        if cons_office is None:
 | 
			
		||||
            cons_office_element = {}
 | 
			
		||||
        else:
 | 
			
		||||
            cons_office_element = {
 | 
			
		||||
                "@xlink:href": f"http://register.naturschutz.rlp.de/repository/services/referenzliste/907/{cons_office.atom_id}",
 | 
			
		||||
                "#text": cons_office.long_name
 | 
			
		||||
            }
 | 
			
		||||
 | 
			
		||||
        xml_dict = {
 | 
			
		||||
            "wfs:FeatureCollection": {
 | 
			
		||||
                "@xmlns:wfs": "http://www.opengis.net/wfs",
 | 
			
		||||
@ -191,14 +208,8 @@ class EgonGmlBuilder:
 | 
			
		||||
                    "oneo:azEintragungsstelle": self.intervention.responsible.conservation_file_number,
 | 
			
		||||
                    "oneo:azZulassungsstelle": self.intervention.responsible.registration_file_number,
 | 
			
		||||
                    "oneo:bemerkungZulassungsstelle": "",
 | 
			
		||||
                    "oneo:eintragungsstelle": {
 | 
			
		||||
                        "@xlink:href": f"http://register.naturschutz.rlp.de/repository/services/referenzliste/907/{cons_office.atom_id if cons_office else ''}",
 | 
			
		||||
                        "#text": cons_office.long_name if cons_office else ""
 | 
			
		||||
                    },
 | 
			
		||||
                    "oneo:zulassungsstelle": {
 | 
			
		||||
                        "@xlink:href": f"http://register.naturschutz.rlp.de/repository/services/referenzliste/1053/{reg_office.atom_id if reg_office else ''}",
 | 
			
		||||
                        "#text": reg_office.long_name if reg_office else ""
 | 
			
		||||
                    },
 | 
			
		||||
                    "oneo:eintragungsstelle": cons_office_element,
 | 
			
		||||
                    "oneo:zulassungsstelle": reg_office_element,
 | 
			
		||||
                    "oneo:ersatzzahlung": self._float_to_localized_string(self._sum_all_payments()),
 | 
			
		||||
                    "oneo:kompensationsart": {
 | 
			
		||||
                        "@xlink:href": f"http://register.naturschutz.rlp.de/repository/services/referenzliste/88140/{comp_type_code}",
 | 
			
		||||
 | 
			
		||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user