Loading views...
real gnss 보정 구현

real gnss 보정 구현

Date
Date
2020 Feb 14 0:0
Created by
Created by
Seonglae ChoSeonglae Cho
Created time
Created time
2023 Feb 28 12:39
Last edited by
Last edited by
Seonglae ChoSeonglae Cho
Last edited time
Last edited time
2023 Apr 15 16:50
Refs
Refs

Object - real gnss 보정 구현

 

 
움직여도 select, line 유지
왜 line cache만 남고 근처가면 다시 생기나
pvr.panomaked 가 문제였다 global로 panomaked 주니까 댐
clear는 space에만, 맵에서 나갔을 때
  • clear는 space에만
 
 

 
함수정리
MVC 패턴 비스무리하지만 함수지향으로 - 기존코드로 완벽한 분리는 안댐
  • 오른쪽같은 느낌으로
  • 전부 모듈이다
notion image
 

 
corb 에러...
일단 개념정립 AJAX 다른도메인 안되는건데
해결법이.. 안대면 그냥 다른 CDN?
notion image
proj4js - cdnjs.com - The best FOSS CDN for web related libraries to speed up your websites!
proj4js - Proj4js is a JavaScript library to transform point coordinates from one coordinate system to another, including datum transformations. - cdnjs.com - The best FOSS CDN for web related libraries to speed up your websites!
proj4js - cdnjs.com - The best FOSS CDN for web related libraries to speed up your websites!
그냥 이걸로 함
 

 
선택할때 1번 입력 경우
function correctionClick(e){ //disable when no start or end exist if (!osm.startPvr || osm.endPvr) return console.log(e.coordinate) if (!osm.point1){ osm.point1 = e.coordinate // todo - make line 1 } else if (!osm.point2){ osm.point2 = e.coordinate // todo - make line 2 if (confirm("보정 진행할까요?") == false) return osm.point1 = osm.point2 = undefined correction() console.log('proj4', ) osm.point1 = osm.point2 = undefined } }
 
function translateEnd(e){ /** * @summary - Event Function * @since - Called by All Click, Drag Event */ // Return Shift Click if (e.mapBrowserEvent.originalEvent.shiftKey && osm.dragging === undefined) return let feature = e.features.getArray()[0] // Correction select reset and ClearSelect clearEndSelect() console.log('change selected', ) // Return Vanilla Click Toggle osm.point1 = osm.point2 = undefined if (osm.dragging === undefined) return toggleRemove(feature) // Vanilla Drag dragged(feature) }
 
pano 이동 반영
function ChangeDegree(newLookAt){ /** * @summary - Change big arrow degree */ console.log(newLookAt) for (let pvr of PvrArray) if (pvr.PvrID == osm.startPvr) lookAt = pvr.Course lookAt = newLookAt + lookAt GetPvrRelationLocal() }
 
 

 
2번클릭 완벽하게`
layer 2 line
function correction(){ /** * @summary - Real Correction Function */ proj4.defs([ [ 'EPSG:4326', '+title=WGS 84 (long/lat) +proj=longlat +ellps=WGS84 +datum=WGS84 +units=degrees' ] ]) let tan1 = Math.tan(osm.angle1) let tan2 = Math.tan(osm.angle2) let x1 = osm.point1[0] let x2 = osm.point2[0] let y1 = osm.point1[1] let y2 = osm.point2[1] let x = - ((y1-y2) - (tan1*x1 - tan2*x2)) / (tan1 - tan2) let y = tan1*(x - x1) + y1 // if not in extent - alert // move pvr console.log(x, y) movePvr(osm.startPvr, osm.startFeature, [x, y]) GetPvrRelationLocal() } function resetCorrection(soft){ /** * @summary - reset Correction * @since - correction complete or restart */ // todo - remove layer console.log('reset soft', soft) if (soft) osm.point1 = osm.point2 = undefined else osm.selectCoor = osm.point1 = osm.point2 = undefined }
  • soft reset으로 성공
 
 
좌표변환 에러
 
LNG
LAT
x [EPSG:3857]
y [EPSG:3857]
x [EPSG:5179]
y [EPSG:5179]
LNG
126.9449
LAT
37.55029
x [EPSG:3857]
14131444.99
y [EPSG:3857]
4516090.298
x [EPSG:5179]
950970.067
y [EPSG:5179]
1950250.459
LNG
126.9437
LAT
37.55062
x [EPSG:3857]
14131310.03
y [EPSG:3857]
4516136.28
x [EPSG:5179]
950863.192
y [EPSG:5179]
1950287.424
LNG
126.9436
LAT
-16.2318
x [EPSG:3857]
14131298.1
y [EPSG:3857]
-1831577.732
x [EPSG:5179]
950853.136
y [EPSG:5179]
1950188.628
notion image
function correction(){ /** * @summary - Real Correction Function */ proj4.defs([ [ 'EPSG:32652', '+proj=utm +zone=52 +ellps=WGS84 +datum=WGS84 +units=m +no_defs' ] ]) let tan1 = Math.tan(osm.angle1) let tan2 = Math.tan(osm.angle2) let tm1 = proj4('EPSG:3857', 'EPSG:32652').forward(osm.point1) let tm2 = proj4('EPSG:3857', 'EPSG:32652').forward(osm.point2) let x1 = tm1[0] let x2 = tm2[0] let y1 = tm1[1] let y2 = tm2[1] let x = - ((y1-y2) - (tan1*x1 - tan2*x2)) / (tan1 - tan2) let y = tan1*(x - x1) + y1 // move pvr let xy = proj4('EPSG:3857', 'EPSG:32652').inverse([x, y]) newX = xy[0] newY = xy[1] // todo - if not in extent - alert let newlnglat = ol.proj.transform([newX, newY], 'EPSG:3857', 'EPSG:4326') newlng = newlnglat[0] newlat = newlnglat[1] movePvr(osm.startPvr, osm.startFeature, [newlng, newlat]) GetPvrRelationLocal() }
구현완료
click 1, 2 시 움직임 보정
  • 공식
한국 주요 좌표계 EPSG코드 및 proj4 인자 정리
본 좌표계에 관한 정보들은 타원체 변환을 위해 국토지리정보원이 2002년 12월에 고시(제2002-433호)한 "국가좌표변환계수"의 Bursa-Wolf 모델용 7개의 변수를 기준으로 작성되었습니다. 현재 국토지리정보원의 공..
한국 주요 좌표계 EPSG코드 및 proj4 인자 정리
  • 사용법 PROJ4.JS
proj4js/proj4js
Proj4js is a JavaScript library to transform point coordinates from one coordinate system to another, including datum transformations. Originally a port of PROJ.4 and GCTCP C it is a part of the MetaCRS group of projects. Depending on your preferences npm install proj4 bower install proj4 component install proj4js/proj4js or just manually grab the file proj4.js from the latest release's dist/ folder.
proj4js/proj4js
 

 
 

Recommendations