<commit_before>package tilestore.database

import geoscript.geom.Geometry
import geoscript.geom.io.WktReader
import geoscript.proj.Projection
import grails.validation.Validateable
import groovy.transform.ToString
import org.ossim.common.CaseInsensitiveBind

/**
 * Created by gpotts on 6/17/15.
 */
@Validateable
@ToString( includeNames = true )
class GetActualBoundsCommand implements CaseInsensitiveBind
{
   String layer
   String aoi
   String aoiEpsg
   Long minLevel
   Long maxLevel


   Geometry aoiAsGeometry()
   {
      Geometry result

      try{
         if(aoi)
         {
            result = new WktReader().read(aoi)
         }
      }
      catch(e)
      {
         result = null
      }

      result
   }
   Geometry aoiAsGeometry(String targetEpsg)
   {
      Geometry result = aoiAsGeometry()

      Projection proj = aoiEpsgAsProjection()
      Projection targetProj = new Projection(targetEpsg)

      if(proj&&(proj.epsg!= targetProj.epsg))
      {
         proj.transform(result,targetProj)
      }

      result
   }
   Projection aoiEpsgAsProjection()
   {
      Projection result

      if(aoiEpsg)
      {
         result = new Projection(aoiEpsg)
      }

      result
   }

}<commit_msg>Added assignement to result for the reprojected polygon<commit_after>package tilestore.database

import geoscript.geom.Geometry
import geoscript.geom.io.WktReader
import geoscript.proj.Projection
import grails.validation.Validateable
import groovy.transform.ToString
import org.ossim.common.CaseInsensitiveBind

/**
 * Created by gpotts on 6/17/15.
 */
@Validateable
@ToString( includeNames = true )
class GetActualBoundsCommand implements CaseInsensitiveBind
{
   String layer
   String aoi
   String aoiEpsg
   Long minLevel
   Long maxLevel


   Geometry aoiAsGeometry()
   {
      Geometry result

      try{
         if(aoi)
         {
            result = new WktReader().read(aoi)
         }
      }
      catch(e)
      {
         result = null
      }

      result
   }
   Geometry aoiAsGeometry(String targetEpsg)
   {
      Geometry result = aoiAsGeometry()

      Projection proj = aoiEpsgAsProjection()
      Projection targetProj = new Projection(targetEpsg)

      if(proj&&(proj.epsg!= targetProj.epsg))
      {
         result = proj.transform(result,targetProj)
      }

      result
   }
   Projection aoiEpsgAsProjection()
   {
      Projection result

      if(aoiEpsg)
      {
         result = new Projection(aoiEpsg)
      }

      result
   }

}
{'fraction_non_alphanumeric': 0.07667603372139703, 'fraction_numerical': 0.004014452027298274, 'mean_word_length': 2.385869565217391, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6277363', 'n_tokens_mistral': 830, 'n_tokens_neox': 787, 'n_words': 160}