Problem: To deliver GeoJSONs as promptly as possible, with a field_id
as the filename, created in folders grouped by farmer_id
. The folders should be named after the farmer_id
, and the contents of the GeoJSONs should be the geometry.
Leveraging AI, we devised a solution involving the export of an SQL statement as a CSV. ChatGPT then served to build a Python script, which in turn created the requisite folder structure.
Prompt:
1I have a CSV file with the following structure:
2field_id, farmer_id, geometry
3bec33b29-1a69-4800-9d2c-ae11ff6a3888,b7bc9888-5e8a-42ae-805f-209f233bf992,"{""type"":""Polygon"",""coordinates"":[[[...
followed by:
1Write a script that creates GeoJSONs
2with the job_id as file names
3grouped by farmer_id into folders
4named after the farmer_id.
5The content of the GeoJSONs
6should be the geometry.
As per instruction, the content of the GeoJSONs contained the following geometry data.