Package com.yahoo.geo

Class BoundingBoxParser


  • public class BoundingBoxParser
    extends Object
    Class for parsing a bounding box in text format: "n=37.44899,s=37.3323,e=-121.98241,w=-122.06566"
     Input from:
     http://gws.maps.yahoo.com/findlocation?q=sunnyvale,ca&flags=X
     which gives this format:
     <boundingbox>
     <north>37.44899</north><south>37.3323</south><east>-121.98241</east><west>-122.06566</west>
     </boundingbox>
     it's also easy to use the geoplanet bounding box
     <boundingBox>  
     <southWest>  
     <latitude>40.183868</latitude>  
     <longitude>-74.819519</longitude>  
     </southWest>  
     <northEast>  
     <latitude>40.248291</latitude>  
     <longitude>-74.728798</longitude>  
     </northEast>  
     </boundingBox>  
     can be input as:
     s=40.183868,w=-74.819519,n=40.248291,e=-74.728798
     
    Author:
    arnej27959
    • Field Detail

      • n

        public double n
      • s

        public double s
      • e

        public double e
      • w

        public double w
    • Constructor Detail

      • BoundingBoxParser

        public BoundingBoxParser​(String bb)
        parse the given string as a bounding box and return a parser object with parsed coordinates in member variables
        Throws:
        IllegalArgumentException - if the input is malformed in any way