# Media files publication (ocli.aikp.document.media) ## Typical workflow ### 1. task create -t ocli.aikp.document.media --roi roi_id -n task_name --activate Creating a new task and activate it. Parameters: --roi, --name, --activate ``` task create -t ocli.aikp.document.media --roi roi_id -n task_name --activate ``` ### 2. task set file_path= Set the path and name of the source image or document file. The knowledge pack tries to recognize file type by its extension and automatically set **file_kind** and **output_file_name** task configuration parameters. Mandatory parameter: **file_path** `task set file_path=` ### 3. task set lat=value ### 4. task set lon=value Parameter: value Steps 3 and 4 can be skipped if the source image file contains geospatial info. If the image doesn't contain geospatial info, specify these parameters manually. The knowledge pack tries to get coordinates from an image file at first, then from task configuration. You can set latitude and longitude values in traditional DMS format (degrees, minutes, and seconds) or in WGS84 (decimal degrees) format, depending on your choice. Examples for different media types are shown in table below: | in WGS84 format | in DMS format | |:-----------------------------------------------------------|:------------------------------------------------------------| | task set lat=44.129382843 | task set lat="50°27’0.36N" | | task set lon=11.2300003843 | task set lon="30°31’24.24E" | ### 5. task make recipe Make a recipe. ``` task make recipe --override ``` ### 6. ai makegeojson Make a GeoJSON file for output image or document. ``` ai makegeojson ``` ``` ai makegeojson --cos-key="+_suffix" --friendly-name="+Suffix for name" ``` ### 7. ai upload Uploads an image or document to the S3 cloud. Connection configuration is taken from the recipe. ``` ai upload ``` ### 8. ai publish post Posts a generated GeoJSON document to the PostGis database. ``` ai publish post ```