ν‹°μŠ€ν† λ¦¬ λ·°

λ‹€μŒμ˜ κ²½μš°λŠ” 5179μ’Œν‘œκ³„λ₯Ό μ‚¬μš©ν•˜λŠ” geojson을 읽어듀여 μ’Œν‘œκ³„ λ³€ν™˜μ„ ν•˜λŠ” κ²½μš°μ΄λ‹€.

  var vectorSource = new ol.source.Vector({
    format: new ol.format.GeoJSON(),
    loader: function (extent) {
      const url = "./geojson/seoulHD.geojson";//5179
      fetch(url)
        .then((response) => response.json())
        .then((data) => {
          const features = vectorSource.getFormat().readFeatures(data);
          console.log("λ³€ν™˜μ „ - ",features[0].getGeometry().getCoordinates()[0][0][0]);
          features.forEach((feature) => feature.getGeometry().transform('EPSG:5179', 'EPSG:3857'));
          console.log("λ³€ν™˜ν›„ - ",features[0].getGeometry().getCoordinates()[0][0][0]);
          vectorSource.addFeatures(features)
        });
    },
  });

μ½”λ“œλ₯Ό μˆ˜ν–‰ν•˜λ©΄ λ‹€μŒκ³Ό 같은 였λ₯˜κ°€ λ°œμƒν•œλ‹€ .

κ·Έ μ΄μœ λŠ” λ‹€λ₯Έ μ’Œν‘œκ³„κ°„μ— λ³€ν™˜μ΄ μ΄λ£¨μ–΄μ§ˆλ•Œ λ°œμƒν•˜λŠ” 였λ₯˜μΈλ°,  'EPSG:5179'  μ’Œν‘œκ³„λ₯Ό μ˜€ν”ˆλ ˆμ΄μ–΄μŠ€μ—κ²Œ μΈμ‹μ‹œμΌœμ£Όμ§€ μ•Šμ•˜κΈ° λ•Œλ¬Έμ΄λ‹€. μ˜€ν”ˆλ ˆμ΄μ–΄μŠ€λŠ” 기본적으둜 EPSG:3857을 μΈμ‹ν•˜κ³  μžˆμ–΄ 이외 μ’Œν‘œκ³„λ₯Ό 등둝해주어야 ν•œλ‹€.

 

μ˜€ν”ˆλ ˆμ΄μ–΄μŠ€ κ³΅μ‹λ¬Έμ„œμ—μ„œλ„ 라이브러리λ₯Ό 톡해 μ’Œν‘œκ³„λ₯Ό μƒμ„±ν•˜λΌκ³  μ•ˆλ‚΄ν•˜κ³  μžˆμŠ΅λ‹ˆλ‹€.

By default OpenLayers does not know about the EPSG:21781 (Swiss) projection. So we create a projection instance for EPSG:21781 and pass it to register to make it available to the library for lookup by its code.

 

 

이λ₯Ό ν•΄κ²°ν•˜κΈ° μœ„ν•΄μ„œλŠ” proj4 라이브러리λ₯Ό μ‚¬μš©ν•΄ μ’Œν‘œκ³„κ°„μ— λ³€ν™˜μ„ ν•  수 있게 ν•΄μ£Όμ–΄μ•Όν•œλ‹€.

1. proj4.js κ°€μ Έμ˜€κΈ°

<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/proj4js/2.5.0/proj4.js"></script>

 

2. μ’Œν‘œκ³„ 등둝

- μ›ν•˜λŠ” μ’Œν‘œκ³„μ˜ 인자λ₯Ό λ‹€μŒκ³Ό 같이 μ •μ˜ν•˜κ³ , 등둝해주면 λœλ‹€.

- μ’Œν‘œκ³„ 인자 ν™•μΈν•˜κΈ°

더보기

[전지ꡬ μ’Œν‘œκ³„]

전세계λ₯Ό ν•œλ²ˆμ— λ‚˜νƒ€λ‚΄μ•Ό ν•  λ•Œ 많이 μ“°μ΄λŠ” μ’Œν‘œκ³„λ“€μž…λ‹ˆλ‹€.

*WGS84 κ²½μœ„λ„: GPSκ°€ μ‚¬μš©ν•˜λŠ” μ’Œν‘œκ³„

EPSG:4326, EPSG:4166 (Korean 1995)

+proj=longlat +ellps=WGS84 +datum=WGS84 +no_defs 

 

*Bessel 1841 κ²½μœ„λ„: ν•œκ΅­κ³Ό 일본에 잘 λ§žλŠ” 지역타원체λ₯Ό μ‚¬μš©ν•œ μ’Œν‘œκ³„

EPSG:4004, EPSG:4162 (Korean 1985)

+proj=longlat +ellps=bessel +no_defs +towgs84=-115.80,474.99,674.11,1.16,-2.31,-1.63,6.43

 

*GRS80 κ²½μœ„λ„: WGS84와 거의 μœ μ‚¬

EPSG:4019, EPSG:4737 (Korean 2000)

+proj=longlat +ellps=GRS80 +no_defs

 

*Google Mercator: κ΅¬κΈ€μ§€λ„/빙지도/야후지도/OSM λ“± μ—μ„œ μ‚¬μš©μ€‘μΈ μ’Œν‘œκ³„

EPSG:3857(곡식), EPSG:900913(톡칭)

+proj=merc +a=6378137 +b=6378137 +lat_ts=0.0 +lon_0=0.0 +x_0=0.0 +y_0=0 +k=1.0 +units=m +nadgrids=@null +no_defs

 

[UTM]

전세계λ₯Ό 6도 λ‹¨μœ„λ‘œ λ‚˜λˆ„λŠ” ν‘œμ€€μ μΈ TM으둜 κ΅°μ‚¬μ§€λ„μ—μ„œ 많이 μ‚¬μš©ν•©λ‹ˆλ‹€.

*UTM52N (WGS84): 경도 120~126도 μ‚¬μ΄μ—μ„œ μ‚¬μš©

EPSG:32652

+proj=utm +zone=52 +ellps=WGS84 +datum=WGS84 +units=m +no_defs 

 

*UTM51N (WGS84): 경도 126~132도 μ‚¬μ΄μ—μ„œ μ‚¬μš©

EPSG:32651

+proj=utm +zone=51 +ellps=WGS84 +datum=WGS84 +units=m +no_defs 

 

 

[λ³΄μ •μ•ˆλœ 였래된 지리원 ν‘œμ€€]

이 μ’Œν‘œκ³„λ“€μ€ EPSG에 λ“±λ‘λ˜μ–΄ μžˆμ§€λ§Œ, lon_0κ°’μ˜ 문제둜 μ‹€μ œλ‘œλŠ” 거의 μ‚¬μš©λ˜μ§€ μ•ŠμŠ΅λ‹ˆλ‹€.

[였래된 지리원 ν‘œμ€€]이 ν˜„μ—…μ—μ„œ μ‹€μ œ μ‚¬μš©λœ μ’Œν‘œκ³„μž…λ‹ˆλ‹€.

*동뢀원점(Bessel): 강원도 λ“± 동뢀지역

EPSG:2096

+proj=tmerc +lat_0=38 +lon_0=129 +k=1 +x_0=200000 +y_0=500000 +ellps=bessel +units=m +no_defs +towgs84=-115.80,474.99,674.11,1.16,-2.31,-1.63,6.43

 

*쀑뢀원점(Bessel): μ„œμšΈ λ“± 쀑뢀지역

EPSG:2097

+proj=tmerc +lat_0=38 +lon_0=127 +k=1 +x_0=200000 +y_0=500000 +ellps=bessel +units=m +no_defs +towgs84=-115.80,474.99,674.11,1.16,-2.31,-1.63,6.43

 

*μ„œλΆ€μ›μ (Bessel): μ„œν•΄5도 λ“± μ„œλΆ€μ§€μ—­

EPSG:2098

+proj=tmerc +lat_0=38 +lon_0=125 +k=1 +x_0=200000 +y_0=500000 +ellps=bessel +units=m +no_defs +towgs84=-115.80,474.99,674.11,1.16,-2.31,-1.63,6.43

 

 

[였래된 지리원 ν‘œμ€€]

2002λ…„ 이전에 μ§€λ¦¬μ›μ˜ μ§€ν˜•λ„μ™€ KLIS λ“± κ΅­κ°€ μ‹œμŠ€ν…œμ—μ„œ μ‚¬μš©λ˜μ—ˆλ˜ μ’Œν‘œκ³„μž…λ‹ˆλ‹€.

*λ³΄μ •λœ μ„œλΆ€μ›μ (Bessel) - KLISμ—μ„œ μ„œλΆ€μ§€μ—­μ— μ‚¬μš©μ€‘

EPSG:5173

+proj=tmerc +lat_0=38 +lon_0=125.0028902777778 +k=1 +x_0=200000 +y_0=500000 +ellps=bessel +units=m +no_defs +towgs84=-115.80,474.99,674.11,1.16,-2.31,-1.63,6.43

 

*λ³΄μ •λœ 쀑뢀원점(Bessel): KLISμ—μ„œ 쀑뢀지역에 μ‚¬μš©μ€‘

EPSG:5174

+proj=tmerc +lat_0=38 +lon_0=127.0028902777778 +k=1 +x_0=200000 +y_0=500000 +ellps=bessel +units=m +no_defs +towgs84=-115.80,474.99,674.11,1.16,-2.31,-1.63,6.43

 

*λ³΄μ •λœ μ œμ£Όμ›μ (Bessel): KLISμ—μ„œ μ œμ£Όμ§€μ—­μ— μ‚¬μš©μ€‘

EPSG:5175

+proj=tmerc +lat_0=38 +lon_0=127.0028902777778 +k=1 +x_0=200000 +y_0=550000 +ellps=bessel +units=m +no_defs  +towgs84=-115.80,474.99,674.11,1.16,-2.31,-1.63,6.43

 

*λ³΄μ •λœ 동뢀원점(Bessel): KLISμ—μ„œ 동뢀지역에 μ‚¬μš©μ€‘

EPSG:5176

+proj=tmerc +lat_0=38 +lon_0=129.0028902777778 +k=1 +x_0=200000 +y_0=500000 +ellps=bessel +units=m +no_defs +towgs84=-115.80,474.99,674.11,1.16,-2.31,-1.63,6.43

 

*λ³΄μ •λœ 동해(μšΈλ¦‰)원점(Bessel): KLISμ—μ„œ μšΈλ¦‰μ§€μ—­μ— μ‚¬μš©μ€‘

EPSG:5177

+proj=tmerc +lat_0=38 +lon_0=131.0028902777778 +k=1 +x_0=200000 +y_0=500000 +ellps=bessel +units=m +no_defs  +towgs84=-115.80,474.99,674.11,1.16,-2.31,-1.63,6.43

 

 

[KATEC 계열]

ν•œλ°˜λ„ 전체λ₯Ό ν•˜λ‚˜μ˜ μ’Œν‘œκ³„λ‘œ λ‚˜νƒ€λ‚Ό λ•Œ 많이 μ‚¬μš©ν•˜λŠ” μ’Œν‘œκ³„μž…λ‹ˆλ‹€.

*UTM-K (Bessel): μƒˆμ£Όμ†Œμ§€λ„μ—μ„œ μ‚¬μš© 쀑

EPSG:5178

+proj=tmerc +lat_0=38 +lon_0=127.5 +k=0.9996 +x_0=1000000 +y_0=2000000 +ellps=bessel +units=m +no_defs +towgs84=-115.80,474.99,674.11,1.16,-2.31,-1.63,6.43

 

*UTM-K (GRS80): λ„€μ΄λ²„μ§€λ„μ—μ„œ μ‚¬μš©μ€‘μΈ μ’Œν‘œκ³„

EPSG:5179

+proj=tmerc +lat_0=38 +lon_0=127.5 +k=0.9996 +x_0=1000000 +y_0=2000000 +ellps=GRS80 +units=m +no_defs 

 

// 2014λ…„ 1μ›” 21일 신상희 μΆ”κ°€ 

*λ„€λΉ„κ²Œμ΄μ…˜μš© KATEC μ’Œν‘œκ³„(KOTI-KATEC)

EPSG μ—†μŒ. 비곡식 μ’Œν‘œκ³„μž„. 

+proj=tmerc +lat_0=38 +lon_0=128 +k=0.9999 +x_0=400000 +y_0=600000 +ellps=bessel +units=m +no_defs +towgs84=-115.80,474.99,674.11,1.16,-2.31,-1.63,6.43

 

 

[타원체 λ°”κΎΌ 지리원 ν‘œμ€€]

κ³Όκ±° 지리원 μ’Œν‘œκ³„μ—μ„œ 타원체와 lon_0 문제λ₯Ό μˆ˜μ •ν•œ μ’Œν‘œκ³„λ‘œ 2000λ…„λŒ€ μ΄ˆλ°˜μ— μž μ‹œ 많이 μ‚¬μš©λ˜μ—ˆμŠ΅λ‹ˆλ‹€.

*μ„œλΆ€μ›μ (GRS80)-falseY:50000

EPSG:5180

+proj=tmerc +lat_0=38 +lon_0=125 +k=1 +x_0=200000 +y_0=500000 +ellps=GRS80 +units=m +no_defs

 

*쀑뢀원점(GRS80)-falseY:50000: λ‹€μŒμ§€λ„μ—μ„œ μ‚¬μš©μ€‘μΈ μ’Œν‘œκ³„

EPSG:5181

+proj=tmerc +lat_0=38 +lon_0=127 +k=1 +x_0=200000 +y_0=500000 +ellps=GRS80 +units=m +no_defs

 

*μ œμ£Όμ›μ (GRS80)-falseY:55000

EPSG:5182

+proj=tmerc +lat_0=38 +lon_0=127 +k=1 +x_0=200000 +y_0=550000 +ellps=GRS80 +units=m +no_defs

 

*동뢀원점(GRS80)-falseY:50000

EPSG:5183

+proj=tmerc +lat_0=38 +lon_0=129 +k=1 +x_0=200000 +y_0=500000 +ellps=GRS80 +units=m +no_defs

 

*동해(μšΈλ¦‰)원점(GRS80)-falseY:50000

EPSG:5184

+proj=tmerc +lat_0=38 +lon_0=131 +k=1 +x_0=200000 +y_0=500000 +ellps=GRS80 +units=m +no_defs

[ν˜„μž¬ ꡭ토지리정보원 ν‘œμ€€]

2002λ…„ 이후에 ꡭ토지리정보원 μ§€ν˜•λ„μ—μ„œ μ‚¬μš©μ€‘μΈ μ’Œν‘œκ³„μž…λ‹ˆλ‹€.

*μ„œλΆ€μ›μ (GRS80)-falseY:60000

EPSG:5185

+proj=tmerc +lat_0=38 +lon_0=125 +k=1 +x_0=200000 +y_0=600000 +ellps=GRS80 +units=m +no_defs

 

*쀑뢀원점(GRS80)-falseY:60000

EPSG:5186

+proj=tmerc +lat_0=38 +lon_0=127 +k=1 +x_0=200000 +y_0=600000 +ellps=GRS80 +units=m +no_defs

 

*동뢀원점(GRS80)-falseY:60000

EPSG:5187

+proj=tmerc +lat_0=38 +lon_0=129 +k=1 +x_0=200000 +y_0=600000 +ellps=GRS80 +units=m +no_defs

 

*동해(μšΈλ¦‰)원점(GRS80)-falseY:60000

EPSG:5188

+proj=tmerc +lat_0=38 +lon_0=131 +k=1 +x_0=200000 +y_0=600000 +ellps=GRS80 +units=m +no_defs

  proj4.defs("EPSG:5179", "+proj=tmerc +lat_0=38 +lon_0=127.5 +k=0.9996 +x_0=1000000 +y_0=2000000 +ellps=GRS80 +units=m +no_defs");
  ol.proj.proj4.register(proj4);

 

이제 μœ„μ˜ μ½”λ“œλ₯Ό λ‹€μ‹œ μ‹€ν–‰ν•˜λ©΄ 

μ •μƒμ μœΌλ‘œ μ’Œν‘œλ³€ν™˜μ΄ 이루어진 것을 확인 ν•  수 μžˆλ‹€.

 

 


μ°Έκ³  : https://www.osgeo.kr/17

λŒ“κΈ€
λ°˜μ‘ν˜•