빅데이터

해도 데이터의 postgres변환

도그사운드 2023. 9. 27. 16:31

해도는 형식상 000 확장자를 갖고 있다.

필요한 레이어를 shp로 전환하여 postgres에 올리는 방법이 있다.

그 외에 ogr2ogr로 직접 postgres로 전환할 수도 있다.

이 경우 선박들의 위치와 등대, 부표 등과의 거리를 postgis로 연산할 수 있다.

 

예) ogr2ogr -f "PostgreSQL" PG: "host=10.29.16.77 port=5432 dbname=s57 user=postgres password=test1234" KR67989C.000 -skipfailures -nln s57 -geomfield geom

 

작업 중에 일부 오류가 발생한다. 인코딩과 관련된 문제인 듯 한데 해결하지 못했다.

 

ogr2ogr 명령문 사례

 

https://www.bostongis.com/PrinterFriendly.aspx?content_name=ogr_cheatsheet