コード例 #1
0
ファイル: gis.py プロジェクト: craws/OpenAtlas
 def insert_import(entity: Entity, location: Entity, project: Project,
                   easting: float, northing: float) -> None:
     Db.insert_import({
         'entity_id':
         location.id,
         'description':
         f"Imported centerpoint of {sanitize(entity.name, 'text')} "
         f"from the {sanitize(project.name, 'text')} project",
         'geojson':
         f'{{"type":"Point", "coordinates": [{easting},{northing}]}}'
     })
コード例 #2
0
 def insert_import(entity: Entity,
                   location: Entity,
                   project: Project,
                   easting: float,
                   northing: float) -> None:
     Db.insert_import({
         'entity_id': location.id,
         'description': 'Imported centerpoint of {name} from the {project} project'.format(
             name=sanitize(entity.name, 'text'),
             project=sanitize(project.name, 'text')),
         'geojson': '''{{"type":"Point", "coordinates": [{easting},{northing}]}}'''.format(
             easting=easting, northing=northing)})