Package com.yahoo.geo

Class BoundingBoxParser


  • public class BoundingBoxParser
    extends java.lang.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 Summary

      Fields 
      Modifier and Type Field Description
      double e  
      double n  
      double s  
      double w  
    • Constructor Summary

      Constructors 
      Constructor Description
      BoundingBoxParser​(java.lang.String bb)
      parse the given string as a bounding box and return a parser object with parsed coordinates in member variables
    • Method Summary

      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • n

        public double n
      • s

        public double s
      • e

        public double e
      • w

        public double w
    • Constructor Detail

      • BoundingBoxParser

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