Extracting the first polygon from the MultiPolygon (using ST_GeometryN) allows the result to run. Since most polygon tables in carto store the geoms as multipolygon, we should have a function that accepts multipolygons as well as polygons. At the very least, there should be a check on input geom types to give back a less cryptic error.
This table has state boundaries: maxp_usjoin.csv
Running
CDB_PIA
on that table gives back the following error:Query is: http://eschbacher.cartodb.com/api/v2/sql?q=SELECT%20cdb_crankshaft.CDB_PIA(the_geom)%20FROM%20eschbacher.maxp_usjoin
Extracting the first polygon from the MultiPolygon (using
ST_GeometryN
) allows the result to run. Since most polygon tables in carto store the geoms as multipolygon, we should have a function that accepts multipolygons as well as polygons. At the very least, there should be a check on input geom types to give back a less cryptic error.