dbMongo.py
def insertPolygonDB(self,polygonGeoJson):
        """This method allows to add polygon"""
        count = self.db.PolygonCollection.find({"$and":[{"geometry.coordinates":polygonGeoJson["geometry"]["coordinates"]},{"properties.dateStr":polygonGeoJson["properties"]["dateStr"]}]}).count()
        print("equal polygons ",count)
        if count == 0:
            id = self.db.PolygonCollection.insert(polygonGeoJson)
            result = True
            return result,id
        else:
            result= False
            id = None
            return result,id
This method allows to add polygon
This method allows to add polygon
This method allows to add polygon
def insertPolygonDB(self,polygonGeoJson):
        count = self.db.PolygonCollection.find({"$and":[{"geometry.coordinates":polygonGeoJson["geometry"]["coordinates"]},{"properties.dateStr":polygonGeoJson["properties"]["dateStr"]}]}).count()
        print("equal polygons ",count)
        if count == 0:
            id = self.db.PolygonCollection.insert(polygonGeoJson)
            result = True
            return result,id
        else:
            result= False
            id = None
            return result,id
def insertPolygonDB ( self , polygonGeoJson ) : count = self . db . PolygonCollection . find ( { "$and" : [ { "geometry.coordinates" : polygonGeoJson [ "geometry" ] [ "coordinates" ] } , { "properties.dateStr" : polygonGeoJson [ "properties" ] [ "dateStr" ] } ] } ) . count ( ) print ( "equal polygons " , count ) if count == 0 : id = self . db . PolygonCollection . insert ( polygonGeoJson ) result = True return result , id else : result = False id = None return result , id
This method allows to add polygon
This method allows to add polygon
"""This method allows to add polygon"""
self
polygonGeoJson