HOTFIX
* fixes bug where rectangular geometry results in an error during geometry complexity calculation
This commit is contained in:
		
							parent
							
								
									be5b8457a6
								
							
						
					
					
						commit
						e2eb0ecbb0
					
				@ -364,7 +364,13 @@ class Geometry(BaseResource):
 | 
			
		||||
 | 
			
		||||
        geom_envelope = self.geom.envelope
 | 
			
		||||
        diff = geom_envelope - self.geom
 | 
			
		||||
        complexity_factor = 1 - self.geom.area / diff.area
 | 
			
		||||
 | 
			
		||||
        if diff.area == 0:
 | 
			
		||||
            ratio = 1
 | 
			
		||||
        else:
 | 
			
		||||
            ratio = self.geom.area / diff.area
 | 
			
		||||
 | 
			
		||||
        complexity_factor = 1 - ratio
 | 
			
		||||
        return complexity_factor
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user