
๊ฐ๋ฐ์ ํ๋ฉด์ ๋ ์ด์ด์ ํฌ๊ธฐ๊ฐ ๋ค๋ฅธ ๊ฒฝ์ฐ ์ง๋์ ์ค๋ ๋ฒจ์ ์ง์ ๋ง์ถฐ ์ฃผ์ด์ผ ํ๋ ๋ฒ๊ฑฐ๋ก์์ ๊ฒช์๋ ๊ฒฝํ์ด ์์๋ค. ํ์ง๋ง ์ด์ fit ํจ์๋ฅผ ํตํด ์ด๋ฐ ๋ฌธ์ ๋ฅผ ์กฐ๊ธ์ ๋ ์ ์๊ฒ ๋์๋ค. ํ์์ ๋ด๊ณ ์๋ ๋ ์ด์ด์ ๋ฐ์ด๋๋ฆฌ์ ์ง๋ ์ฌ์ด์ฆ๋ฅผ ํตํด ์ง๋ ์ค๋ ๋ฒจ์ ๋ง์ถ ์ ์๋ค. map.getView().fit(vectorSource.getExtent(), map.getSize()); ๊ฒฐ๊ณผ
์คํ๋ ์ด์ด์ค๋ก ๊ฐ๋ฐ์ ๋ฐฐ๊ฒฝ์ง๋์ ๋ง์ง ์๋ ์ขํ๊ณ์ ๋ฐ์ดํฐ๋ฅผ ํ์ถํด์ผํ ๊ฒฝ์ฐ ๊ฐ feature์ coordinates๋ฅผ ๋ณํํด์ค์ผํ๋ค. ๊ทธ ๋ฐฉ๋ฒ์ ๋ํ ์์ค๋ ์๋์ ๊ฐ๋ค. ๋ฐฐ๊ฒฝ์ง๋ - EPSG:3857 ๋ฐ์ดํฐ - EPSG:5179 // EPSG:5179 ์ขํ๊ณ ๋ฑ๋ก 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); var vectorSource = new ol.source.Vector({ format: new ol.format.GeoJSON(), loader: func..

geojson ํ์ผ์ ์ฝ์ด๋ค์ฌ ๋ฒกํฐ๋ ์ด์ด๋ก ์์ฑํ๊ณ ํ์ถํ๋ ์ฝ๋ ์ ๋๋ค. ํ ์คํธ์ฉ ์์ธ์ ํ์ ๊ตฌ์ญ geojson ๋ฐ์ดํฐ๋ ํจ๊ป ์ฌ๋ ค๋์์ต๋๋ค. var vectorSource = new ol.source.Vector({ url:"./geojson/seoulHD.geojson", //geojson ํ์ผ format: new ol.format.GeoJSON() }); var vectorLayer = new ol.layer.Vector({ source: vectorSource, style: new ol.style.Style({ // fill: new ol.style.Fill({ // color: "rgba(255,255,0,0.3)", // }), stroke: new ol.style.Stroke({ colo..

๋ค์์ ๊ฒฝ์ฐ๋ 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][..

1. postgis ํ ์ด๋ธ 2. shp ๋ด๋ ค๋ฐ๊ธฐ ์์ค Map params = new HashMap(); params.put(PostgisNGJNDIDataStoreFactory.DBTYPE.key, "postgis"); params.put(PostgisNGJNDIDataStoreFactory.HOST.key, "์ ์ DB IP"); params.put(PostgisNGJNDIDataStoreFactory.PORT.key, Integer.valueOf(์ ์DB ํฌํธ)); params.put(PostgisNGJNDIDataStoreFactory.SCHEMA.key, "์ ์ ์คํค๋ง๋ช "); params.put(PostgisNGJNDIDataStoreFactory.DATABASE.key, "์ ์ ๋ฐ์ดํฐ๋ฒ ์ด์ค๋ช ")..
geotools ๋ก shp > postsql ์ํฌํธ์ ์ขํ ์์๋ฅผ ๋ณ๊ฒฝํ์ฌ ๋ฐ์ดํฐ๋ฅผ ๋ฃ์ ์ ์๋ค. SimpleFeatureTypeBuilder builder = new SimpleFeatureTypeBuilder(); // ์ขํ x.y ์์ ๋ณํ Hints hints = new Hints(Hints.FORCE_LONGITUDE_FIRST_AXIS_ORDER, Boolean.FALSE); CRSAuthorityFactory factory = ReferencingFactoryFinder.getCRSAuthorityFactory("EPSG", hints); CoordinateReferenceSystem AXIS_CRS = factory.createCoordinateReferenceSystem("EPSG:43..
var selectpolygon_Layer = new ol.layer.VectorTile({ renderMode: 'image', style: fn_Style, TxIdentify : false, name:'layer_name', extent : [13871448.599455647, 3910161.980931684, 14680011.069810476, 4666950.827313901], source: new ol.source.VectorTile({ tilePixelRatio: 1, tileGrid: ol.tilegrid.createXYZ({ maxZoom: 19, tileSize: [256,256] }), format: new ol.format.MVT(), url: SeverURL+'/geoserver/..