{"html_url": "https://github.com/simonw/datasette/issues/411#issuecomment-1779267468", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/411", "id": 1779267468, "node_id": "IC_kwDOBm6k_c5qDXeM", "user": {"value": 363004, "label": "hcarter333"}, "created_at": "2023-10-25T13:23:04Z", "updated_at": "2023-10-25T13:23:04Z", "author_association": "NONE", "body": "Using the [Counties example](https://us-counties.datasette.io/counties/county_for_latitude_longitude?longitude=-122&latitude=37), I was able to pull out the MakePoint method as \r\n\r\nMakePoint(cast(rm_rnb_history_pres.rx_lng as float), cast(rm_rnb_history_pres.rx_lat as float)) as geometry\r\n\r\nwhich worked, giving me a geometry column.\r\n\r\n![image](https://github.com/simonw/datasette/assets/363004/6393b712-9e3d-416d-ba37-202934d5f604)\r\n\r\n\r\ngave\r\n\r\n![image](https://github.com/simonw/datasette/assets/363004/219db7b2-8107-41b3-a049-ef4d6bd7ac7a)\r\n\r\nI believe it's the cast to float that does the trick. Prior to using the cast, I also received a 'wrong number of arguments' eror.\r\n", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 410384988, "label": "How to pass named parameter into spatialite MakePoint() function"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/datasette/issues/411#issuecomment-519065799", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/411", "id": 519065799, "node_id": "MDEyOklzc3VlQ29tbWVudDUxOTA2NTc5OQ==", "user": {"value": 1055831, "label": "dazzag24"}, "created_at": "2019-08-07T12:00:36Z", "updated_at": "2019-08-07T12:00:36Z", "author_association": "NONE", "body": "Hi,\r\nApologies for the long delay.\r\n\r\nI tried your suggesting escaping approach:\r\n`SELECT a.pos AS rank, b.id, b.name, b.country, b.latitude AS latitude, b.longitude AS longitude, a.distance / 1000.0 AS dist_km FROM KNN AS a LEFT JOIN airports AS b ON (b.rowid = a.fid)WHERE f_table_name = 'airports' AND ref_geometry = MakePoint(:Long || \", \" || :Lat) AND max_items = 6;\r\n`\r\nand it returns this error:\r\n`wrong number of arguments to function MakePoint()`\r\n\r\nAnything else you suggest I try?\r\nThanks", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 410384988, "label": "How to pass named parameter into spatialite MakePoint() function"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/datasette/issues/411#issuecomment-473156905", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/411", "id": 473156905, "node_id": "MDEyOklzc3VlQ29tbWVudDQ3MzE1NjkwNQ==", "user": {"value": 9599, "label": "simonw"}, "created_at": "2019-03-15T04:42:58Z", "updated_at": "2019-03-15T04:42:58Z", "author_association": "OWNER", "body": "Have you tried this?\r\n\r\n MakePoint(:Long || \", \" || :Lat)\r\n", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 410384988, "label": "How to pass named parameter into spatialite MakePoint() function"}, "performed_via_github_app": null}