Returns the geoJSON compliant representation of this location

        :returns: a ``pyowm.utils.geo.Point`` instance
183578
def to_geopoint(self):
        
        if self._lon is None or self._lat is None:
            return None
        return geo.Point(self._lon, self._lat)
1366520
def _geom_points(geom):
    
    if geom['type'] == 'Point':
        yield tuple(geom['coordinates'])
    elif geom['type'] in ('MultiPoint', 'LineString'):
        for position in geom['coordinates']:
            yield tuple(position)
    else:
        raise InvalidFeatureError(
            "Unsupported geometry type:{0}".format(geom['type']))
1064688
def filter(self):
        

        val = {"geometryType":self.geometryType,
                "geometry": json.dumps(self._geomObject.asDictionary),
                "spatialRel": self.spatialRelation,
                "inSR" : self._geomObject.spatialReference['wkid']}
        if self._buffer is not None and \
           self._units is not None:
            val['buffer'] = self._buffer
            val['units'] = self._units
        return val
1061770
def geo_search(self, **kwargs):
        

        if 'types' in kwargs:
            kwargs['types'] = ','.join(kwargs['types'])

        bound = kwargs.pop('bound', False)
        if bound:
            kwargs['bound[point1]'] = bound[0]
            kwargs['bound[point2]'] = bound[1]

        return self._geo_search(**kwargs)
1162514
def geo(self):
        
        if isinstance(self.media, (types.MessageMediaGeo,
                                   types.MessageMediaGeoLive,
                                   types.MessageMediaVenue)):
            return self.media.geo
967903
def to_point_cloud(self):
        
        return PointCloud(
            data=self._data.reshape(
                self.height *
                self.width,
                3).T,
            frame=self._frame)
1105634
def from_point(cls, point):
        
        return cls(point.latitude, point.longitude, point.altitude)
1350275
def as_dict(self):
        
        d = {}
        _add_value(d, 'obstory_ids', self.obstory_ids)
        _add_value(d, 'lat_min', self.lat_min)
        _add_value(d, 'lat_max', self.lat_max)
        _add_value(d, 'long_min', self.long_min)
        _add_value(d, 'long_max', self.long_max)
        _add_value(d, 'time_min', self.time_min)
        _add_value(d, 'time_max', self.time_max)
        _add_value(d, 'mime_type', self.mime_type)
        _add_value(d, 'skip', self.skip)
        _add_value(d, 'limit', self.limit)
        _add_string(d, 'semantic_type', self.semantic_type)
        _add_string(d, 'observation_type', self.observation_type)
        _add_value(d, 'observation_id', self.observation_id)
        _add_string(d, 'repository_fname', self.repository_fname)
        _add_boolean(d, 'exclude_imported', self.exclude_imported)
        _add_string(d, 'exclude_export_to', self.exclude_export_to)
        d['meta'] = list((x.as_dict() for x in self.meta_constraints))
        return d
1179284
def as_dict(self):
        
        return {"@module": self.__class__.__module__,
                "@class": self.__class__.__name__,
                "coord_geoms": jsanitize(self.coord_geoms)}
877623
def geo(self):
        
        out = dict(zip(['xmin', 'xres', 'rotation_x', 'ymax', 'rotation_y', 'yres'],
                       self.raster.GetGeoTransform()))
        
        # note: yres is negative!
        out['xmax'] = out['xmin'] + out['xres'] * self.cols
        out['ymin'] = out['ymax'] + out['yres'] * self.rows
        return out
552961
def geojson(self):
        """"""
        return {
            "type": "FeatureCollection",
            "features": [f.geojson(i) for i, f in self._features.items()]
        }
697495
def probably_geojson(input):
    ''''''
    valid = False
    if not isinstance(input, dict):
        try:
            input = json.loads(input)
        except ValueError:
            return None
    typename = input.get('type', None)
    supported_types = set([
        'Point', 'LineString', 'Polygon', 'MultiPoint', 'MultiLineString',
        'MultiPolygon', 'GeometryCollection', 'Feature', 'FeatureCollection'
    ])
    valid = typename in supported_types
    return input if valid else None
260119
def get(self, point, buffer_size=0, multiple=False):
        
        lon, lat = point
        geohash = Geohash.encode(lat, lon, precision=self.precision)
        key = (geohash, buffer_size, multiple)
        if key in self.geohash_cache:
            # cache hit on geohash
            self.hit += 1
            #print self.hit, self.miss
            return self.geohash_cache[key]
        self.miss += 1
        # cache miss on geohash
        # project point to ESRI:102005
        lat, lon = Geohash.decode(geohash)
        proj_point = project([float(lon), float(lat)])
        args = dict(buffer_size=buffer_size, multiple=multiple)
        payload = self.get_object(proj_point, **args)
        self.geohash_cache[key] = payload
        return payload
1092386
def coords(self):
        
        x, y = ("lat", "lng") if self.order == "lat" else ("lng", "lat")
        try:
            return (self["location"][x], self["location"][y])

        except KeyError:
            return None
831208
def geometry_point(lat, lon, elev):
    
    logger_excel.info("enter geometry_point")
    coordinates = []
    point_dict = OrderedDict()
    for idx, val in enumerate(lat):
        try:
            coordinates.append(lon[idx])
            coordinates.append(lat[idx])
        except IndexError as e:
            print("Error: Invalid geo coordinates")
            logger_excel.debug("geometry_point: IndexError: lat: {}, lon: {}, {}".format(lat, lon, e))

    coordinates.append(elev)
    point_dict['type'] = 'Point'
    point_dict['coordinates'] = coordinates
    logger_excel.info("exit geometry_point")
    return point_dict
452303
def _build_from_geojson(self, src):
        
        geojson = json.loads(self.read(src))
        idx = index.Index()
        data_store = {}
        for i, feature in enumerate(geojson['features']):
            feature = self._build_obj(feature)
            idx.insert(i, feature['geometry'].bounds)
            data_store[i] = feature
        return data_store, idx
830676
def to_json(self):
        
        points = [point.to_json() for point in self.points]
        return {
            'points': points,
            'transportationModes': self.transportation_modes,
            'locationFrom': self.location_from.to_json() if self.location_from != None else None,
            'locationTo': self.location_to.to_json() if self.location_to != None else None
        }