Skip to content

mnms/population

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

39 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

population

Visualization of the floating population

ํ™˜๊ฒฝ์„ค์ • (๊ฐœ๋ฐœ ํˆด ํฌํ•จ)

- java v1.8 
- node.js v12.16.2
- npm v6.14.4
- VS Code ๋˜๋Š” ๊ทธ์™ธ Frontend ๊ฐœ๋ฐœ ํˆด
- Spring Tool Suite 4 

ํ”„๋กœ์ ํŠธ ๊ธฐ๋ณธ ๊ตฌ์„ฑ

  * ์ „์ฒด
      frontend  // Client ์›น ์„œ๋น„์Šค (node, npm, react ๊ตฌ์„ฑ)
      src       // backend ์„œ๋น„์Šค : java class (๋กœ๊ทธ์ธ ์ฒ˜๋ฆฌ)
      pom.xml   // maven dependencies : springframework ์‚ฌ์šฉ
  
  * Frontend (React App ๊ธฐ๋ณธ ๊ตฌ์„ฑ)
      external          // Vector Tile ์„œ๋น„์Šค ์‹œ ํ•„์š”ํ•œ ๋ผ์ด๋ธŒ๋Ÿฌ๋ฆฌ
      node_external     // node_module ๊ด€๋ จ ๋ณ„๋„ ์ปค์Šคํ…€ํ•œ ๋ผ์ด๋ธŒ๋Ÿฌ๋ฆฌ
      public
      src               // Web ๋กœ์ง
        component
          AuthenticatedRoute.jsx    // ๋กœ๊ทธ์ธ ์ธ์ฆ ์ฒ˜๋ฆฌ
          InstructorApp.jsx         // ํŽ˜์ด์ง€ ๋ผ์šฐํ„ฐ ์ฒ˜๋ฆฌ
          LoginComponent.jsx        // ๋กœ๊ทธ์ธ ์ปดํฌ๋„ŒํŠธ
          LogoutComponent.jsx       // ๋กœ๊ทธ์•„์›ƒ ์ปดํฌ๋„ŒํŠธ
          MenuComponent.jsx         // ์ตœ์ƒ๋‹จBar ๋ฉ”๋‰ด ์ปดํฌ๋„ŒํŠธ
          MainComponent.jsx         // ์ง€๋„/์ฐจํŠธ ์˜์—ญ ์ปดํฌ๋„ŒํŠธ
          MapScript.js              // ์ง€๋„๊ธฐ๋Šฅ ์Šคํฌ๋ฆฝํŠธ
          ChartScript.js            // ์ฐจํŠธ๊ธฐ๋“ฑ ์Šคํฌ๋ฆฝํŠธ
        css
        js
        redux                       // react-redux ์‚ฌ์šฉ (์ƒํƒœ ๊ฐ’ ์ €์žฅ)
        service
          AuthenticationService.js  // ๋กœ๊ทธ์ธ ํŽ˜์ด์ง€์—์„œ ๋กœ๊ทธ์ธ ์‹œ backend ํ†ต์‹  ๋ฐ ์ธ์ฆ ์ฒ˜๋ฆฌ ํ™•์ธ
          CustomFunc.js             // ์ง€๋„/์ฐจํŠธ ๊ธฐ๋Šฅ์— ํ•„์š”ํ•œ ํ•จ์ˆ˜๋“ค
        App.css                     // ์ปค์Šคํ…€ css ํฌํ•จ
        App.js
        index.css
        index.js
        server.json                 // HTTP API ์„œ๋ฒ„์— Connect ํ•˜๊ธฐ ์œ„ํ•œ ์ •๋ณด
        serviceWorker.js
      package.json                  // npm, node ๊ด€๋ จ ์„ค์ •
      

๋นŒ๋“œ ๋ฐ ์‹คํ–‰

1) npm ์‚ฌ์šฉ

Frontend ์‹คํ–‰ : cd /root/population/frontend

- ์‹คํ–‰
$ cd frontend
$ npm start

- ๋นŒ๋“œ
$ cd frontend
$ npm run build

* ๊ฐœ๋ฐœ ํ™˜๊ฒฝ ์‹œ
  - package.json => "proxy": "http://localhost:8066" ์˜ต์…˜ ํ™•์ธ. (server port์™€ ๋งž๋Š”์ง€ ํ™•์ธ)

backend ์‹คํ–‰ : spring boot tool ์‚ฌ์šฉ

- resources/application.properties ํ™•์ธ
   - H2 DB ๊ฒฝ๋กœ ์„ค์ • ๋ณ€๊ฒฝ : spring.datasource.url -> {๋กœ์ปฌ ๊ฒฝ๋กœ}
   - default port : 8066 (server.port ์˜ต์…˜์œผ๋กœ ๋ณ€๊ฒฝ ๊ฐ€๋Šฅ) 

- ์‹คํ–‰
  - population ํ”„๋กœ์ ํŠธ => Spring Boot App์œผ๋กœ ์‹คํ–‰

- ๋นŒ๋“œ
  - maven build -> mvn clean install
  - target ํด๋” ํ™•์ธ

2) jar ์‚ฌ์šฉ

  1. jar ๋ฐฐํฌ ๋ฐ ์‹คํ–‰
 - ๋ฐฐํฌํ•  ํŠน์ • ๋””๋ ‰ํ† ๋ฆฌ ์ƒ์„ฑ.
 - mvn build ํ•œ target ํด๋”์˜ ๋ชจ๋“  ํŒŒ์ผ ๋ณต์‚ฌ.
 - $ java -jar population-0.0.1-SNAPSHOT.jar ๋ช…๋ น์–ด๋กœ ์‹คํ–‰
 - http://localhost:8066 URL๋กœ ์ •์ƒ ๋™์ž‘ ํ™•์ธ
  1. git clone ๋ฐ serve ๋ฐฉ๋ฒ•
 $ git clone https://github.com/bbbbbra/population.git
 $ cd population/frontend
 $ npm install
 $ npm run build
 $ serve -l 8066 -s build
 - http://localhost:8066 URL๋กœ ์ •์ƒ ๋™์ž‘ ํ™•์ธ

HTTP API ์„œ๋ฒ„ ์„ค์ • ํ™•์ธ

  • VectorTile ๋ฐ Chart ๋ฐ์ดํ„ฐ๋ฅผ ๊ฐ€์ ธ์˜ค๊ธฐ ์œ„ํ•œ ์ ‘์† ์ •๋ณด
  ๊ฒฝ๋กœ : cd population/frontend/src
  ์ ‘์†์ •๋ณด : server.json ํŒŒ์ผ ํ™•์ธ
  
  {
    "user": "ltdb",
    "password": "ltdb",
    "database": "default",
    "protocol": "http",
    "host": "fbg01",
    "port": [4762, 4763, 4764, 4765, 4766, 4767, 4768, 4769, 4770, 4771, 4772, 4773]
  }
  

HTTP API ์‚ฌ์šฉํ•˜๊ธฐ ์œ„ํ•œ ๊ด€๋ จ ํ…Œ์ด๋ธ” ์ •๋ณด

  • ํ…Œ์ด๋ธ” DDL CREATE ๊ด€๋ จํ•ด์„œ๋Š” HTTP API ์„œ๋ฒ„ README ์ฐธ๊ณ .
  * ltdb_fp ํ…Œ์ด๋ธ” : ์œ ๋™์ธ๊ตฌ ๋ฐ์ดํ„ฐ (์ง€๋„/์ฐจํŠธ ๊ตฌํ˜„ ์‹œ ์‚ฌ์šฉ)
  
  CREATE table ltdb_fp (
    adm_code string,
    x double,
    y double,
    recordid integer,
    block_cd long,
    exist_m_00 double,
    exist_m_10 double,
    exist_m_20 double,
    exist_m_30 double,
    exist_m_40 double,
    exist_m_50 double,
    exist_m_60 double,
    exist_m_70 double,
    exist_m_80 double,
    exist_m_90 double,
    exist_f_00 double,
    exist_f_10 double,
    exist_f_20 double,
    exist_f_30 double,
    exist_f_40 double,
    exist_f_50 double,
    exist_f_60 double,
    exist_f_70 double,
    exist_f_80 double,
    exist_f_90 double,
    home_m_00 double,
    home_m_10 double,
    home_m_20 double,
    home_m_30 double,
    home_m_40 double,
    home_m_50 double,
    home_m_60 double,
    home_m_70 double,
    home_m_80 double,
    home_m_90 double,
    home_f_00 double,
    home_f_10 double,
    home_f_20 double,
    home_f_30 double,
    home_f_40 double,
    home_f_50 double,
    home_f_60 double,
    home_f_70 double,
    home_f_80 double,
    home_f_90 double,
    work_m_00 double,
    work_m_10 double,
    work_m_20 double,
    work_m_30 double,
    work_m_40 double,
    work_m_50 double,
    work_m_60 double,
    work_m_70 double,
    work_m_80 double,
    work_m_90 double,
    work_f_00 double,
    work_f_10 double,
    work_f_20 double,
    work_f_30 double,
    work_f_40 double,
    work_f_50 double,
    work_f_60 double,
    work_f_70 double,
    work_f_80 double,
    work_f_90 double,
    in_m_00 double,
    in_m_10 double,
    in_m_20 double,
    in_m_30 double,
    in_m_40 double,
    in_m_50 double,
    in_m_60 double,
    in_m_70 double,
    in_m_80 double,
    in_m_90 double,
    in_f_00 double,
    in_f_10 double,
    in_f_20 double,
    in_f_30 double,
    in_f_40 double,
    in_f_50 double,
    in_f_60 double,
    in_f_70 double,
    in_f_80 double,
    in_f_90 double,
    geohash string,
    geometry string,
    event_time string
    )
    USING r2 OPTIONS
    (
    table '900',
    host 'fbg02',
    port '18900',
    partitions 'event_time geohash',
    mode 'nvkvs',
    rowstore 'false',
    at_least_one_partition_enabled 'no',
    group_query_enabled 'yes',
    geometry_type 'point'
  )


  * ltdb_fp_history ํ…Œ์ด๋ธ” : ๋‚ ์งœ๋ณ„ ์œ ๋™์ธ๊ตฌ ํžˆ์Šคํ† ๋ฆฌ ํ…Œ์ด๋ธ” (์ตœ์‹ ๋‚ ์งœ ์—…๋ฐ์ดํŠธ(์บ˜๋ฆฐ๋”)์—  ) 
  * login ๋ฐ ์ƒˆ๋กœ๊ณ ์นจ ์‹œ ์ตœ์‹ ๋‚ ์งœ๋Š” 'select max(event_time) from ltdb_fp_history'๋กœ ๊ฐ€์ ธ์˜ค๋ฏ€๋กœ, ๋ฐ์ดํ„ฐ ์ ์žฌ ์‹œ ltdb_fp_history ํ…Œ์ด๋ธ”์— ๋ฐ์ดํ„ฐ๋ฅผ ์—…๋ฐ์ดํŠธ(์ถ”๊ฐ€)ํ•ด์ฃผ์–ด์•ผ ํ•œ๋‹ค.
  
  CREATE table ltdb_fp_history (
    event_time string,
    table_name string
    )
    USING r2 OPTIONS
    (
    table '910',
    host 'fbg02',
    port '18900',
    partitions 'table_name event_time',
    mode 'nvkvs',
    rowstore 'false',
    at_least_one_partition_enabled 'no'
  )
  

์‚ฌ์šฉ์ž ์˜์—ญ ํฌ๊ธฐ ๋ณ€๊ฒฝ (์†Œ์Šค์ฝ”๋“œ)

  - cd frontend/src/component
  - ChartScript.js 34๋ฒˆ์งธ code line
  - MapScript.js 1100๋ฒˆ์งธ code line
  - circleRadius ๋ณ€์ˆ˜ ๊ฐ’ ๋ณ€๊ฒฝ => default = 2; (๊ธฐ๋ณธ๋‹จ์œ„ Km)

REST API Service

  • Service ๊ด€๋ จ source code -> population/src/main/java/kr/co/ltdb/controller/MemberController.java

  • javascript ์ƒ์˜ ํ…Œ์ŠคํŠธ๊ฐ€ ์•„๋‹ˆ๋ผ๋ฉด postman(https://www.postman.com/) ์„ค์น˜ํ•˜์—ฌ, URL ํ…Œ์ŠคํŠธํ•˜๋ฉด ํŽธ๋ฆฌํ•ฉ๋‹ˆ๋‹ค.

  • ๊ณ„์ • ๋ฆฌ์ŠคํŠธ ์กฐํšŒ

  - URL : localhost:{port}/api/members
  - http request method : GET
  • ๊ณ„์ • ์กฐํšŒ
  - URL : localhost:{port}/api/members
  - http request method : GET
  - form-data
    - key value ํ˜•ํƒœ
    - name : {๊ฐ’}  
  • ๊ณ„์ • ์ƒ์„ฑ
  - URL : localhost:{port}/api/members/create
  - http request method : POST
  - form-data
    - key value ํ˜•ํƒœ
    - name : {๊ฐ’}, pw : {๊ฐ’}

์šด์˜ ์‹œ ํ•„์š”ํ•œ ๊ฐ€์ด๋“œ

  1. HTTP API Connection / SQL ๋ฐ ๊ฒฐ๊ณผ ํ™•์ธ
  • ํ•ด๋‹น ์„œ๋น„์Šค๋Š” Web(Client) ํ™˜๊ฒฝ์—์„œ Thrift๋ฅผ ํ†ตํ•œ ๋‚ด์šฉ์ž…๋‹ˆ๋‹ค. (html/javascript ๊ตฌํ˜„)
  1) Basic Query
  - frontend/src/js ํด๋”์˜ browser-connector.js import ํ•˜์—ฌ ์‚ฌ์šฉ
  - Input Value : String (SQL๋ฌธ)
  - Out Value : SQL๋ฌธ ๊ฒฐ๊ณผ์— ๋Œ€ํ•œ Json Data
  
  * MapdCon ๊ฐ์ฒด๋ฅผ ์ด์šฉํ•œ ์ ‘์† ๋ฐ SQL ํ…Œ์ŠคํŠธ
  
    new MapdCon() // API์„œ๋ฒ„ ์ ‘์†
        .host("fbg01")
        .port("4762") 
        .dbName("default") 
        .user("ltdb")
        .password("ltdb")
        .connectAsync()
        .then(function (connector) { // ์ปค๋„ฅ์…˜ ๊ฐ์ฒด
            
            var query = "select max(event_time) from ltdb_fp_history where table_name='ltdb_fp'"; // SQL๋ฌธ ์ž‘์„ฑ
            connector.queryAsync(query, {columnarResults: false}).then(function (result) { // ์ปค๋„ฅ์…˜ ๊ฐ์ฒด๋ฅผ ์ด์šฉํ•œ SQL ์š”์ฒญ
               console.log(result); // ๊ฒฐ๊ณผ ๊ฐ’
            });
        })  
        

  2) Vector tile Query
  * mapbox-gl api ์ˆ™์ง€ ํ•„์š”
  - ๊ด€๋ จ ๋ผ์ด๋ธŒ๋Ÿฌ๋ฆฌ Import ํ•„์š”
    - frontend/src/js ํด๋”์˜ mapbox-gl.js import ํ•˜์—ฌ ์‚ฌ์šฉ
    - frontend/external ๋˜๋Š” frontend/build/static/js ํด๋”์˜ global-mercator.js, pako.js, vectortile-utils.js import ํ•˜์—ฌ ์‚ฌ์šฉ
    
  //mapboxgl ์‚ฌ์šฉํ•˜๊ธฐ ์œ„ํ•œ ํ† ํฐ ํ•„์š”
  mapboxgl.accessToken = {ํ† ํฐ๊ฐ’(String)}; //'pk.eyJ1IjoibGVlc2giLCJhIjoiY0thWXdQbyJ9.fPGnL5s0k8ptNPY7P1S1aA';
  
  //API์„œ๋ฒ„์— Tile ์š”์ฒญ ์‹œ ์‚ฌ์šฉํ•  ํฌํŠธ๋ฐฐ์—ด ํ•„์š”.
  var ports = [4762, 4763, 4764, 4765, 4766, 4767, 4768, 4769, 4770, 4771, 4772, 4773];
  
  //Map ๊ฐ์ฒด ์ƒ์„ฑ
  var map = new mapboxgl.Map({
            container: {html div id},
            hash: true,
            style: {
                'version': 8,
                'sources': {
                    'raster-tiles': {
                        'type': 'raster',
                        'tiles': [
                            'http://a.basemaps.cartocdn.com/light_all/{z}/{x}/{y}.png'
                        ],
                        'tileSize': 256
                    }
                },
                'layers': [{
                    'id': 'base-map',
                    'type': 'raster',
                    'source': 'raster-tiles',
                    'minzoom': 0,
                    'maxzoom': 22
                }]
            },
            center: [127, 37.55], //126.986, 37.565
            zoom: 11,
            maxZoom: 16,
            minZoom: 8.5,
            tilesFunctionParams: function (tile) { // ์ปค์Šคํ…€ ํ•จ์ˆ˜ : tile ์š”์ฒญ ์‹œ ์—ฌ๋Ÿฌ port๋กœ ์š”์ฒญํ•˜๊ธฐ ์œ„ํ•œ ์„ค์ •
                const port = ports.shift();
                ports.push(port);
    
                return {
                    host: config.host,
                    port: port,
                    eventTime1: null,
                    eventTime2: null
                }
            }            
            //interactive: false
   });  
   
   //Map load ๋ฐ ํ•„์š” ๋ผ์ด๋ธŒ๋Ÿฌ๋ฆฌ ๊ฐ€์ ธ์˜ค๊ธฐ
   //Vector layer ์ƒ์„ฑ
   map.on('load', function() {
      map.style.dispatcher.broadcast('loadWorkerSource', { //broadcast๋ฅผ ์ด์šฉํ•œ ๋ผ์ด๋ธŒ๋Ÿฌ๋ฆฌ import
          name: "pako",
          url: `http://${window.location.host}/static/js/pako.js`
      }, function (e) {
          if (e) {
              console.log(e);
          }
      });   
      
      map.style.dispatcher.broadcast('loadWorkerSource', {
          name: "global-mercator",
          url: `http://${window.location.host}/static/js/global-mercator.js`
      }, function (e) {
          if (e) {
              console.log(e);
          }
      });  
      
      map.style.dispatcher.broadcast('loadWorkerSource', {
          name: "vectortile-utils",
          url: `http://${window.location.host}/static/js/vectortile-utils.js`
      }, function (e) {
          if (e) {
              console.log(e);
          }
      });      
      
      //Vector Source ์ƒ์„ฑ
      //renderSqlPost ํ•จ์ˆ˜ : SQL๋ฌธ ํ•˜๋‚˜๋งŒ ์š”์ฒญํ•˜์—ฌ ๊ฒฐ๊ณผ๊ฐ’ ๋ฆฌํ„ด ( ex)ํ˜„์žฌ ์œ ๋™์ธ๊ตฌ ํ‘œํ˜„ ์‹œ ์‚ฌ์šฉ )
      map.addSource('vector-tile', {
          type: 'vector',
          tilesFunction: `function (tile) { // ์ปค์Šคํ…€ ํ•จ์ˆ˜
                  var host = tile.tilesFunctionParams.host;
                  var port = tile.tilesFunctionParams.port;  

                  var sql = ""; //๋ฐ์ดํ„ฐ๋ฅผ ๊ฐ€์ ธ์˜ฌ Query๋ฌธ ์ž‘์„ฑ
                  var typeName = "ltdb_fp";
                  var aggrType = "sum";
                  var multiple = false;
                  return renderSqlPost(host, port, tile, sql, typeName, aggrType, multiple, null);
              }`,
          minzoom: 0,
          maxzoom: 16.1
      });      
      
      //์ฆ๊ฐ ์œ ๋™์ธ๊ตฌ ๋ฐ์ดํ„ฐ ๊ฐ€์ ธ์˜ฌ ๋•Œ ์‚ฌ์šฉํ•˜๋Š” ํ•จ์ˆ˜
      * ํ•˜๋‚˜์˜ ์˜ˆ์ด๋ฏ€๋กœ ๊ฐ™์€ map๊ฐ์ฒด ์‚ฌ์šฉ.
      //renderSqlDiffPost ํ•จ์ˆ˜ : SQL๋ฌธ 2๊ฐ€์ง€ ์š”์ฒญํ•˜์—ฌ subtractํ•œ ๊ฒฐ๊ณผ๊ฐ’ ๋ฆฌํ„ด ( ex)์ฆ๊ฐ ์œ ๋™์ธ๊ตฌ ํ‘œํ˜„ ์‹œ ์‚ฌ์šฉ )
      map.addSource('vector-tile', {
          type: 'vector',
          tilesFunction: `function (tile) { // ์ปค์Šคํ…€ ํ•จ์ˆ˜
                  var host = tile.tilesFunctionParams.host;
                  var port = tile.tilesFunctionParams.port;  
                  
                  //์ปฌ๋Ÿผ ๋ณ„ subtract์€ sql1 - sql2 
                  var sql1 = ""; //๊ธฐ์ค€ ๋ฐ์ดํ„ฐ๋ฅผ ๊ฐ€์ ธ์˜ฌ Query๋ฌธ ์ž‘์„ฑ
                  var sql2 = ""; //๋น„๊ต ๋ฐ์ดํ„ฐ๋ฅผ ๊ฐ€์ ธ์˜ฌ Query๋ฌธ ์ž‘์„ฑ
                  var typeName = "ltdb_fp";
                  var aggrType = "sum";
                  var multiple = false;
                  return renderSqlDiffPost(host, port, tile, sql1, sql2, typeName, aggrType, multiple, null);
              }`,
          minzoom: 0,
          maxzoom: 16.1
      });          
      
      //Vector Layer ์ƒ์„ฑ
      map.addLayer({...});
   
   });
  1. ๊ตฌํ˜„๋œ Source์˜ HTTP API Service ์‚ฌ์šฉ ํ™•์ธ
  • ์บ˜๋ฆฐ๋” ๊ด€๋ จํ•˜์—ฌ, ltdb_fp_history ํ…Œ์ด๋ธ”์˜ ์ตœ์‹  ๋‚ ์งœ Query
  - ์†Œ์Šค ๊ฒฝ๋กœ : frontend/src/component/MenuComponent.jsx
  - 69๋ฒˆ์งธ ๋ผ์ธ ํ™•์ธ
  - ์‚ฌ์šฉ SQL 
    - "select max(event_time) from ltdb_fp_history where table_name='ltdb_fp' limit 1"
  • Vector Tile Query
  - ์†Œ์Šค ๊ฒฝ๋กœ : frontend/src/component/MenuComponent.jsx
  
  1) 92๋ฒˆ์งธ ๋ผ์ธ ํ™•์ธ
  - ์‚ฌ์šฉ SQL 
    - "SELECT (exist_m_00 + exist_m_10 + exist_m_20 + exist_m_30 + exist_m_40 + exist_m_50 + exist_m_60 + exist_m_70 + exist_m_80 + exist_m_90 + exist_f_00 + exist_f_10 + exist_f_20 + exist_f_30 + exist_f_40 + exist_f_50 + exist_f_60 + exist_f_70 + exist_f_80 + exist_f_90) as exist, geometry FROM ltdb_fp WHERE event_time = '${currPrevDateString.curr}'"
  
  2) 192๋ฒˆ์งธ ๋ผ์ธ ํ™•์ธ
    - "SELECT (exist_m_00 + exist_m_10 + exist_m_20 + exist_m_30 + exist_m_40 + exist_m_50 + exist_m_60 + exist_m_70 + exist_m_80 + exist_m_90 + exist_f_00 + exist_f_10 + exist_f_20 + exist_f_30 + exist_f_40 + exist_f_50 + exist_f_60 + exist_f_70 + exist_f_80 + exist_f_90) as exist, geometry FROM ltdb_fp WHERE event_time = '${currPrevDateString.curr}'"; //ํ˜„์žฌ ๋‚ ์งœ
    - "SELECT (exist_m_00 + exist_m_10 + exist_m_20 + exist_m_30 + exist_m_40 + exist_m_50 + exist_m_60 + exist_m_70 + exist_m_80 + exist_m_90 + exist_f_00 + exist_f_10 + exist_f_20 + exist_f_30 + exist_f_40 + exist_f_50 + exist_f_60 + exist_f_70 + exist_f_80 + exist_f_90) as exist, geometry FROM ltdb_fp WHERE event_time = '${currPrevDateString.prev}'"; //์ด์ „ ๋‚ ์งœ

  • Chart Query
  - ์†Œ์Šค ๊ฒฝ๋กœ : frontend/src/service/CustomFunc.jsx
  
  1) ๋ง‰๋Œ€์ฐจํŠธ - ํ˜„์žฌ๋‚ ์งœ ๋ฐ์ดํ„ฐ ๊ฐ€์ ธ์˜ค๊ธฐ. 329๋ฒˆ์งธ ๋ผ์ธ ํ™•์ธ
    - `SELECT
          (sum(exist_m_00) + sum(exist_m_10)) as exist_m_10, sum(exist_m_20) as exist_m_20, sum(exist_m_30) as exist_m_30,
          sum(exist_m_40) as exist_m_40, sum(exist_m_50) as exist_m_50, (sum(exist_m_60) + sum(exist_m_70) +
          sum(exist_m_80) + sum(exist_m_90)) as exist_m_60,
          (sum(exist_f_00) + sum(exist_f_10)) as exist_f_10, sum(exist_f_20) as exist_f_20, sum(exist_f_30) as exist_f_30,
          sum(exist_f_40) as exist_f_40, sum(exist_f_50) as exist_f_50, (sum(exist_f_60) + sum(exist_f_70) +
          sum(exist_f_80) + sum(exist_f_90)) as exist_f_60, event_time        
      FROM ltdb_fp    
      WHERE ST_CONTAINS(ST_GEOMFROMTEXT('${wkt}'), geometry) AND event_time = '${eventTime1}'
      GROUP BY event_time ORDER BY event_time`
      
   1) ๋ผ์ธ์ฐจํŠธ - 24์‹œ๊ฐ„ ๊ธฐ์ค€ ์‹œ๊ฐ„ ๋ณ„ ๋ฐ์ดํ„ฐ ๊ฐ€์ ธ์˜ค๊ธฐ. 341๋ฒˆ์งธ ๋ผ์ธ ํ™•์ธ   
     - `SELECT
          (sum(exist_m_00) + sum(exist_m_10)) as exist_m_10, sum(exist_m_20) as exist_m_20, sum(exist_m_30) as exist_m_30,
          sum(exist_m_40) as exist_m_40, sum(exist_m_50) as exist_m_50, (sum(exist_m_60) + sum(exist_m_70) +
          sum(exist_m_80) + sum(exist_m_90)) as exist_m_60,
          (sum(exist_f_00) + sum(exist_f_10)) as exist_f_10, sum(exist_f_20) as exist_f_20, sum(exist_f_30) as exist_f_30,
          sum(exist_f_40) as exist_f_40, sum(exist_f_50) as exist_f_50, (sum(exist_f_60) + sum(exist_f_70) +
          sum(exist_f_80) + sum(exist_f_90)) as exist_f_60,
          substring(event_time, 0, ${eventTimeFormat.length - 2}) as event_time
      FROM ltdb_fp
      WHERE ST_CONTAINS(ST_GEOMFROMTEXT('${wkt}'), geometry) AND event_time IN(${QueryTimeArray.toString()})  GROUP BY event_time ORDER BY event_time`;

About

Visualization of the floating population

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 2

  •  
  •  

Languages