Browse Source

uam공역 파일 삭제 및 허용고도 격자 도형 생성 유틸 추가

master
junh_eee(이준희) 6 months ago
parent
commit
bd7a51c9d8
  1. 639
      src/components/map/geojson/uamRouteArea.json
  2. 1076
      src/components/map/geojson/uamTowerArea.json
  3. 77
      src/components/map/mapbox/feature/FeatureAirSquare.js
  4. 5
      src/components/map/mapbox/feature/FeatureAirZone.js

639
src/components/map/geojson/uamRouteArea.json

@ -1,639 +0,0 @@
{
"type": "FeatureCollection",
"features": [
{
"type": "Feature",
"geometry": {
"type": "LineString",
"coordinates": [
[126.6243464, 37.5642352],
[126.627865, 37.57291277777778],
[126.63130833333331, 37.574488333333335],
[126.64792694444445, 37.57170861111112],
[126.66070861111113, 37.57284000000001],
[126.71217305555557, 37.571181388888895],
[126.72323666666666, 37.55760305555555],
[126.74221777777778, 37.551310277777766],
[126.75231583333333, 37.552930555555555],
[126.75556138888886, 37.5517675],
[126.76711666666668, 37.53592416666667],
[126.76253555555556, 37.53282305555555],
[126.74099055555556, 37.54691583333333],
[126.7212813888889, 37.55372722222222],
[126.71090916666664, 37.57002333333334],
[126.66086972222223, 37.57148361111111],
[126.64985499999999, 37.57053277777778],
[126.63398138888893, 37.55547861111111],
[126.62887638888888, 37.55600555555555],
[126.6243464, 37.5642352]
]
},
"properties": {
"type": "routeLine",
"name": "AR",
"description": "UAM 아라뱃길 노선"
}
},
{
"type": "Feature",
"geometry": {
"type": "Point",
"coordinates": [126.6243464, 37.5642352]
},
"properties": {
"type": "routePoint",
"name": "AR",
"description": "드론시험 인증센터"
}
},
{
"type": "Feature",
"geometry": {
"type": "Point",
"coordinates": [126.627865, 37.57291277777778]
},
"properties": {
"type": "routePoint",
"name": "AR",
"description": "001"
}
},
{
"type": "Feature",
"geometry": {
"type": "Point",
"coordinates": [126.63130833333331, 37.574488333333335]
},
"properties": {
"type": "routePoint",
"name": "AR",
"description": "002"
}
},
{
"type": "Feature",
"geometry": {
"type": "Point",
"coordinates": [126.64792694444445, 37.57170861111112]
},
"properties": {
"type": "routePoint",
"name": "AR",
"description": "003"
}
},
{
"type": "Feature",
"geometry": {
"type": "Point",
"coordinates": [126.66070861111113, 37.57284000000001]
},
"properties": {
"type": "routePoint",
"name": "AR",
"description": "004"
}
},
{
"type": "Feature",
"geometry": {
"type": "Point",
"coordinates": [126.71217305555557, 37.571181388888895]
},
"properties": {
"type": "routePoint",
"name": "AR",
"description": "005"
}
},
{
"type": "Feature",
"geometry": {
"type": "Point",
"coordinates": [126.72323666666666, 37.55760305555555]
},
"properties": {
"type": "routePoint",
"name": "AR",
"description": "006"
}
},
{
"type": "Feature",
"geometry": {
"type": "Point",
"coordinates": [126.74221777777778, 37.551310277777766]
},
"properties": {
"type": "routePoint",
"name": "AR",
"description": "007"
}
},
{
"type": "Feature",
"geometry": {
"type": "Point",
"coordinates": [126.75231583333333, 37.552930555555555]
},
"properties": {
"type": "routePoint",
"name": "AR",
"description": "008"
}
},
{
"type": "Feature",
"geometry": {
"type": "Point",
"coordinates": [126.75556138888886, 37.5517675]
},
"properties": {
"type": "routePoint",
"name": "AR",
"description": "009"
}
},
{
"type": "Feature",
"geometry": {
"type": "Point",
"coordinates": [126.76711666666668, 37.53592416666667]
},
"properties": {
"type": "routePoint",
"name": "AR",
"description": "010"
}
},
{
"type": "Feature",
"geometry": {
"type": "Point",
"coordinates": [126.76253555555556, 37.53282305555555]
},
"properties": {
"type": "routePoint",
"name": "AR",
"description": "011"
}
},
{
"type": "Feature",
"geometry": {
"type": "Point",
"coordinates": [126.74099055555556, 37.54691583333333]
},
"properties": {
"type": "routePoint",
"name": "AR",
"description": "012"
}
},
{
"type": "Feature",
"geometry": {
"type": "Point",
"coordinates": [126.7212813888889, 37.55372722222222]
},
"properties": {
"type": "routePoint",
"name": "AR",
"description": "013"
}
},
{
"type": "Feature",
"geometry": {
"type": "Point",
"coordinates": [126.71090916666664, 37.57002333333334]
},
"properties": {
"type": "routePoint",
"name": "AR",
"description": "014"
}
},
{
"type": "Feature",
"geometry": {
"type": "Point",
"coordinates": [126.66086972222223, 37.57148361111111]
},
"properties": {
"type": "routePoint",
"name": "AR",
"description": "015"
}
},
{
"type": "Feature",
"geometry": {
"type": "Point",
"coordinates": [126.64985499999999, 37.57053277777778]
},
"properties": {
"type": "routePoint",
"name": "AR",
"description": "016"
}
},
{
"type": "Feature",
"geometry": {
"type": "Point",
"coordinates": [126.63398138888893, 37.55547861111111]
},
"properties": {
"type": "routePoint",
"name": "AR",
"description": "017"
}
},
{
"type": "Feature",
"geometry": {
"type": "Point",
"coordinates": [126.62887638888888, 37.55600555555555]
},
"properties": {
"type": "routePoint",
"name": "AR",
"description": "018"
}
},
{
"type": "Feature",
"geometry": {
"type": "LineString",
"coordinates": [
[126.72420416666667, 37.66822861111111],
[126.72130583333335, 37.66335111111111],
[126.79702611111112, 37.61767361111111],
[126.74079222222223, 37.65721194444444],
[126.72420416666667, 37.66822861111111]
]
},
"properties": {
"type": "routeLine",
"name": "HG",
"description": "UAM 한강 노선1"
}
},
{
"type": "Feature",
"geometry": {
"type": "Point",
"coordinates": [126.72420416666667, 37.66822861111111]
},
"properties": {
"type": "routePoint",
"name": "HG",
"description": "001"
}
},
{
"type": "Feature",
"geometry": {
"type": "Point",
"coordinates": [126.72130583333335, 37.66335111111111]
},
"properties": {
"type": "routePoint",
"name": "HG",
"description": "002"
}
},
{
"type": "Feature",
"geometry": {
"type": "Point",
"coordinates": [126.79702611111112, 37.61767361111111]
},
"properties": {
"type": "routePoint",
"name": "HG",
"description": "003"
}
},
{
"type": "Feature",
"geometry": {
"type": "Point",
"coordinates": [126.74079222222223, 37.65721194444444]
},
"properties": {
"type": "routePoint",
"name": "HG",
"description": "004"
}
},
{
"type": "Feature",
"geometry": {
"type": "LineString",
"coordinates": [
[126.79702611111112, 37.61767361111111],
[126.80453805555555, 37.572388333333336],
[126.80991500000003, 37.555640555555556],
[126.81530555555557, 37.554041388888876],
[126.91214388888889, 37.52405611111111]
]
},
"properties": {
"type": "routeLine",
"name": "HG",
"description": "UAM 한강 노선2"
}
},
{
"type": "Feature",
"geometry": {
"type": "Point",
"coordinates": [126.80453805555555, 37.572388333333336]
},
"properties": {
"type": "routePoint",
"name": "HG",
"description": "005"
}
},
{
"type": "Feature",
"geometry": {
"type": "Point",
"coordinates": [126.80991500000003, 37.555640555555556]
},
"properties": {
"type": "routePoint",
"name": "HG",
"description": "006"
}
},
{
"type": "Feature",
"geometry": {
"type": "Point",
"coordinates": [126.81530555555557, 37.554041388888876]
},
"properties": {
"type": "routePoint",
"name": "HG",
"description": "007"
}
},
{
"type": "Feature",
"geometry": {
"type": "LineString",
"coordinates": [
[126.92951111111113, 37.535757499999995],
[126.93060138888889, 37.53156861111111],
[126.91713111111112, 37.52255194444444],
[126.91214388888889, 37.52405611111111],
[126.92951111111113, 37.535757499999995]
]
},
"properties": {
"type": "routeLine",
"name": "HG",
"description": "UAM 한강 노선3"
}
},
{
"type": "Feature",
"geometry": {
"type": "Point",
"coordinates": [126.92951111111113, 37.535757499999995]
},
"properties": {
"type": "routePoint",
"name": "HG",
"description": "008"
}
},
{
"type": "Feature",
"geometry": {
"type": "Point",
"coordinates": [126.93060138888889, 37.53156861111111]
},
"properties": {
"type": "routePoint",
"name": "HG",
"description": "009"
}
},
{
"type": "Feature",
"geometry": {
"type": "Point",
"coordinates": [126.91214388888889, 37.52405611111111]
},
"properties": {
"type": "routePoint",
"name": "HG",
"description": "010"
}
},
{
"type": "Feature",
"geometry": {
"type": "Point",
"coordinates": [126.91713111111112, 37.52255194444444]
},
"properties": {
"type": "routePoint",
"name": "HG",
"description": "011"
}
},
{
"type": "Feature",
"geometry": {
"type": "LineString",
"coordinates": [
[127.08605444444446, 37.519884166666664],
[127.0841361111111, 37.51934638888889],
[127.07263527777779, 37.51935388888888],
[127.05694444444444, 37.53],
[127.06211527777776, 37.53232277777778],
[127.0720008333333, 37.50237972222222],
[127.09528527777779, 37.49509166666667],
[127.09718083333335, 37.49339055555556],
[127.09813527777777, 37.490587777777776],
[127.1054336111111, 37.48388333333334],
[127.10976999999998, 37.48730472222222],
[127.10070555555555, 37.494905555555555],
[127.07244999999999, 37.50371194444445]
]
},
"properties": {
"type": "routeLine",
"name": "TC",
"description": "UAM 탄천 노선"
}
},
{
"type": "Feature",
"geometry": {
"type": "Point",
"coordinates": [127.08605444444446, 37.519884166666664]
},
"properties": {
"type": "routePoint",
"name": "TC",
"description": "001"
}
},
{
"type": "Feature",
"geometry": {
"type": "Point",
"coordinates": [127.0841361111111, 37.51934638888889]
},
"properties": {
"type": "routePoint",
"name": "TC",
"description": "002"
}
},
{
"type": "Feature",
"geometry": {
"type": "Point",
"coordinates": [127.07263527777779, 37.51935388888888]
},
"properties": {
"type": "routePoint",
"name": "TC",
"description": "003"
}
},
{
"type": "Feature",
"geometry": {
"type": "Point",
"coordinates": [127.05694444444444, 37.53]
},
"properties": {
"type": "routePoint",
"name": "TC",
"description": "004"
}
},
{
"type": "Feature",
"geometry": {
"type": "Point",
"coordinates": [127.06211527777776, 37.53232277777778]
},
"properties": {
"type": "routePoint",
"name": "TC",
"description": "005"
}
},
{
"type": "Feature",
"geometry": {
"type": "Point",
"coordinates": [127.0720008333333, 37.50237972222222]
},
"properties": {
"type": "routePoint",
"name": "TC",
"description": "006"
}
},
{
"type": "Feature",
"geometry": {
"type": "Point",
"coordinates": [127.09528527777779, 37.49509166666667]
},
"properties": {
"type": "routePoint",
"name": "TC",
"description": "007"
}
},
{
"type": "Feature",
"geometry": {
"type": "Point",
"coordinates": [127.09718083333335, 37.49339055555556]
},
"properties": {
"type": "routePoint",
"name": "TC",
"description": "008"
}
},
{
"type": "Feature",
"geometry": {
"type": "Point",
"coordinates": [127.09813527777777, 37.490587777777776]
},
"properties": {
"type": "routePoint",
"name": "TC",
"description": "009"
}
},
{
"type": "Feature",
"geometry": {
"type": "Point",
"coordinates": [127.1054336111111, 37.48388333333334]
},
"properties": {
"type": "routePoint",
"name": "TC",
"description": "010"
}
},
{
"type": "Feature",
"geometry": {
"type": "Point",
"coordinates": [127.10976999999998, 37.48730472222222]
},
"properties": {
"type": "routePoint",
"name": "TC",
"description": "011"
}
},
{
"type": "Feature",
"geometry": {
"type": "Point",
"coordinates": [127.10070555555555, 37.494905555555555]
},
"properties": {
"type": "routePoint",
"name": "TC",
"description": "012"
}
},
{
"type": "Feature",
"geometry": {
"type": "Point",
"coordinates": [127.07244999999999, 37.50371194444445]
},
"properties": {
"type": "routePoint",
"name": "TC",
"description": "013"
}
}
]
}

1076
src/components/map/geojson/uamTowerArea.json

File diff suppressed because it is too large Load Diff

77
src/components/map/mapbox/feature/FeatureAirSquare.js

@ -1,6 +1,6 @@
import * as turf from '@turf/turf';
const handlerCoords = (latLng, buffer, angle) => {
export const handlerCoords = (latLng, buffer, angle) => {
const coords = turf.destination(
turf.point([latLng[0], latLng[1]]),
buffer / 1000,
@ -11,7 +11,7 @@ const handlerCoords = (latLng, buffer, angle) => {
return coords;
};
const handlerLine = (id, latLng, buffer, angleArr) => {
export const handlerLine = (id, latLng, buffer, angleArr) => {
const line = {
id: id,
type: 'Feature',
@ -104,3 +104,76 @@ export const airSquareLine = (air, map) => {
}
});
};
export const airSquareGrid = (air, idx) => {
// if (idx != 0) return;
const center = air.center;
const buffer = air.buffer;
let angle = 270; // 왼쪽부터 시작
// 왼쪽, 오른쪽
for (let leftRight = 0; leftRight < 2; leftRight++) {
if (leftRight != 0) return;
if (leftRight === 1) angle = 90;
let distance = 0;
for (let width = 0; width < Math.floor(air.buffer / 1000) + 1; width++) {
distance += 1000;
const originDistance = Math.sqrt(buffer ** 2 - (distance - 1000) ** 2);
let point = handlerCoords(center, distance, angle);
let x = 0;
while (1000 * x < originDistance) {
x++;
}
// 위, 아래
for (let topBottom = 0; topBottom < 2; topBottom++) {
for (let length = 0; length < x; length++) {
getSquare(point, leftRight, topBottom);
const angle = topBottom === 0 ? 0 : 180;
point = handlerCoords(point, 1000, angle);
}
}
}
}
};
const getSquare = (coord, weType, nsType) => {
const square = [coord];
let angle = 0;
if (weType === 0 && nsType === 1) {
angle = 90;
} else if (weType === 1) {
if (nsType === 0) {
angle = 360;
} else if (nsType === 1) {
angle = 270;
}
}
for (let i = 2; i < 5; i++) {
const tt = handlerCoords(square[i - 2], 1000, angle);
if (weType === 0) {
angle += 90;
} else if (weType === 1) {
angle -= 90;
}
square.push(tt);
}
const polygon = {
type: 'Feature',
geometry: {
type: 'Polygon',
coordinates: square
}
};
// setSquarePaths(prev => [...prev, polygon]);
};

5
src/components/map/mapbox/feature/FeatureAirZone.js

@ -27,6 +27,8 @@ export default function FeatureAirZone(props) {
let popup;
const mapState = useSelector(state => state.mapState);
// const [squarePaths, setSquarePaths] = useState([]);
useEffect(() => {
featureAirZoneInit();
}, []);
@ -172,6 +174,9 @@ export default function FeatureAirZone(props) {
airPort.map(air => airSquareLine(air, props.map));
// 마우스 오버 이벤트 생성
featureAirEvent(markers);
// 격자공역(polygon)
// airPort.map((air, idx) => gridSquare(air, idx));
};
return null;

Loading…
Cancel
Save