Ejemplo n.º 1
0
 def get_feature(self, simplegeohandle, zoom=None):
     """Return the GeoJSON representation of a feature. Zoom needs to be
     between 1-20, or None for the full polygon."""
     if not is_simplegeohandle(simplegeohandle):
         raise TypeError("simplegeohandle is required to match the regex %s, but it was %s :: %r" % (SIMPLEGEOHANDLE_RSTR, type(simplegeohandle), simplegeohandle))
     kwargs = {}
     if zoom:
         precondition(zoom >= 1 and zoom <= 20, zoom)
         kwargs['zoom'] = zoom
     endpoint = self._endpoint('feature', simplegeohandle=simplegeohandle)
     return Feature.from_json(self._request(endpoint, 'GET', data=kwargs)[1])
Ejemplo n.º 2
0
 def get_feature(self, simplegeohandle, zoom=None):
     """Return the GeoJSON representation of a feature. Zoom needs to be
     between 1-20, or None for the full polygon."""
     if not is_simplegeohandle(simplegeohandle):
         raise TypeError(
             "simplegeohandle is required to match the regex %s, but it was %s :: %r"
             % (SIMPLEGEOHANDLE_RSTR, type(simplegeohandle), simplegeohandle)
         )
     kwargs = {}
     if zoom:
         if zoom < 1 or zoom > 20:
             raise AssertionError("Zoom must be in the range 1..20")
         kwargs["zoom"] = zoom
     endpoint = self._endpoint("feature", simplegeohandle=simplegeohandle)
     return Feature.from_json(self._request(endpoint, "GET", data=kwargs)[1])
Ejemplo n.º 3
0
 def get_feature(self, simplegeohandle, zoom=None):
     """Return the GeoJSON representation of a feature. Zoom needs to be
     between 1-20, or None for the full polygon."""
     if not is_simplegeohandle(simplegeohandle):
         raise TypeError(
             "simplegeohandle is required to match the regex %s, but it was %s :: %r"
             %
             (SIMPLEGEOHANDLE_RSTR, type(simplegeohandle), simplegeohandle))
     kwargs = {}
     if zoom:
         precondition(zoom >= 1 and zoom <= 20, zoom)
         kwargs['zoom'] = zoom
     endpoint = self._endpoint('feature', simplegeohandle=simplegeohandle)
     return Feature.from_json(
         self._request(endpoint, 'GET', data=kwargs)[1])