Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def _reprojector(self, in_crs):
'''Return a reprojection transform from in_crs to self.out_crs.'''
if self.out_crs != in_crs:
self.log.info('set up reprojection')
self.log.debug('input crs: %s', projection.fake_to_string(in_crs))
return partial(fiona.transform.transform_geom, in_crs, self.out_crs)
return None
def set_out_crs(self, bounds):
'''Set the output CRS, if not yet set.'''
if self.out_crs:
return
# Determine projection transformation:
# either use something passed in, a non latlong layer projection,
# the local UTM, or customize local TM
self.log.debug('Picking a projection:')
self.log.debug(' out crs: %s', self._out_crs)
self.log.debug(' in crs: %s', projection.fake_to_string(self.in_crs))
self.log.debug(' bounds: %s', bounds)
self._out_crs = projection.pick(self._out_crs, bounds, self.in_crs)
self.log.debug('Set output crs to %s', projection.fake_to_string(self.out_crs))
def set_out_crs(self, bounds):
'''Set the output CRS, if not yet set.'''
if self.out_crs:
return
# Determine projection transformation:
# either use something passed in, a non latlong layer projection,
# the local UTM, or customize local TM
self.log.debug('Picking a projection:')
self.log.debug(' out crs: %s', self._out_crs)
self.log.debug(' in crs: %s', projection.fake_to_string(self.in_crs))
self.log.debug(' bounds: %s', bounds)
self._out_crs = projection.pick(self._out_crs, bounds, self.in_crs)
self.log.debug('Set output crs to %s', projection.fake_to_string(self.out_crs))