I am downloading and importing all countries geometries from OpenStreetMap, processing the files with osmtogeojson and importing into PostgreSQL with ogr2ogr. However, Taiwan is retrieved with a very long row, and I cannot import it into the database.
What can I do?
These are the steps to reproduce the issue.
cat << EOF > query
ut:json];
rel(449220);
(._;>;);
out;
EOF
wget -O 449220.json --post-file=query "https://overpass-api.de/api/interpreter"
osmtogeojson 449220.json > 449220.geojson
ogr2ogr -f "PostgreSQL" PG:"dbname=postgres user=myuser" "449220.geojson" -nln import -overwrite
And I got this:
Resolving overpass-api.de (overpass-api.de)... 178.63.48.217, 178.63.11.215, 2a01:4f8:120:6464::2, ...
Connecting to overpass-api.de (overpass-api.de)|178.63.48.217|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: unspecified [application/json]
Saving to: ‘449220.json’
449220.json [ <=> ] 111.00K 187KB/s in 0.6s
2022-11-05 00:19:49 (187 KB/s) - ‘449220.json’ saved [113669]
ERROR 1: COPY statement failed.
ERROR: row is too big: size 8616, maximum size 8160
CONTEXT: COPY import, line 16
What can I do? Is there a way to modify the row size limit in PostgreSQL? Create another tablespace? Or can I do something at the OSM side to split the row? Is there any way to simplify the geometry?