ImFe's study

[GIS] GeoJSON object too complex/large. You may define the OGR_GEOJSON_MAX_OBJ_SIZE configuration option to a value in megabytes to allow for larger features, or 0 to remove any size limit. 오류 본문

카테고리 없음

[GIS] GeoJSON object too complex/large. You may define the OGR_GEOJSON_MAX_OBJ_SIZE configuration option to a value in megabytes to allow for larger features, or 0 to remove any size limit. 오류

ImFe 2024. 3. 28. 17:49

 

산림청 프로젝트 진행중에

Open API 결과값을 파싱하여 생성한 지도 데이터를 ogr2ogr을 이용하여 Postgresql(PostGIS)에 업로드 하던 중 오류 발생

 

 

에러 내용이 이해가 좀 안갔던 점은

용량만 보면 훨씬 큰 "리" 단위 지도(256MB)도 잘 말려서 올라가는데, 1/4 수준인 시군구 단위 지도를 올릴 때 발생한다는 것
용량 뿐만 아니라 geojson 내부 객체 depth도 중요한 부분이여서 발생했던 것 같다.

 

 

다행히도 아래 stackexchange question에서 해결 방법을 찾아서 해결하였다.

export OGR_GEOJSON_MAX_OBJ_SIZE=500MB # 시군구 올릴 때 발생하는 오류 해결

https://gis.stackexchange.com/questions/300419/ogr2ogr-import-fails-with-error-1-geojson-object-too-complex

 

ogr2ogr import fails with "ERROR 1: GeoJSON object too complex"

I'm trying to import a large (8.8GB) GeoJSON file to a Postgres 9.6 database with the following command: ogr2ogr -f "PostgreSQL" -nln final_diffs PG:"host=localhost dbname=inspire user=me" diffs.g...

gis.stackexchange.com

 

 

 

추가)

37GB 분량의 연속지적도를 Postgresql(PostGIS)에 업로드 할 땐 이러한 문제가 발생하지 않았다.
파싱 후 결과물의 json depth가 너무 깊어서 이러한 오류가 발생한 것 같다.

Comments