Пример #1
0
class Locality(Entity):
    nombre = NameField
    centroide = CentroidField
    geometria = GeoShape()
    provincia = StateSimpleField
    departamento = DepartmentSimpleField
    municipio = MunicipalitySimpleField
    categoria = UnindexedTextField
    fuente = UnindexedTextField
Пример #2
0
class Settlement(Entity):
    nombre = NameField
    centroide = CentroidField
    geometria = GeoShape()
    provincia = StateSubField
    departamento = DepartmentSubField
    municipio = MunicipalitySubField
    localidad_censal = CensusLocalitySubField
    categoria = UnindexedTextField
    fuente = UnindexedTextField
Пример #3
0
class Municipality(Entity):
    nombre = NameField
    nombre_completo = UnindexedTextField
    centroide = CentroidField
    geometria = GeoShape()
    provincia = StateSimpleField
    categoria = UnindexedTextField
    fuente = UnindexedTextField

    class Meta:
        source = MetaField(excludes=['geometria'])
Пример #4
0
class Department(Entity):
    nombre = NameField
    nombre_completo = Text(index=False)
    centroide = CentroidField
    geometria = GeoShape()
    provincia = StateSimpleField
    categoria = UnindexedTextField
    fuente = UnindexedTextField

    class Meta:
        source = MetaField(excludes=['geometria'])
Пример #5
0
class Street(Entity):
    nombre = NameField
    altura = StreetNumbersField
    geometria = GeoShape()
    provincia = StateSubField
    departamento = DepartmentSubField
    localidad_censal = CensusLocalitySubField
    # Indexar las categorías de calles ya que se puede filtrar por las mismas
    categoria = Text(analyzer=name_analyzer_synonyms,
                     search_analyzer=name_analyzer)
    fuente = UnindexedTextField
Пример #6
0
class WetlandIndex(DocType):
    title = Text()
    category = Text(fields={'raw': Keyword()})
    keywords = Text(fielddata=True, fields={'raw': Keyword()})
    wetland = Text(fielddata=True, fields={'raw': Keyword()})
    country = Keyword()
    partner = Text(fielddata=True, fields={'raw': Keyword()})
    ecoregion = Text(fielddata=True, fields={'raw': Keyword()})
    geom = GeoShape()

    class Meta:
        index = 'wetland_index'
Пример #7
0
class State(Entity):
    nombre = NameField
    nombre_completo = UnindexedTextField
    iso_id = UnindexedTextField
    iso_nombre = UnindexedTextField
    centroide = CentroidField
    geometria = GeoShape()
    categoria = UnindexedTextField
    fuente = UnindexedTextField

    class Meta:
        source = MetaField(excludes=['geometria'])
Пример #8
0
class Street(Entity):
    nombre = NameField
    nomenclatura = Text(index=False)
    altura = StreetNumbersField
    geometria = GeoShape()
    provincia = StateSimpleField
    departamento = DepartmentSimpleField
    # Indexar las categorías de calles ya que se puede filtrar por las mismas
    categoria = Text(
        analyzer=name_analyzer_synonyms,
        search_analyzer=name_analyzer
    )
    fuente = UnindexedTextField
Пример #9
0
class LayerIndex(DocType):
    title = Text()
    category = Text(fields={'raw': Keyword()})
    topiccat = Keyword()
    description = Text()
    keywords = Text(fielddata=True, fields={'raw': Keyword()})
    wetland = Text(fielddata=True, fields={'raw': Keyword()})
    product_name = Text(fielddata=True, fields={'raw': Keyword()})
    indicator_name = Text(fielddata=True, fields={'raw': Keyword()})
    contact_person = Text(fielddata=True, fields={'raw': Keyword()})
    contact_org = Text(fielddata=True, fields={'raw': Keyword()})
    date_begin = Date()
    date_end = Date()
    lineage = Text()
    geom = GeoShape()

    class Meta:
        index = 'layer_index'
Пример #10
0
class MunicipalityGeom(Entity):
    geometria = GeoShape()
Пример #11
0
class DepartmentGeom(Entity):
    geometria = GeoShape()
Пример #12
0
class StateGeom(Entity):
    geometria = GeoShape()
Пример #13
0
class StreetBlock(Entity):
    calle = StreetSubField
    altura = StreetNumbersField
    geometria = GeoShape()
Пример #14
0
            # small.append(str(lat)+", "+str(long))
            small.append(lat)
            small.append(long)

            # print(str(lat) +", "+str(long))
            # print (item['geometry']['rings'])
            large.append(small)
        print("====================")
        print(large)

        type = "Fuel Strage"
        if item['attributes']['NAME'] is None:
            description = type
        else:
            description = item['attributes']['NAME']
        score = 0.72

        v = {"type": "multipoint", "coordinates": large}
        gs = GeoShape(type="multipoint", coordinates=large)
        shpe = Area("multipoint", large)
        # long, lat = toLatLong(pylonas['geometry']['x'], pylonas['geometry']['y'], inverse=True)
        #
        poi = ProlepsysPOI(
            typos=type,
            description=description,
            score=score,
            # location=str(lat) + ", " + str(long),
            shape=v
            # shape = '{ "type": "multipoint", "coordinates": ' + shape + '}'
        )
        poi.save()
class ReviewDoc(DocType):
    summary = Text()
    username = Object(properties={'username':Keyword()})    
    location = Nested(properties={'polygon':GeoShape()})    
    class Meta:
        index = 'review-index'
Пример #16
0
class Intersection(Entity):
    calle_a = StreetSimpleField
    calle_b = StreetSimpleField
    geometria = GeoShape()
Пример #17
0
 class Meta:
     using = es_connection
     dynamic_templates = MetaField([
         # Can't get this to work
         # https://stackoverflow.com/questions/49740033/elasticsearch-6-copy-to-with-dynamic-index-mappings
         # {
         #     "strings":
         #         {
         #             "match_mapping_type": "string",
         #             "mapping": {
         #                 "type": "text",
         #                 "copy_all": "anytext"
         #             }
         #         }
         # },
         {
             "metadata_json":
                 {
                     "path_match": "metadata_json.identifier.identifier",
                     "match_mapping_type": "string",
                     "mapping": Keyword("not_analyzed")
                 }
         },
         {
             "metadata_json":
                 {
                     "path_match": "metadata_json.titles.title",
                     "match_mapping_type": "string",
                     "mapping": Text(fields={'raw': Keyword()}),
                 }
         },
         {
             "metadata_json":
                 {
                     "path_match": "metadata_json.subjects.subject",
                     "match_mapping_type": "string",
                     "mapping": Text(fields={'raw': Keyword()}),
                 }
         },
         {
             "metadata_json":
                 {
                     "path_match": "metadata_json.creators.creatorName",
                     "match_mapping_type": "string",
                     "mapping": Text(fields={'raw': Keyword()}),
                 }
         },
         {
             "metadata_json":
                 {
                     "path_match": "metadata_json.publicationYear",
                     "match_mapping_type": "string",
                     "mapping": Integer()
                 }
         },
         {
             "metadata_json":
                 {
                     "path_match": "metadata_json.publisher",
                     "match_mapping_type": "string",
                     "mapping": Text(fields={'raw': Keyword()}),
                 }
         },
         {
             "metadata_json":
                 {
                     "path_match": "metadata_json.dates.date",
                     "match_mapping_type": "string",
                     "mapping": DateRange()
                 }
         },
         {
             "metadata_json":
                 {
                     "path_match": "metadata_json.geoLocations.geoLocationBox",
                     "match_mapping_type": "string",
                     "mapping": GeoShape()
                 }
         },
         {
             "metadata_json":
                 {
                     "path_match": "metadata_json.geoLocations.geoLocationPoint",
                     "match_mapping_type": "string",
                     "mapping": GeoPoint()
                 }
         }
     ])