NunyaBidness on Nostr: ChatGPT-4 works for getting data out of GIS using SQL. I'm not surprised but being ...
ChatGPT-4 works for getting data out of GIS using SQL.
I'm not surprised but being able to query the databases leveraged by arcGIS, ERDAS etc. in natural language seems . . . useful.
Me: Please write a query for arcGIS that locates all single-family dwellings no more than 1/2 mile from a US Interstate and within 5 miles of a hospital
ChatGPT-4: Certainly! Here's a query for ArcGIS that locates all single-family dwellings within a 1/2 mile radius from a US Interstate and within a 5-mile radius of a hospital:
SELECT single_family_dwellings.*
FROM single_family_dwellings, interstate_roads, hospitals
WHERE ST_Distance(single_family_dwellings.geometry, interstate_roads.geometry) <= 0.5 AND ST_Distance(single_family_dwellings.geometry, hospitals.geometry) <= 5;
In this query, you'll need to replace single_family_dwellings with the name of your single-family dwellings dataset or table, interstate_roads with the name of your US Interstate roads dataset or table, and hospitals with the name of your hospitals dataset or table.
The ST_Distance function is used to calculate the distance between the geometries of the single-family dwellings, interstate roads, and hospitals. The query checks if the distance between the single-family dwelling and the interstate road is less than or equal to 0.5 (indicating it is within a 1/2 mile radius) and if the distance between the single-family dwelling and the hospital is less than or equal to 5 (within a 5-mile radius).
Make sure you have the necessary spatial extensions and spatial data loaded into your ArcGIS environment to execute this query successfully.
Published at
2023-06-03 05:42:08Event JSON
{
"id": "7ae405b0d9ad3f239f408dcb1ed5712d2db6a834bc5757e7fae4b3cb2a140b67",
"pubkey": "6389be6491e7b693e9f368ece88fcd145f07c068d2c1bbae4247b9b5ef439d32",
"created_at": 1685770928,
"kind": 1,
"tags": [],
"content": "ChatGPT-4 works for getting data out of GIS using SQL. \n\nI'm not surprised but being able to query the databases leveraged by arcGIS, ERDAS etc. in natural language seems . . . useful.\n\nMe: Please write a query for arcGIS that locates all single-family dwellings no more than 1/2 mile from a US Interstate and within 5 miles of a hospital\n\nChatGPT-4: Certainly! Here's a query for ArcGIS that locates all single-family dwellings within a 1/2 mile radius from a US Interstate and within a 5-mile radius of a hospital:\n\n\nSELECT single_family_dwellings.*\nFROM single_family_dwellings, interstate_roads, hospitals\nWHERE ST_Distance(single_family_dwellings.geometry, interstate_roads.geometry) \u003c= 0.5 AND ST_Distance(single_family_dwellings.geometry, hospitals.geometry) \u003c= 5;\n\nIn this query, you'll need to replace single_family_dwellings with the name of your single-family dwellings dataset or table, interstate_roads with the name of your US Interstate roads dataset or table, and hospitals with the name of your hospitals dataset or table.\n\nThe ST_Distance function is used to calculate the distance between the geometries of the single-family dwellings, interstate roads, and hospitals. The query checks if the distance between the single-family dwelling and the interstate road is less than or equal to 0.5 (indicating it is within a 1/2 mile radius) and if the distance between the single-family dwelling and the hospital is less than or equal to 5 (within a 5-mile radius).\n\nMake sure you have the necessary spatial extensions and spatial data loaded into your ArcGIS environment to execute this query successfully.\n",
"sig": "3f91a11380c8cc1ef32a9507bb45614badba82d534fc5cce73259ed201fe9309dcd64532331d74ee567852965c60497d887c3f84a2f4cfa55eadbf4c03fe7e45"
}