├── Anonymization ├── README.md ├── config.json ├── docs │ ├── anony1.png │ ├── anony2.png │ └── anony3.png ├── input │ └── sample_cdr_2018.csv ├── lib │ └── CsvAnonymization-0.0.1.jar ├── output │ └── sample_cdr_2018.csv ├── run.bat ├── run.sh ├── salt.txt └── sample_cdr_2018.csv ├── Common └── README.md ├── InfrastructureUpdates ├── 1_run_osm2po.bat ├── 1_run_osm2po.sh ├── 2_osm_assessment.bat ├── 2_osm_assessment.sh ├── 3_create_building_poi_table.bat ├── 3_create_building_poi_table.sh ├── PFlowLibFull-0.1.1.jar ├── README.md ├── osm2po-core-5.0.0-signed.jar ├── osm2po-plugins │ ├── osm2po-plugins-5.0.0.jar │ └── osm2po-sd-5.0.0.jar ├── osm2po.config └── sample │ ├── 1_run_osm2po.bat │ ├── 2_osm_assessment.bat │ └── 3_create_building_poi_table.bat ├── Interpolation ├── README.md ├── docs │ ├── cdr_info.jpg │ ├── interpolation_info.jpg │ └── interpolation_step.jpg ├── exportformobmap.bat ├── id.csv ├── lib │ ├── PFlowLibFull-0.1.1.jar │ ├── cdrmobilitylib.jar │ ├── cdrmobilitylibge.jar │ ├── cdrmobilitylibjica.jar │ ├── cdrworkspace-0.0.1.jar │ ├── hadoop-common-2.2.0.jar │ ├── hive-exec-0.13.1.jar │ ├── javaml-0.1.6.jar │ └── tools.jar ├── routeinterpolation.bat ├── staypointreallocation.bat └── tripsegmentation.bat ├── LICENSE ├── README.md └── Visualization ├── MobMapNativeWin ├── MobMapNativeWin │ ├── MobmapNativeWin.exe │ ├── SDL.dll │ ├── SDL_image.dll │ ├── assets │ │ ├── clock-tex.png │ │ ├── mk-color-spot - ใ‚ณใƒ”ใƒผ.json │ │ ├── mk-color-spot - ใ‚ณใƒ”ใƒผ.png │ │ ├── mk-color-spot.json │ │ ├── mk-color-spot.png │ │ ├── mk-red-strong-spot.json │ │ ├── mk-red-strong-spot.png │ │ ├── mk-strong-spot.json │ │ └── mk-strong-spot.png │ ├── dataset │ │ ├── gps.csv │ │ ├── mobmap.csv │ │ └── sample.csv │ ├── glut32.dll │ ├── libjpeg-8.dll │ ├── libpng15-15.dll │ ├── libtiff-5.dll │ ├── libwebp-2.dll │ ├── out │ │ └── frames │ │ │ ├── 0352.png │ │ │ ├── 0353.png │ │ │ ├── 0354.png │ │ │ ├── 0355.png │ │ │ ├── 0356.png │ │ │ ├── 0357.png │ │ │ ├── 0358.png │ │ │ ├── 0359.png │ │ │ ├── 0360.png │ │ │ ├── 0361.png │ │ │ ├── 0362.png │ │ │ ├── 0363.png │ │ │ └── 0364.png │ ├── presets │ │ └── sample.json │ ├── scripts │ │ ├── fetchBaseMap.rb │ │ └── fetchBaseMap_bk20191003.rb │ ├── temp │ │ ├── basemap.json │ │ ├── basemap.png │ │ ├── t1.png │ │ ├── t2.png │ │ ├── t3.png │ │ └── t4.png │ └── zlib1.dll ├── README.md ├── SampleOutput │ ├── frames │ │ ├── 0352.png │ │ ├── 0353.png │ │ ├── 0354.png │ │ ├── 0355.png │ │ ├── 0356.png │ │ ├── 0357.png │ │ ├── 0358.png │ │ ├── 0359.png │ │ ├── 0360.png │ │ ├── 0361.png │ │ ├── 0362.png │ │ ├── 0363.png │ │ └── 0364.png │ └── result.mp4 ├── ffmpeg │ ├── README.txt │ ├── bin │ │ ├── ffmpeg.exe │ │ ├── ffplay.exe │ │ └── ffprobe.exe │ ├── doc │ │ ├── developer.html │ │ ├── examples │ │ │ ├── Makefile │ │ │ ├── README │ │ │ ├── decoding_encoding.c │ │ │ ├── demuxing.c │ │ │ ├── filtering_audio.c │ │ │ ├── filtering_video.c │ │ │ ├── metadata.c │ │ │ ├── muxing.c │ │ │ ├── resampling_audio.c │ │ │ └── scaling_video.c │ │ ├── faq.html │ │ ├── fate.html │ │ ├── ffmpeg-all.html │ │ ├── ffmpeg-bitstream-filters.html │ │ ├── ffmpeg-codecs.html │ │ ├── ffmpeg-devices.html │ │ ├── ffmpeg-filters.html │ │ ├── ffmpeg-formats.html │ │ ├── ffmpeg-protocols.html │ │ ├── ffmpeg-resampler.html │ │ ├── ffmpeg-scaler.html │ │ ├── ffmpeg-utils.html │ │ ├── ffmpeg.html │ │ ├── ffplay-all.html │ │ ├── ffplay.html │ │ ├── ffprobe-all.html │ │ ├── ffprobe.html │ │ ├── general.html │ │ ├── git-howto.html │ │ ├── libavcodec.html │ │ ├── libavdevice.html │ │ ├── libavfilter.html │ │ ├── libavformat.html │ │ ├── libavutil.html │ │ ├── libswresample.html │ │ ├── libswscale.html │ │ ├── nut.html │ │ └── platform.html │ ├── formats.txt │ ├── licenses │ │ ├── bzip2.txt │ │ ├── fontconfig.txt │ │ ├── freetype.txt │ │ ├── frei0r.txt │ │ ├── gnutls.txt │ │ ├── lame.txt │ │ ├── libass.txt │ │ ├── libbluray.txt │ │ ├── libcaca.txt │ │ ├── libgsm.txt │ │ ├── libiconv.txt │ │ ├── libilbc.txt │ │ ├── libmodplug.txt │ │ ├── libtheora.txt │ │ ├── libvorbis.txt │ │ ├── libvpx.txt │ │ ├── opencore-amr.txt │ │ ├── openjpeg.txt │ │ ├── opus.txt │ │ ├── rtmpdump.txt │ │ ├── schroedinger.txt │ │ ├── soxr.txt │ │ ├── speex.txt │ │ ├── twolame.txt │ │ ├── vo-aacenc.txt │ │ ├── vo-amrwbenc.txt │ │ ├── x264.txt │ │ ├── xavs.txt │ │ ├── xvid.txt │ │ └── zlib.txt │ └── presets │ │ ├── ffprobe.xsd │ │ ├── libvpx-1080p.ffpreset │ │ ├── libvpx-1080p50_60.ffpreset │ │ ├── libvpx-360p.ffpreset │ │ ├── libvpx-720p.ffpreset │ │ ├── libvpx-720p50_60.ffpreset │ │ ├── libx264-ipod320.ffpreset │ │ └── libx264-ipod640.ffpreset └── run.bat ├── MobmapWeb ├── MMSampleDataMod.csv ├── MobmapTutorial.pdf ├── README.md └── docs │ ├── csvformat.JPG │ ├── mobmap.JPG │ └── mobmap.png └── README.md /Anonymization/README.md: -------------------------------------------------------------------------------- 1 | # Anonymization Tool 2 | A tool for Anonymizing identifiable value in Data such as IMEI,IMSI, Mobile No. It is Java application which can be run in any operating system and also support running anonymization with multi-thread to speed up the process. Using a machine with a GPU will make encoding faster. 3 | 4 | 5 | ![Screenshot](docs/anony1.png) 6 | 7 | **Example of data after anonymization** 8 | ![Screenshot](docs/anony2.png) 9 | 10 | 11 | ## How it works 12 | In principle, program receive raw CDR data in CSV as an input. Then it will start anonymization using algorithm “SHA256” with “Salt file” which need to be same for all MNO. “Salt file” is a complementary text to enhance security. The program works in Multithread to make the encoding faster. 13 | ![Screenshot](docs/anony3.png) 14 | 15 | 16 | 17 | ## Prerequisites 18 | Java JDK 8 or higher 19 | 20 | ## Usage 21 | 22 | 1. Put input data in input folder 23 | 2. Modify data format in config.json 24 | 3. Run command 25 | 26 | **For Windows**, navigate to software directory and run command "run.bat" 27 | ``` 28 | java -classpath .;lib/* jp.utokyo.shibalab.csvanonymization.AnonymizationMain config.json 29 | ``` 30 | **For Unix-based OS (Linux, Mac)**, open terminal navigate to software directory and run command "run.sh" 31 | ``` 32 | java -classpath .:lib/* jp.utokyo.shibalab.csvanonymization.AnonymizationMain config.json 33 | ``` 34 | 35 | ## Configuration (config.json) 36 | ``` 37 | { 38 | "name":"configuration File for ARPT", 39 | "threadNum":4, 40 | "seedPath":"./salt.txt", 41 | "streachNum":10, 42 | 43 | "inputDirPath" :"./input", 44 | "inputHeader":"true", 45 | "inputDelim":",", 46 | 47 | "outputDirPath":"./output", 48 | "outputHeader":"false", 49 | "outputDelim":",", 50 | 51 | "layout":[ 52 | {"inputNo":1, "outputNo":1, "name":"IMEI_Caller", "anonymize":"true"}, 53 | {"inputNo":2, "outputNo":2, "name":"IMSI_Caller", "anonymize":"true"}, 54 | {"inputNo":3, "outputNo":3, "name":"Call_Start", "anonymize":"false"}, 55 | {"inputNo":4, "outputNo":4, "name":"Call_Duration", "anonymize":"false"}, 56 | {"inputNo":5, "outputNo":5, "name":"LAC_Caller", "anonymize":"false"}, 57 | {"inputNo":6, "outputNo":6, "name":"CELL_ID_Celler", "anonymize":"false"}, 58 | {"inputNo":7, "outputNo":7, "name":"Activity_Type", "anonymize":"false"} 59 | ] 60 | } 61 | 62 | ``` 63 | 64 | ## Author 65 | **Hiroshi KANASUGI** : A project researcher at Center for Spatial Information Science, University of Tokyo. 66 | 67 | ## License 68 | 69 | Free to use 70 | 71 | ## Acknowledgments 72 | 73 | * [Spatial Data Commons](http://sdc.csis.u-tokyo.ac.jp/), CSIS, The University of Tokyo 74 | * [Shibasaki Lab](https://shiba.iis.u-tokyo.ac.jp), The University of Tokyo 75 | * [Center for Spatial Information Science](http://www.csis.u-tokyo.ac.jp/en/), The University of Tokyo 76 | 77 | -------------------------------------------------------------------------------- /Anonymization/config.json: -------------------------------------------------------------------------------- 1 | { 2 | "name":"configuration File for ARPT", 3 | "threadNum":4, 4 | "seedPath":"./salt.txt", 5 | "streachNum":10, 6 | 7 | "inputDirPath" :"./input", 8 | "inputHeader":"true", 9 | "inputDelim":",", 10 | 11 | "outputDirPath":"./output", 12 | "outputHeader":"false", 13 | "outputDelim":",", 14 | 15 | "layout":[ 16 | {"inputNo":1, "outputNo":1, "name":"IMEI_Caller", "anonymize":"true"}, 17 | {"inputNo":2, "outputNo":2, "name":"IMSI_Caller", "anonymize":"true"}, 18 | {"inputNo":3, "outputNo":3, "name":"Call_Start", "anonymize":"false"}, 19 | {"inputNo":4, "outputNo":4, "name":"Call_Duration", "anonymize":"false"}, 20 | {"inputNo":5, "outputNo":5, "name":"LAC_Caller", "anonymize":"false"}, 21 | {"inputNo":6, "outputNo":6, "name":"CELL_ID_Celler", "anonymize":"false"}, 22 | {"inputNo":7, "outputNo":7, "name":"Activity_Type", "anonymize":"false"} 23 | ] 24 | } 25 | 26 | 27 | 28 | -------------------------------------------------------------------------------- /Anonymization/docs/anony1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SpatialDataCommons/CDR-analysis-tools-std/68862be38af4bf21ef004683c9d16bb971068b0c/Anonymization/docs/anony1.png -------------------------------------------------------------------------------- /Anonymization/docs/anony2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SpatialDataCommons/CDR-analysis-tools-std/68862be38af4bf21ef004683c9d16bb971068b0c/Anonymization/docs/anony2.png -------------------------------------------------------------------------------- /Anonymization/docs/anony3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SpatialDataCommons/CDR-analysis-tools-std/68862be38af4bf21ef004683c9d16bb971068b0c/Anonymization/docs/anony3.png -------------------------------------------------------------------------------- /Anonymization/input/sample_cdr_2018.csv: -------------------------------------------------------------------------------- 1 | IMEI_Caller,IMSI_Caller,Call_Start,Call_Duration,LAC_Caller,CELL_ID_Celler,Activity_Type 2 | 123456,654321,2016-03-16 11:58:11,120,1103,456789,Voice 3 | 123456,654321,2016-03-16 13:58:11,120,1203,456789,Voice 4 | 123456,654321,2016-03-16 20:58:11,120,1213,456789,Voice 5 | -------------------------------------------------------------------------------- /Anonymization/lib/CsvAnonymization-0.0.1.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SpatialDataCommons/CDR-analysis-tools-std/68862be38af4bf21ef004683c9d16bb971068b0c/Anonymization/lib/CsvAnonymization-0.0.1.jar -------------------------------------------------------------------------------- /Anonymization/output/sample_cdr_2018.csv: -------------------------------------------------------------------------------- 1 | 498a34a948e2f891bd4060bec38413251ad06b07d06c7fcc59d84972f72b5d4d,96b9eb5b0f7697db463bf93473240bf9eb466353cb2ac9d7022c5df26ed8ccdf,2016-03-16 11:58:11,120,1103,456789,Voice 2 | 498a34a948e2f891bd4060bec38413251ad06b07d06c7fcc59d84972f72b5d4d,96b9eb5b0f7697db463bf93473240bf9eb466353cb2ac9d7022c5df26ed8ccdf,2016-03-16 13:58:11,120,1203,456789,Voice 3 | 498a34a948e2f891bd4060bec38413251ad06b07d06c7fcc59d84972f72b5d4d,96b9eb5b0f7697db463bf93473240bf9eb466353cb2ac9d7022c5df26ed8ccdf,2016-03-16 20:58:11,120,1213,456789,Voice 4 | -------------------------------------------------------------------------------- /Anonymization/run.bat: -------------------------------------------------------------------------------- 1 | @echo off 2 | 3 | java -classpath .;lib/* jp.utokyo.shibalab.csvanonymization.AnonymizationMain config.json 4 | 5 | -------------------------------------------------------------------------------- /Anonymization/run.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | java -classpath .:lib/* jp.utokyo.shibalab.csvanonymization.AnonymizationMain config.json 4 | 5 | -------------------------------------------------------------------------------- /Anonymization/salt.txt: -------------------------------------------------------------------------------- 1 | N!a'j#eDD@alFBaa<=TQqcHV*McJYv dump\sql\%OSM_SCHEMA%.osm_road.sql 59 | 60 | :: extract road data as shape data 61 | mkdir dump\shape\shp_osm_road 62 | pgsql2shp -P %PGPASSWORD% -u %PG_ID% -h %PG_HOST% -p %PG_PORT% -f dump\shape\shp_osm_road\%OSM_SCHEMA%_osm_road.shp %PG_DB% %OSM_SCHEMA%.osm_road 63 | 64 | -------------------------------------------------------------------------------- /InfrastructureUpdates/1_run_osm2po.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | ## :::::::::::::::::::::::::::::::::::::::::::::::::::::::: 4 | ## OSM data conversion with OSM2PO (http://osm2po.de/) 5 | ## :::::::::::::::::::::::::::::::::::::::::::::::::::::::: 6 | PG_ID=**YOUR_USER** 7 | PGPASSWORD=**YOUR_PASSWORD** 8 | PG_DB=**YOUR_DB_NAME** 9 | PG_HOST=localhost 10 | PG_PORT=5432 11 | OSM_SCHEMA=srilanka 12 | TEMP_DIR=/tmp 13 | 14 | 15 | ## :::::::::::::::::::::::::::::::::::::::::::::::::::::::: 16 | ## run osm2po to convert OSM pbf data into SQL 17 | ## * need to respond license agreement firstly. 18 | ## * when customizing conversion setting, modify file osm2po.config 19 | ## :::::::::::::::::::::::::::::::::::::::::::::::::::::::: 20 | java -Xmx5G -jar osm2po-core-5.0.0-signed.jar cmd=tjsp prefix=${OSM_SCHEMA} ${OSM_SCHEMA}-latest.osm.pbf 21 | 22 | 23 | ## :::::::::::::::::::::::::::::::::::::::::::::::::::::::: 24 | ## create raw network table 25 | ## :::::::::::::::::::::::::::::::::::::::::::::::::::::::: 26 | psql -U ${PG_ID} -d ${PG_DB} -h ${PG_HOST} -p ${PG_PORT} -q -c "create schema ${OSM_SCHEMA}" 27 | psql -U ${PG_ID} -d ${PG_DB} -h ${PG_HOST} -p ${PG_PORT} -q -c "drop table if exists ${OSM_SCHEMA}.osm_road" 28 | psql -U ${PG_ID} -d ${PG_DB} -h ${PG_HOST} -p ${PG_PORT} -q -f ${OSM_SCHEMA}/${OSM_SCHEMA}_2po_4pgr.sql 29 | psql -U ${PG_ID} -d ${PG_DB} -h ${PG_HOST} -p ${PG_PORT} -q -c "alter table ${OSM_SCHEMA}_2po_4pgr rename to osm_road" 30 | psql -U ${PG_ID} -d ${PG_DB} -h ${PG_HOST} -p ${PG_PORT} -q -c "alter table osm_road set schema ${OSM_SCHEMA}" 31 | 32 | psql -U ${PG_ID} -d ${PG_DB} -h ${PG_HOST} -p ${PG_PORT} -q -c "create index idx_${OSM_SCHEMA}_osm_road_source on ${OSM_SCHEMA}.osm_road using btree(source)" 33 | psql -U ${PG_ID} -d ${PG_DB} -h ${PG_HOST} -p ${PG_PORT} -q -c "create index idx_${OSM_SCHEMA}_osm_road_target on ${OSM_SCHEMA}.osm_road using btree(target)" 34 | psql -U ${PG_ID} -d ${PG_DB} -h ${PG_HOST} -p ${PG_PORT} -q -c "create index idx_${OSM_SCHEMA}_osm_road_geom_way on ${OSM_SCHEMA}.osm_road using Gist(geom_way)" 35 | 36 | psql -U ${PG_ID} -d ${PG_DB} -h ${PG_HOST} -p ${PG_PORT} -q -c "select count(*) as N,sum(ST_length(Geography(geom_way))/1000.0) as km from ${OSM_SCHEMA}.osm_road" 37 | 38 | 39 | ## :::::::::::::::::::::::::::::::::::::::::::::::::::::::: 40 | ## dump data 41 | ## :::::::::::::::::::::::::::::::::::::::::::::::::::::::: 42 | ## export road data as tsv File 43 | mkdir -p dump/tsv 44 | psql -d ${PG_DB} -h ${PG_HOST} -p ${PG_PORT} -q -c "copy ${OSM_SCHEMA}.osm_road to '${TEMP_DIR}/${OSM_SCHEMA}.osm_road.tsv' (delimiter E'\t',format csv,encoding 'UTF-8',header true)" 45 | cp ${TEMP_DIR}/${OSM_SCHEMA}.osm_road.tsv ./dump/tsv/ 46 | 47 | ## dump road data as sql File 48 | mkdir -p dump/sql 49 | pg_dump -d ${PG_DB} -h ${PG_HOST} -p ${PG_PORT} -t ${OSM_SCHEMA}.osm_road > dump/sql/${OSM_SCHEMA}.osm_road.sql 50 | 51 | ## extract road data as shape data 52 | mkdir -p dump/shape/shp_osm_road 53 | pgsql2shp -h ${PG_HOST} -p ${PG_PORT} -f dump/shape/shp_osm_road/${OSM_SCHEMA}_osm_road.shp ${PG_DB} ${OSM_SCHEMA}.osm_road 54 | 55 | -------------------------------------------------------------------------------- /InfrastructureUpdates/2_osm_assessment.bat: -------------------------------------------------------------------------------- 1 | @echo off 2 | 3 | :: :::::::::::::::::::::::::::::::::::::::::::::::::::::::: 4 | :: OSM data assessment by creating network groups 5 | :: ::::::::::::::::::::::::::::::::::::::::::::::::::::::::s 6 | :: [set parameters] 7 | :: some parameters have to be set according to own environment 8 | :: :::::::::::::::::::::::::::::::::::::::::::::::::::::::: 9 | :: parameters for PostgreSQL access 10 | set PG_ID=**YOUR_USER** 11 | set PGPASSWORD=**YOUR_PASSWORD** 12 | set PG_DB=**YOUR_DB_NAME** 13 | set PG_HOST=localhost 14 | set PG_PORT=5432 15 | set TEMP_DIR=%TEMP% 16 | set PG_BIN_PATH=D:\PostgreSQL\9.6\bin 17 | set PATH=%PATH%;%PG_BIN_PATH% 18 | 19 | :: set tablee naems 20 | set OSM_SCHEMA=**OSM_COUNTRY_ANME** 21 | set OSM_ORG_TABLE=%OSM_SCHEMA%.osm_road 22 | set OSM_CHK_TABLE=%OSM_SCHEMA%.osm_road_assessment 23 | set OSM_VLD_LINK_TABLE=%OSM_SCHEMA%.osm_road_available 24 | set OSM_VLD_NODE_TABLE=%OSM_SCHEMA%.osm_node_available 25 | 26 | :: set assessment parameters 27 | set NUM_THRESHOLD=100 28 | :: JV_CLS=jp.ac.ut.csis.pflow.routing2.example.NetworkAssessmentOsm 29 | set JV_CLS2=jp.ac.ut.csis.pflow.routing4.sample.OsmNetworkAssessment 30 | set NETWORK_TSV=dump\tsv\%OSM_SCHEMA%.osm_road.tsv 31 | set OUTFILE=%OSM_SCHEMA%.osm_road_assessment.tsv 32 | 33 | :: :::::::::::::::::::::::::::::::::::::::::::::::::::::::: 34 | :: run assessment 35 | :: :::::::::::::::::::::::::::::::::::::::::::::::::::::::: 36 | echo "start network assessment ... " 37 | 38 | java -Xmx8G -cp PFlowLibFull-0.1.1.jar %JV_CLS2% %NETWORK_TSV% %OUTFILE% 39 | 40 | echo "network assessment done" 41 | 42 | :: mv output file to temporary folder 43 | move %OUTFILE% %TEMP_DIR%\ 44 | 45 | 46 | :: :::::::::::::::::::::::::::::::::::::::::::::::::::::::: 47 | :: conduct network assessment 48 | :: ======================================================== 49 | :: -- table schema of assessment result 50 | :: create table %OSM_SCHEMA%.osm_road_assessment ( 51 | :: groupno int4, 52 | :: nodeid int4, 53 | :: num int4, 54 | :: geom geometry(POINT,4326) 55 | :: ); 56 | :: :::::::::::::::::::::::::::::::::::::::::::::::::::::::: 57 | psql -U %PG_ID% -d %PG_DB% -h %PG_HOST% -p %PG_PORT% -q -c "drop table if exists %OSM_CHK_TABLE%" 58 | psql -U %PG_ID% -d %PG_DB% -h %PG_HOST% -p %PG_PORT% -q -c "create table %OSM_CHK_TABLE% (groupno int4,nodeid int4,num int4,geom geometry(POINT,4326))" 59 | psql -U %PG_ID% -d %PG_DB% -h %PG_HOST% -p %PG_PORT% -q -c "create index idx_%OSM_SCHEMA%_osm_road_assessment_geom on %OSM_CHK_TABLE% using Gist(geom)" 60 | psql -U %PG_ID% -d %PG_DB% -h %PG_HOST% -p %PG_PORT% -q -c "create index idx_%OSM_SCHEMA%_osm_road_assessment_nodeid on %OSM_CHK_TABLE% using btree(nodeid)" 61 | 62 | :: import from TSV 63 | cacls %TEMP_DIR% /e /p Everyone:f 64 | cacls %TEMP_DIR%\%OUTFILE% /e /p Everyone:f 65 | psql -U %PG_ID% -d %PG_DB% -h %PG_HOST% -p %PG_PORT% -q -c "copy %OSM_CHK_TABLE% from '%TEMP_DIR%\%OUTFILE%' (delimiter E'\t',format csv,encoding 'UTF-8',header true)" 66 | del %TEMP_DIR%\%OUTFILE% 67 | 68 | mkdir dump\tsv 69 | cacls dump\tsv /e /p Everyone:f 70 | psql -U %PG_ID% -d %PG_DB% -h %PG_HOST% -p %PG_PORT% -q -c "copy %OSM_CHK_TABLE% to '%TEMP_DIR%\%OUTFILE%' (delimiter E'\t',format csv,encoding 'UTF-8',header true)" 71 | move %TEMP_DIR%\%OUTFILE% dump\tsv\ 72 | 73 | mkdir dump\sql 74 | pg_dump -U %PG_ID% -d %PG_DB% -h %PG_HOST% -p %PG_PORT% -t %OSM_CHK_TABLE% > dump\sql\%OSM_CHK_TABLE%.sql 75 | 76 | mkdir dump\shape\shp_%OSM_CHK_TABLE% 77 | pgsql2shp -P %PGPASSWORD% -u %PG_ID% -h %PG_HOST% -p %PG_PORT% -f dump\shape\shp_%OSM_CHK_TABLE%\%OSM_CHK_TABLE%.shp %PG_DB% %OSM_CHK_TABLE% 78 | 79 | 80 | 81 | :: :::::::::::::::::::::::::::::::::::::::::::::::::::::::: 82 | :: create validated network with threshold value for the number of nodes in a group 83 | :: :::::::::::::::::::::::::::::::::::::::::::::::::::::::: 84 | psql -U %PG_ID% -d %PG_DB% -h %PG_HOST% -p %PG_PORT% -q -c "drop table if exists %OSM_VLD_LINK_TABLE%" 85 | psql -U %PG_ID% -d %PG_DB% -h %PG_HOST% -p %PG_PORT% -q -c "create table %OSM_VLD_LINK_TABLE% as select o.* from %OSM_ORG_TABLE% o where (select num from %OSM_CHK_TABLE% a where o.source=a.nodeid) >= %NUM_THRESHOLD%" 86 | psql -U %PG_ID% -d %PG_DB% -h %PG_HOST% -p %PG_PORT% -q -c "create index idx_%OSM_SCHEMA%_osm_road_available_source on %OSM_VLD_LINK_TABLE% using btree(source)" 87 | psql -U %PG_ID% -d %PG_DB% -h %PG_HOST% -p %PG_PORT% -q -c "create index idx_%OSM_SCHEMA%_osm_road_available_target on %OSM_VLD_LINK_TABLE% using btree(target)" 88 | psql -U %PG_ID% -d %PG_DB% -h %PG_HOST% -p %PG_PORT% -q -c "create index idx_%OSM_SCHEMA%_osm_road_available_geom on %OSM_VLD_LINK_TABLE% using Gist(geom_way)" 89 | 90 | 91 | :: :::::::::::::::::::::::::::::::::::::::::::::::::::::::: 92 | :: dump network data 93 | :: :::::::::::::::::::::::::::::::::::::::::::::::::::::::: 94 | :: dump as TSV file 95 | mkdir dump\tsv 96 | cacls dump\tsv /e /p Everyone:f 97 | psql -U %PG_ID% -d %PG_DB% -h %PG_HOST% -p %PG_PORT% -q -c "copy (select * from %OSM_VLD_LINK_TABLE%) to '%TEMP_DIR%\%OSM_VLD_LINK_TABLE%.tsv' (delimiter E'\t',format csv,encoding 'UTF-8',header true)" 98 | copy %TEMP_DIR%\%OSM_VLD_LINK_TABLE%.tsv dump\tsv\ 99 | 100 | :: dump as SQL file 101 | mkdir dump\sql 102 | pg_dump -U %PG_ID% -d %PG_DB% -h %PG_HOST% -p %PG_PORT% -t %OSM_VLD_LINK_TABLE% > dump\sql\%OSM_VLD_LINK_TABLE%.sql 103 | 104 | :: dump as Shape data 105 | mkdir dump\shape\shp_%OSM_VLD_LINK_TABLE% 106 | pgsql2shp -P %PGPASSWORD% -u %PG_ID% -h %PG_HOST% -p %PG_PORT% -f dump\shape\shp_%OSM_VLD_LINK_TABLE%\%OSM_VLD_LINK_TABLE%.shp %PG_DB% %OSM_VLD_LINK_TABLE% 107 | 108 | 109 | 110 | :: :::::::::::::::::::::::::::::::::::::::::::::::::::::::: 111 | :: create valid node table 112 | :: :::::::::::::::::::::::::::::::::::::::::::::::::::::::: 113 | psql -U %PG_ID% -d %PG_DB% -h %PG_HOST% -p %PG_PORT% -q -c "drop table if exists %OSM_VLD_NODE_TABLE%" 114 | psql -U %PG_ID% -d %PG_DB% -h %PG_HOST% -p %PG_PORT% -q -c "create table %OSM_VLD_NODE_TABLE% as select node,geom from ( select source as node,ST_StartPoint(geom_way) as geom from %OSM_VLD_LINK_TABLE% union select target as node,ST_EndPoint(geom_way) as geom from %OSM_VLD_LINK_TABLE%) sub" 115 | psql -U %PG_ID% -d %PG_DB% -h %PG_HOST% -p %PG_PORT% -q -c "create index idx_%OSM_SCHEMA%_osm_node_available_source on %OSM_VLD_NODE_TABLE% using btree(node)" 116 | psql -U %PG_ID% -d %PG_DB% -h %PG_HOST% -p %PG_PORT% -q -c "create index idx_%OSM_SCHEMA%_osm_node_available_geom on %OSM_VLD_NODE_TABLE% using Gist(geom)" 117 | 118 | :: :::::::::::::::::::::::::::::::::::::::::::::::::::::::: 119 | :: dump node data 120 | :: :::::::::::::::::::::::::::::::::::::::::::::::::::::::: 121 | :: dump as TSV file 122 | mkdir dump\tsv 123 | cacls dump\tsv /e /p Everyone:f 124 | psql -U %PG_ID% -d %PG_DB% -h %PG_HOST% -p %PG_PORT% -q -c "copy (select * from %OSM_VLD_NODE_TABLE%) to '%TEMP_DIR%\%OSM_VLD_NODE_TABLE%.tsv' (delimiter E'\t',format csv,encoding 'UTF-8',header true)" 125 | copy %TEMP_DIR%\%OSM_VLD_NODE_TABLE%.tsv dump\tsv\ 126 | 127 | :: dump as SQL file 128 | mkdir dump\sql 129 | pg_dump -U %PG_ID% -d %PG_DB% -h %PG_HOST% -p %PG_PORT% -t %OSM_VLD_NODE_TABLE% > dump\sql\%OSM_VLD_NODE_TABLE%.sql 130 | 131 | :: dump as shape data 132 | mkdir dump\shape\shp_%OSM_VLD_NODE_TABLE% 133 | pgsql2shp -P %PGPASSWORD% -u %PG_ID% -h %PG_HOST% -p %PG_PORT% -f dump\shape\shp_%OSM_VLD_NODE_TABLE%\%OSM_VLD_NODE_TABLE%.shp %PG_DB% %OSM_VLD_NODE_TABLE% 134 | 135 | 136 | 137 | psql -U %PG_ID% -d %PG_DB% -h %PG_HOST% -p %PG_PORT% -q -c "select count(distinct groupno) as N_group, count(distinct case when num>=100 then groupno else null end) as N_valid from %OSM_CHK_TABLE%" 138 | 139 | -------------------------------------------------------------------------------- /InfrastructureUpdates/2_osm_assessment.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | ## :::::::::::::::::::::::::::::::::::::::::::::::::::::::: 4 | ## OSM data assessment by creating network groups 5 | ## ::::::::::::::::::::::::::::::::::::::::::::::::::::::::s 6 | ## [set parameters] 7 | ## some parameters have to be set according to own environment 8 | ## :::::::::::::::::::::::::::::::::::::::::::::::::::::::: 9 | ## parameters for PostgreSQL access 10 | PG_ID=**YOUR_USER** 11 | PGPASSWORD=**YOUR_PASSWORD** 12 | PG_DB=**YOUR_DB_NAME** 13 | PG_HOST=localhost 14 | PG_PORT=5432 15 | 16 | ## set tablee naems 17 | OSM_SCHEMA=srilanka 18 | OSM_ORG_TABLE=${OSM_SCHEMA}.osm_road 19 | OSM_CHK_TABLE=${OSM_SCHEMA}.osm_road_assessment 20 | OSM_VLD_LINK_TABLE=${OSM_SCHEMA}.osm_road_available 21 | OSM_VLD_NODE_TABLE=${OSM_SCHEMA}.osm_node_available 22 | 23 | ## set assessment parameters 24 | NUM_THRESHOLD=100 25 | # JV_CLS=jp.ac.ut.csis.pflow.routing2.example.NetworkAssessmentOsm 26 | JV_CLS2=jp.ac.ut.csis.pflow.routing4.sample.OsmNetworkAssessment 27 | NETWORK_TSV=dump/tsv/${OSM_SCHEMA}.osm_road.tsv 28 | OUTFILE=${OSM_SCHEMA}.osm_road_assessment.tsv 29 | 30 | TEMP_DIR=/tmp 31 | 32 | 33 | ## :::::::::::::::::::::::::::::::::::::::::::::::::::::::: 34 | ## run assessment 35 | ## :::::::::::::::::::::::::::::::::::::::::::::::::::::::: 36 | echo "start network assessment ... " 37 | 38 | java -Xmx8G -cp PFlowLibFull-0.1.1.jar ${JV_CLS2} ${NETWORK_TSV} ${OUTFILE} 39 | 40 | echo "network assessment done" 41 | 42 | ## mv output file to temporary folder 43 | mv ${OUTFILE} ${TEMP_DIR}/ 44 | 45 | 46 | ## :::::::::::::::::::::::::::::::::::::::::::::::::::::::: 47 | ## conduct network assessment 48 | ## ======================================================== 49 | ## -- table schema of assessment result 50 | ## create table %OSM_SCHEMA%.osm_road_assessment ( 51 | ## groupno int4, 52 | ## nodeid int4, 53 | ## num int4, 54 | ## geom geometry(POINT,4326) 55 | ## ); 56 | ## :::::::::::::::::::::::::::::::::::::::::::::::::::::::: 57 | psql -U ${PG_ID} -d ${PG_DB} -h ${PG_HOST} -p ${PG_PORT} -q -c "drop table if exists ${OSM_CHK_TABLE}" 58 | psql -U ${PG_ID} -d ${PG_DB} -h ${PG_HOST} -p ${PG_PORT} -q -c "create table ${OSM_CHK_TABLE} (groupno int4,nodeid int4,num int4,geom geometry(POINT,4326))" 59 | psql -U ${PG_ID} -d ${PG_DB} -h ${PG_HOST} -p ${PG_PORT} -q -c "create index idx_${OSM_SCHEMA}_osm_road_assessment_geom on ${OSM_CHK_TABLE} using Gist(geom)" 60 | psql -U ${PG_ID} -d ${PG_DB} -h ${PG_HOST} -p ${PG_PORT} -q -c "create index idx_${OSM_SCHEMA}_osm_road_assessment_nodeid on ${OSM_CHK_TABLE} using btree(nodeid)" 61 | 62 | ## import from TSV 63 | psql -d ${PG_DB} -h ${PG_HOST} -p ${PG_PORT} -q -c "copy ${OSM_CHK_TABLE} from '${TEMP_DIR}/${OUTFILE}' (delimiter E'\t',format csv,encoding 'UTF-8',header true)" 64 | rm ${TEMP_DIR}/${OUTFILE} 65 | 66 | mkdir -p dump/tsv 67 | psql -d ${PG_DB} -h ${PG_HOST} -p ${PG_PORT} -q -c "copy ${OSM_CHK_TABLE} to '${TEMP_DIR}/${OUTFILE}' (delimiter E'\t',format csv,encoding 'UTF-8',header true)" 68 | mv ${TEMP_DIR}/${OUTFILE} ./dump/tsv/ 69 | 70 | mkdir -p dump/sql 71 | pg_dump -d ${PG_DB} -h ${PG_HOST} -p ${PG_PORT} -t ${OSM_CHK_TABLE} > dump/sql/${OSM_CHK_TABLE}.sql 72 | 73 | mkdir -p dump/shape/shp_${OSM_CHK_TABLE} 74 | pgsql2shp -h ${PG_HOST} -p ${PG_PORT} -f dump/shape/shp_${OSM_CHK_TABLE}/${OSM_CHK_TABLE}.shp ${PG_DB} ${OSM_CHK_TABLE} 75 | 76 | 77 | 78 | ## :::::::::::::::::::::::::::::::::::::::::::::::::::::::: 79 | ## create validated network with threshold value for the number of nodes in a group 80 | ## :::::::::::::::::::::::::::::::::::::::::::::::::::::::: 81 | psql -U ${PG_ID} -d ${PG_DB} -h ${PG_HOST} -p ${PG_PORT} -q -c "drop table if exists ${OSM_VLD_LINK_TABLE}" 82 | psql -U ${PG_ID} -d ${PG_DB} -h ${PG_HOST} -p ${PG_PORT} -q -c "create table ${OSM_VLD_LINK_TABLE} as select o.* from ${OSM_ORG_TABLE} o where (select num from ${OSM_CHK_TABLE} a where o.source=a.nodeid) >= ${NUM_THRESHOLD}" 83 | psql -U ${PG_ID} -d ${PG_DB} -h ${PG_HOST} -p ${PG_PORT} -q -c "create index idx_${OSM_SCHEMA}_osm_road_available_source on ${OSM_VLD_LINK_TABLE} using btree(source)" 84 | psql -U ${PG_ID} -d ${PG_DB} -h ${PG_HOST} -p ${PG_PORT} -q -c "create index idx_${OSM_SCHEMA}_osm_road_available_target on ${OSM_VLD_LINK_TABLE} using btree(target)" 85 | psql -U ${PG_ID} -d ${PG_DB} -h ${PG_HOST} -p ${PG_PORT} -q -c "create index idx_${OSM_SCHEMA}_osm_road_available_geom on ${OSM_VLD_LINK_TABLE} using Gist(geom_way)" 86 | 87 | 88 | ## :::::::::::::::::::::::::::::::::::::::::::::::::::::::: 89 | ## dump network data 90 | ## :::::::::::::::::::::::::::::::::::::::::::::::::::::::: 91 | ## dump as TSV file 92 | mkdir -p dump/tsv 93 | psql -d ${PG_DB} -h ${PG_HOST} -p ${PG_PORT} -q -c "copy (select * from ${OSM_VLD_LINK_TABLE}) to '${TEMP_DIR}/${OSM_VLD_LINK_TABLE}.tsv' (delimiter E'\t',format csv,encoding 'UTF-8',header true)" 94 | cp ${TEMP_DIR}/${OSM_VLD_LINK_TABLE}.tsv ./dump/tsv/ 95 | 96 | ## dump as SQL file 97 | mkdir -p dump/sql 98 | pg_dump -d ${PG_DB} -h ${PG_HOST} -p ${PG_PORT} -t ${OSM_VLD_LINK_TABLE} > dump/sql/${OSM_VLD_LINK_TABLE}.sql 99 | 100 | ## dump as Shape data 101 | mkdir -p dump/shape/shp_${OSM_VLD_LINK_TABLE} 102 | pgsql2shp -h ${PG_HOST} -p ${PG_PORT} -f dump/shape/shp_${OSM_VLD_LINK_TABLE}/${OSM_VLD_LINK_TABLE}.shp ${PG_DB} ${OSM_VLD_LINK_TABLE} 103 | 104 | 105 | 106 | ## :::::::::::::::::::::::::::::::::::::::::::::::::::::::: 107 | ## create valid node table 108 | ## :::::::::::::::::::::::::::::::::::::::::::::::::::::::: 109 | psql -U ${PG_ID} -d ${PG_DB} -h ${PG_HOST} -p ${PG_PORT} -q -c "drop table if exists ${OSM_VLD_NODE_TABLE}" 110 | psql -U ${PG_ID} -d ${PG_DB} -h ${PG_HOST} -p ${PG_PORT} -q -c "create table ${OSM_VLD_NODE_TABLE} as select node,geom from ( select source as node,ST_StartPoint(geom_way) as geom from ${OSM_VLD_LINK_TABLE} union select target as node,ST_EndPoint(geom_way) as geom from ${OSM_VLD_LINK_TABLE}) sub" 111 | psql -U ${PG_ID} -d ${PG_DB} -h ${PG_HOST} -p ${PG_PORT} -q -c "create index idx_${OSM_SCHEMA}_osm_node_available_source on ${OSM_VLD_NODE_TABLE} using btree(node)" 112 | psql -U ${PG_ID} -d ${PG_DB} -h ${PG_HOST} -p ${PG_PORT} -q -c "create index idx_${OSM_SCHEMA}_osm_node_available_geom on ${OSM_VLD_NODE_TABLE} using Gist(geom)" 113 | 114 | ## :::::::::::::::::::::::::::::::::::::::::::::::::::::::: 115 | ## dump node data 116 | ## :::::::::::::::::::::::::::::::::::::::::::::::::::::::: 117 | ## dump as TSV file 118 | mkdir -p dump/tsv 119 | psql -d ${PG_DB} -h ${PG_HOST} -p ${PG_PORT} -q -c "copy (select * from ${OSM_VLD_NODE_TABLE}) to '${TEMP_DIR}/${OSM_VLD_NODE_TABLE}.tsv' (delimiter E'\t',format csv,encoding 'UTF-8',header true)" 120 | cp ${TEMP_DIR}/${OSM_VLD_NODE_TABLE}.tsv ./dump/tsv/ 121 | 122 | ## dump as SQL file 123 | mkdir -p dump/sql 124 | pg_dump -d ${PG_DB} -h ${PG_HOST} -p ${PG_PORT} -t ${OSM_VLD_NODE_TABLE} > dump/sql/${OSM_VLD_NODE_TABLE}.sql 125 | 126 | ## dump as shape data 127 | mkdir -p dump/shape/shp_${OSM_VLD_NODE_TABLE} 128 | pgsql2shp -h ${PG_HOST} -p ${PG_PORT} -f dump/shape/shp_${OSM_VLD_NODE_TABLE}/${OSM_VLD_NODE_TABLE}.shp ${PG_DB} ${OSM_VLD_NODE_TABLE} 129 | 130 | 131 | 132 | psql -U ${PG_ID} -d ${PG_DB} -h ${PG_HOST} -p ${PG_PORT} -q -c "select count(distinct groupno) as N_group, count(distinct case when num>=100 then groupno else null end) as N_valid from ${OSM_CHK_TABLE}" 133 | 134 | ## select N_valid, N_valid::float8/N_all as ratio from (select count(*) as N_valid from kenya.osm_road_available) a left join (select count(*) as N_all from kenya.osm_road) b on true; 135 | ## select L_valid/1000.0, L_valid/L_all as ratio from (select sum(ST_Length(geography(geom_way))) as L_valid from kenya.osm_road_available) a left join (select sum(ST_Length(Geography(geom_way))) as L_all from kenya.osm_road) b on true; 136 | 137 | ## select N_valid, N_valid::float8/N_all as ratio from (select count(*) as N_valid from kenya.osm_node_available) a left join (select count(*) as N_all from kenya.osm_road_assessment) b on true; 138 | 139 | -------------------------------------------------------------------------------- /InfrastructureUpdates/3_create_building_poi_table.bat: -------------------------------------------------------------------------------- 1 | @echo off 2 | 3 | :: ======================================================== 4 | :: OSM data conversion on building POI 5 | :: ======================================================== 6 | :: POI data from OSM building data 7 | :: set parameters 8 | set PG_HOST=localhost 9 | set PG_ID=**YOUR_USER** 10 | set PGPASSWORD=**YOUR_PASSWORD** 11 | set PG_DB=**YOUR_DB_NAME** 12 | set PG_PORT=5432 13 | set PG_BIN_PATH=D:\PostgreSQL\9.6\bin 14 | set OSM_SCHEMA=**OSM_COUNTRY_ANME** 15 | set TEMP_DIR=%TEMP% 16 | set OSM_BLT_TABLE=%OSM_SCHEMA%.osm_buildings 17 | set PATH=%PATH%;%PG_BIN_PATH% 18 | 19 | :: convert shape to sql 20 | 21 | shp2pgsql -s 4326:4326 -I %OSM_SCHEMA%-latest-free.shp\gis_osm_buildings_a_free_1.shp %OSM_BLT_TABLE% > %OSM_SCHEMA%.osm_buildings.sql 22 | 23 | :: import into PostgreSQL/PostGIS DB 24 | psql -U %PG_ID% -d %PG_DB% -h %PG_HOST% -p %PG_PORT% -c "create schema if not exists %OSM_SCHEMA%;" 25 | psql -U %PG_ID% -d %PG_DB% -h %PG_HOST% -p %PG_PORT% -c "drop table if exists %OSM_BLT_TABLE%;" 26 | psql -U %PG_ID% -d %PG_DB% -h %PG_HOST% -p %PG_PORT% -q -f %OSM_SCHEMA%.osm_buildings.sql 27 | 28 | :: add column for building area size(m^2) 29 | psql -U %PG_ID% -d %PG_DB% -h %PG_HOST% -p %PG_PORT% -c "alter table %OSM_BLT_TABLE% add column area float8;" 30 | psql -U %PG_ID% -d %PG_DB% -h %PG_HOST% -p %PG_PORT% -c "update %OSM_BLT_TABLE% set area = ST_Area(Geography(geom));" 31 | 32 | :: add column of building centroid 33 | psql -U %PG_ID% -d %PG_DB% -h %PG_HOST% -p %PG_PORT% -c "alter table %OSM_BLT_TABLE% add column centroid GEOMETRY(POINT,4326);" 34 | psql -U %PG_ID% -d %PG_DB% -h %PG_HOST% -p %PG_PORT% -c "update %OSM_BLT_TABLE% set centroid = ST_PointOnSurface(geom) where ST_IsValid(geom);" 35 | psql -U %PG_ID% -d %PG_DB% -h %PG_HOST% -p %PG_PORT% -c "CREATE INDEX idx_%OSM_SCHEMA%_osm_buildings_centroid on %OSM_BLT_TABLE% USING Gist(centroid);" 36 | 37 | 38 | :: export road data as tsv format 39 | mkdir dump\tsv 40 | psql -U %PG_ID% -d %PG_DB% -h %PG_HOST% -p %PG_PORT% -q -c "copy %OSM_BLT_TABLE% to '%TEMP_DIR%\%OSM_BLT_TABLE%.tsv' (delimiter E'\t',format csv,header true)" 41 | copy %TEMP_DIR%\%OSM_BLT_TABLE%.tsv dump\tsv\ 42 | 43 | :: dump road data as sql 44 | mkdir dump\sql 45 | pg_dump -U %PG_ID% -d %PG_DB% -h %PG_HOST% -p %PG_PORT% -t %OSM_BLT_TABLE% > dump\sql\%OSM_BLT_TABLE%.sql 46 | 47 | :: dump as shape 48 | ::del -rf dump\shape\shp_osm_buildings 49 | mkdir dump\shape\shp_osm_buildings 50 | pgsql2shp -P %PGPASSWORD% -u %PG_ID% -h %PG_HOST% -p %PG_PORT% -f dump\shape\shp_osm_buildings\%OSM_BLT_TABLE%.shp %PG_DB% "select gid,osm_id,name,type,area,centroid from %OSM_BLT_TABLE% where centroid is not null" 51 | 52 | psql -U %PG_ID% -d %PG_DB% -h %PG_HOST% -p %PG_PORT% -q -AF, -c "select type,count(*) as N from %OSM_BLT_TABLE% group by type order by N desc" > dump\%OSM_BLT_TABLE%.fclass_stats.txt 53 | :: 54 | :: tempdb=> \d %OSM_SCHEMA%.osm_buildings 55 | :: Table "%OSM_SCHEMA%.osm_buildings" 56 | :: Column | Type | Modifiers 57 | :: ----------+-----------------------------+---------------------------------------------------------------------- 58 | :: gid | integer | not null default nextval('%OSM_SCHEMA%.osm_buildings_gid_seq'::regclass) 59 | :: osm_id | character varying(10) | 60 | :: code | smallint | 61 | :: fclass | character varying(20) | 62 | :: name | character varying(100) | 63 | :: type | character varying(20) | 64 | :: geom | geometry(MultiPolygon,4326) | 65 | :: area | double precision | 66 | :: centroid | geometry(Point,4326) | 67 | :: Indexes: 68 | :: "osm_buildings_pkey" PRIMARY KEY, btree (gid) 69 | :: "idx_thailand_osm_buildings_centroid" gist (centroid) 70 | :: "osm_buildings_geom_idx" gist (geom) 71 | :: 72 | 73 | psql -U %PG_ID% -d %PG_DB% -h %PG_HOST% -p %PG_PORT% -c "select 1-count(type)::float8/count(gid) from %OSM_BLT_TABLE%" 74 | 75 | 76 | -------------------------------------------------------------------------------- /InfrastructureUpdates/3_create_building_poi_table.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | ## ======================================================== 4 | ## OSM data conversion on building POI 5 | ## ======================================================== 6 | ## POI data from OSM building data 7 | ## set parameters 8 | PG_HOST=localhost 9 | PG_ID=**YOUR_USER** 10 | PGPASSWORD=**YOUR_PASSWORD** 11 | PG_DB=**YOUR_DB_NAME** 12 | PG_PORT=5432 13 | 14 | OSM_SCHEMA=srilanka 15 | OSM_BLT_TABLE=${OSM_SCHEMA}.osm_buildings 16 | TEMP_DIR=/tmp 17 | 18 | ## convert shape to sql 19 | shp2pgsql -s 4326:4326 -I ${OSM_SCHEMA}-latest-free.shp/gis_osm_buildings_a_free_1.shp ${OSM_BLT_TABLE} > ${OSM_SCHEMA}.osm_buildings.sql 20 | 21 | ## import into PostgreSQL/PostGIS DB 22 | psql -U ${PG_ID} -d ${PG_DB} -c "create schema if not exists ${OSM_SCHEMA};" 23 | psql -U ${PG_ID} -d ${PG_DB} -c "drop table if exists ${OSM_BLT_TABLE};" 24 | psql -U ${PG_ID} -d ${PG_DB} -q -f ${OSM_SCHEMA}.osm_buildings.sql 25 | 26 | ## add column for building area size(m^2) 27 | psql -U ${PG_ID} -d ${PG_DB} -c "alter table ${OSM_BLT_TABLE} add column area float8;" 28 | psql -U ${PG_ID} -d ${PG_DB} -c "update ${OSM_BLT_TABLE} set area = ST_Area(Geography(geom));" 29 | 30 | ## add column of building centroid 31 | psql -U ${PG_ID} -d ${PG_DB} -c "alter table ${OSM_BLT_TABLE} add column centroid GEOMETRY(POINT,4326);" 32 | psql -U ${PG_ID} -d ${PG_DB} -c "update ${OSM_BLT_TABLE} set centroid = ST_PointOnSurface(geom) where ST_IsValid(geom);" 33 | psql -U ${PG_ID} -d ${PG_DB} -c "CREATE INDEX idx_${OSM_SCHEMA}_osm_buildings_centroid on ${OSM_BLT_TABLE} USING Gist(centroid);" 34 | 35 | 36 | ## export road data as tsv format 37 | mkdir -p dump/tsv 38 | psql -d ${PG_DB} -q -c "copy ${OSM_BLT_TABLE} to '${TEMP_DIR}/${OSM_BLT_TABLE}.tsv' (delimiter E'\t',format csv,header true)" 39 | cp ${TEMP_DIR}/${OSM_BLT_TABLE}.tsv ./dump/tsv/ 40 | 41 | ## dump road data as sql 42 | mkdir -p dump/sql 43 | pg_dump -d ${PG_DB} -t ${OSM_BLT_TABLE} > dump/sql/${OSM_BLT_TABLE}.sql 44 | 45 | ## dump as shape 46 | rm -rf dump/shape/shp_osm_buildings 47 | mkdir -p dump/shape/shp_osm_buildings 48 | pgsql2shp -f dump/shape/shp_osm_buildings/${OSM_BLT_TABLE}.shp ${PG_DB} "select gid,osm_id,name,type,area,centroid from ${OSM_BLT_TABLE} where centroid is not null" 49 | 50 | psql -U ${PG_ID} -d ${PG_DB} -q -AF, -c "select type,count(*) as N from ${OSM_BLT_TABLE} group by type order by N desc" > dump/${OSM_BLT_TABLE}.fclass_stats.txt 51 | ## 52 | ## tempdb=> \d ${OSM_SCHEMA}.osm_buildings 53 | ## Table "${OSM_SCHEMA}.osm_buildings" 54 | ## Column | Type | Modifiers 55 | ## ----------+-----------------------------+---------------------------------------------------------------------- 56 | ## gid | integer | not null default nextval('${OSM_SCHEMA}.osm_buildings_gid_seq'::regclass) 57 | ## osm_id | character varying(10) | 58 | ## code | smallint | 59 | ## fclass | character varying(20) | 60 | ## name | character varying(100) | 61 | ## type | character varying(20) | 62 | ## geom | geometry(MultiPolygon,4326) | 63 | ## area | double precision | 64 | ## centroid | geometry(Point,4326) | 65 | ## Indexes: 66 | ## "osm_buildings_pkey" PRIMARY KEY, btree (gid) 67 | ## "idx_thailand_osm_buildings_centroid" gist (centroid) 68 | ## "osm_buildings_geom_idx" gist (geom) 69 | ## 70 | 71 | psql -U ${PG_ID} -d ${PG_DB} -c "select 1-count(type)::float8/count(gid) from ${OSM_BLT_TABLE}" 72 | 73 | 74 | -------------------------------------------------------------------------------- /InfrastructureUpdates/PFlowLibFull-0.1.1.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SpatialDataCommons/CDR-analysis-tools-std/68862be38af4bf21ef004683c9d16bb971068b0c/InfrastructureUpdates/PFlowLibFull-0.1.1.jar -------------------------------------------------------------------------------- /InfrastructureUpdates/osm2po-core-5.0.0-signed.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SpatialDataCommons/CDR-analysis-tools-std/68862be38af4bf21ef004683c9d16bb971068b0c/InfrastructureUpdates/osm2po-core-5.0.0-signed.jar -------------------------------------------------------------------------------- /InfrastructureUpdates/osm2po-plugins/osm2po-plugins-5.0.0.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SpatialDataCommons/CDR-analysis-tools-std/68862be38af4bf21ef004683c9d16bb971068b0c/InfrastructureUpdates/osm2po-plugins/osm2po-plugins-5.0.0.jar -------------------------------------------------------------------------------- /InfrastructureUpdates/osm2po-plugins/osm2po-sd-5.0.0.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SpatialDataCommons/CDR-analysis-tools-std/68862be38af4bf21ef004683c9d16bb971068b0c/InfrastructureUpdates/osm2po-plugins/osm2po-sd-5.0.0.jar -------------------------------------------------------------------------------- /InfrastructureUpdates/sample/1_run_osm2po.bat: -------------------------------------------------------------------------------- 1 | @echo off 2 | 3 | :: :::::::::::::::::::::::::::::::::::::::::::::::::::::::: 4 | :: OSM data conversion with OSM2PO (http://osm2po.de/) 5 | :: :::::::::::::::::::::::::::::::::::::::::::::::::::::::: 6 | set PG_ID=apichon 7 | set PGPASSWORD=thinkpad 8 | set PG_DB=osmsrilanka 9 | set PG_HOST=localhost 10 | set PG_PORT=5433 11 | set OSM_SCHEMA=srilanka 12 | set TEMP_DIR=D:\git\CDR-analysis-tools-std\InfrastructureUpdates\tmp 13 | set PG_BIN_PATH=D:\PostgreSQL\9.6\bin 14 | 15 | :: :::::::::::::::::::::::::::::::::::::::::::::::::::::::: 16 | :: run osm2po to convert OSM pbf data into SQL 17 | :: * need to respond license agreement firstly. 18 | :: * when customizing conversion setting, modify file osm2po.config 19 | :: :::::::::::::::::::::::::::::::::::::::::::::::::::::::: 20 | echo osm2po to convert OSM pbf data into SQL... 21 | 22 | java -Xmx5G -jar osm2po-core-5.0.0-signed.jar cmd=tjsp prefix=%OSM_SCHEMA% %OSM_SCHEMA%-latest.osm.pbf 23 | 24 | 25 | :: :::::::::::::::::::::::::::::::::::::::::::::::::::::::: 26 | :: create raw network table 27 | :: :::::::::::::::::::::::::::::::::::::::::::::::::::::::: 28 | echo create raw network table... 29 | 30 | psql -U %PG_ID% -d %PG_DB% -h %PG_HOST% -p %PG_PORT% -q -c "create schema %OSM_SCHEMA%" 31 | psql -U %PG_ID% -d %PG_DB% -h %PG_HOST% -p %PG_PORT% -q -c "drop table if exists %OSM_SCHEMA%.osm_road" 32 | psql -U %PG_ID% -d %PG_DB% -h %PG_HOST% -p %PG_PORT% -q -f %OSM_SCHEMA%/%OSM_SCHEMA%_2po_4pgr.sql 33 | psql -U %PG_ID% -d %PG_DB% -h %PG_HOST% -p %PG_PORT% -q -c "alter table %OSM_SCHEMA%_2po_4pgr rename to osm_road" 34 | psql -U %PG_ID% -d %PG_DB% -h %PG_HOST% -p %PG_PORT% -q -c "alter table osm_road set schema %OSM_SCHEMA%" 35 | 36 | psql -U %PG_ID% -d %PG_DB% -h %PG_HOST% -p %PG_PORT% -q -c "create index idx_%OSM_SCHEMA%_osm_road_source on %OSM_SCHEMA%.osm_road using btree(source)" 37 | psql -U %PG_ID% -d %PG_DB% -h %PG_HOST% -p %PG_PORT% -q -c "create index idx_%OSM_SCHEMA%_osm_road_target on %OSM_SCHEMA%.osm_road using btree(target)" 38 | psql -U %PG_ID% -d %PG_DB% -h %PG_HOST% -p %PG_PORT% -q -c "create index idx_%OSM_SCHEMA%_osm_road_geom_way on %OSM_SCHEMA%.osm_road using Gist(geom_way)" 39 | 40 | psql -U %PG_ID% -d %PG_DB% -h %PG_HOST% -p %PG_PORT% -q -c "select count(*) as N,sum(ST_length(Geography(geom_way))/1000.0) as km from %OSM_SCHEMA%.osm_road" 41 | 42 | 43 | :: :::::::::::::::::::::::::::::::::::::::::::::::::::::::: 44 | :: dump data 45 | :: :::::::::::::::::::::::::::::::::::::::::::::::::::::::: 46 | :: export road data as tsv File 47 | echo export road data as tsv File... 48 | mkdir tmp 49 | mkdir dump\tsv 50 | psql -d %PG_DB% -h %PG_HOST% -p %PG_PORT% -q -c "copy %OSM_SCHEMA%.osm_road to '%TEMP_DIR%\%OSM_SCHEMA%.osm_road.tsv' (delimiter E'\t',format csv,encoding 'UTF-8',header true)" 51 | copy %TEMP_DIR%\%OSM_SCHEMA%.osm_road.tsv dump\tsv\ 52 | 53 | :: dump road data as sql File 54 | mkdir dump\sql 55 | pg_dump -d %PG_DB% -h %PG_HOST% -p %PG_PORT% -t %OSM_SCHEMA%.osm_road > dump\sql\%OSM_SCHEMA%.osm_road.sql 56 | 57 | :: extract road data as shape data 58 | mkdir dump\shape\shp_osm_road 59 | %PG_BIN_PATH%\pgsql2shp -h %PG_HOST% -p %PG_PORT% -f dump\shape\shp_osm_road\%OSM_SCHEMA%_osm_road.shp %PG_DB% %OSM_SCHEMA%.osm_road 60 | 61 | -------------------------------------------------------------------------------- /InfrastructureUpdates/sample/2_osm_assessment.bat: -------------------------------------------------------------------------------- 1 | @echo off 2 | 3 | :: :::::::::::::::::::::::::::::::::::::::::::::::::::::::: 4 | :: OSM data assessment by creating network groups 5 | :: ::::::::::::::::::::::::::::::::::::::::::::::::::::::::s 6 | :: [set parameters] 7 | :: some parameters have to be set according to own environment 8 | :: :::::::::::::::::::::::::::::::::::::::::::::::::::::::: 9 | :: parameters for PostgreSQL access 10 | set PG_ID=apichon 11 | set PGPASSWORD=thinkpad 12 | set PG_DB=osmsrilanka 13 | set PG_HOST=localhost 14 | set PG_PORT=5433 15 | set TEMP_DIR=D:\git\CDR-analysis-tools-std\InfrastructureUpdates\tmp 16 | set PG_BIN_PATH=D:\PostgreSQL\9.6\bin 17 | 18 | :: set tablee naems 19 | set OSM_SCHEMA=srilanka 20 | set OSM_ORG_TABLE=%OSM_SCHEMA%.osm_road 21 | set OSM_CHK_TABLE=%OSM_SCHEMA%.osm_road_assessment 22 | set OSM_VLD_LINK_TABLE=%OSM_SCHEMA%.osm_road_available 23 | set OSM_VLD_NODE_TABLE=%OSM_SCHEMA%.osm_node_available 24 | 25 | :: set assessment parameters 26 | set NUM_THRESHOLD=100 27 | :: JV_CLS=jp.ac.ut.csis.pflow.routing2.example.NetworkAssessmentOsm 28 | set JV_CLS2=jp.ac.ut.csis.pflow.routing4.sample.OsmNetworkAssessment 29 | set NETWORK_TSV=dump\tsv\%OSM_SCHEMA%.osm_road.tsv 30 | set OUTFILE=%OSM_SCHEMA%.osm_road_assessment.tsv 31 | 32 | :: :::::::::::::::::::::::::::::::::::::::::::::::::::::::: 33 | :: run assessment 34 | :: :::::::::::::::::::::::::::::::::::::::::::::::::::::::: 35 | echo "start network assessment ... " 36 | 37 | java -Xmx8G -cp PFlowLibFull-0.1.1.jar %JV_CLS2% %NETWORK_TSV% %OUTFILE% 38 | 39 | echo "network assessment done" 40 | 41 | :: mv output file to temporary folder 42 | move %OUTFILE% %TEMP_DIR%\ 43 | 44 | 45 | :: :::::::::::::::::::::::::::::::::::::::::::::::::::::::: 46 | :: conduct network assessment 47 | :: ======================================================== 48 | :: -- table schema of assessment result 49 | :: create table %OSM_SCHEMA%.osm_road_assessment ( 50 | :: groupno int4, 51 | :: nodeid int4, 52 | :: num int4, 53 | :: geom geometry(POINT,4326) 54 | :: ); 55 | :: :::::::::::::::::::::::::::::::::::::::::::::::::::::::: 56 | psql -U %PG_ID% -d %PG_DB% -h %PG_HOST% -p %PG_PORT% -q -c "drop table if exists %OSM_CHK_TABLE%" 57 | psql -U %PG_ID% -d %PG_DB% -h %PG_HOST% -p %PG_PORT% -q -c "create table %OSM_CHK_TABLE% (groupno int4,nodeid int4,num int4,geom geometry(POINT,4326))" 58 | psql -U %PG_ID% -d %PG_DB% -h %PG_HOST% -p %PG_PORT% -q -c "create index idx_%OSM_SCHEMA%_osm_road_assessment_geom on %OSM_CHK_TABLE% using Gist(geom)" 59 | psql -U %PG_ID% -d %PG_DB% -h %PG_HOST% -p %PG_PORT% -q -c "create index idx_%OSM_SCHEMA%_osm_road_assessment_nodeid on %OSM_CHK_TABLE% using btree(nodeid)" 60 | 61 | :: import from TSV 62 | psql -d %PG_DB% -h %PG_HOST% -p %PG_PORT% -q -c "copy %OSM_CHK_TABLE% from '%TEMP_DIR%\%OUTFILE%' (delimiter E'\t',format csv,encoding 'UTF-8',header true)" 63 | del %TEMP_DIR%\%OUTFILE% 64 | 65 | mkdir dump\tsv 66 | psql -d %PG_DB% -h %PG_HOST% -p %PG_PORT% -q -c "copy %OSM_CHK_TABLE% to '%TEMP_DIR%\%OUTFILE%' (delimiter E'\t',format csv,encoding 'UTF-8',header true)" 67 | move %TEMP_DIR%\%OUTFILE% dump\tsv\ 68 | 69 | mkdir dump\sql 70 | pg_dump -d %PG_DB% -h %PG_HOST% -p %PG_PORT% -t %OSM_CHK_TABLE% > dump\sql\%OSM_CHK_TABLE%.sql 71 | 72 | mkdir dump\shape\shp_%OSM_CHK_TABLE% 73 | %PG_BIN_PATH%\pgsql2shp -h %PG_HOST% -p %PG_PORT% -f dump\shape\shp_%OSM_CHK_TABLE%\%OSM_CHK_TABLE%.shp %PG_DB% %OSM_CHK_TABLE% 74 | 75 | 76 | 77 | :: :::::::::::::::::::::::::::::::::::::::::::::::::::::::: 78 | :: create validated network with threshold value for the number of nodes in a group 79 | :: :::::::::::::::::::::::::::::::::::::::::::::::::::::::: 80 | psql -U %PG_ID% -d %PG_DB% -h %PG_HOST% -p %PG_PORT% -q -c "drop table if exists %OSM_VLD_LINK_TABLE%" 81 | psql -U %PG_ID% -d %PG_DB% -h %PG_HOST% -p %PG_PORT% -q -c "create table %OSM_VLD_LINK_TABLE% as select o.* from %OSM_ORG_TABLE% o where (select num from %OSM_CHK_TABLE% a where o.source=a.nodeid) >= %NUM_THRESHOLD%" 82 | psql -U %PG_ID% -d %PG_DB% -h %PG_HOST% -p %PG_PORT% -q -c "create index idx_%OSM_SCHEMA%_osm_road_available_source on %OSM_VLD_LINK_TABLE% using btree(source)" 83 | psql -U %PG_ID% -d %PG_DB% -h %PG_HOST% -p %PG_PORT% -q -c "create index idx_%OSM_SCHEMA%_osm_road_available_target on %OSM_VLD_LINK_TABLE% using btree(target)" 84 | psql -U %PG_ID% -d %PG_DB% -h %PG_HOST% -p %PG_PORT% -q -c "create index idx_%OSM_SCHEMA%_osm_road_available_geom on %OSM_VLD_LINK_TABLE% using Gist(geom_way)" 85 | 86 | 87 | :: :::::::::::::::::::::::::::::::::::::::::::::::::::::::: 88 | :: dump network data 89 | :: :::::::::::::::::::::::::::::::::::::::::::::::::::::::: 90 | :: dump as TSV file 91 | mkdir dumpsv 92 | psql -U %PG_ID% -d %PG_DB% -h %PG_HOST% -p %PG_PORT% -q -c "copy (select * from %OSM_VLD_LINK_TABLE%) to '%TEMP_DIR%\%OSM_VLD_LINK_TABLE%.tsv' (delimiter E'\t',format csv,encoding 'UTF-8',header true)" 93 | copy %TEMP_DIR%\%OSM_VLD_LINK_TABLE%.tsv dump\tsv\ 94 | 95 | :: dump as SQL file 96 | mkdir dump\sql 97 | pg_dump -d %PG_DB% -h %PG_HOST% -p %PG_PORT% -t %OSM_VLD_LINK_TABLE% > dump\sql\%OSM_VLD_LINK_TABLE%.sql 98 | 99 | :: dump as Shape data 100 | mkdir dump\shape\shp_%OSM_VLD_LINK_TABLE% 101 | %PG_BIN_PATH%\pgsql2shp -h %PG_HOST% -p %PG_PORT% -f dump\shape\shp_%OSM_VLD_LINK_TABLE%\%OSM_VLD_LINK_TABLE%.shp %PG_DB% %OSM_VLD_LINK_TABLE% 102 | 103 | 104 | 105 | :: :::::::::::::::::::::::::::::::::::::::::::::::::::::::: 106 | :: create valid node table 107 | :: :::::::::::::::::::::::::::::::::::::::::::::::::::::::: 108 | psql -U %PG_ID% -d %PG_DB% -h %PG_HOST% -p %PG_PORT% -q -c "drop table if exists %OSM_VLD_NODE_TABLE%" 109 | psql -U %PG_ID% -d %PG_DB% -h %PG_HOST% -p %PG_PORT% -q -c "create table %OSM_VLD_NODE_TABLE% as select node,geom from ( select source as node,ST_StartPoint(geom_way) as geom from %OSM_VLD_LINK_TABLE% union select target as node,ST_EndPoint(geom_way) as geom from %OSM_VLD_LINK_TABLE%) sub" 110 | psql -U %PG_ID% -d %PG_DB% -h %PG_HOST% -p %PG_PORT% -q -c "create index idx_%OSM_SCHEMA%_osm_node_available_source on %OSM_VLD_NODE_TABLE% using btree(node)" 111 | psql -U %PG_ID% -d %PG_DB% -h %PG_HOST% -p %PG_PORT% -q -c "create index idx_%OSM_SCHEMA%_osm_node_available_geom on %OSM_VLD_NODE_TABLE% using Gist(geom)" 112 | 113 | :: :::::::::::::::::::::::::::::::::::::::::::::::::::::::: 114 | :: dump node data 115 | :: :::::::::::::::::::::::::::::::::::::::::::::::::::::::: 116 | :: dump as TSV file 117 | mkdir dump\tsv 118 | psql -U %PG_ID% -d %PG_DB% -h %PG_HOST% -p %PG_PORT% -q -c "copy (select * from %OSM_VLD_NODE_TABLE%) to '%TEMP_DIR%\%OSM_VLD_NODE_TABLE%.tsv' (delimiter E'\t',format csv,encoding 'UTF-8',header true)" 119 | copy %TEMP_DIR%\%OSM_VLD_NODE_TABLE%.tsv dump\tsv\ 120 | 121 | :: dump as SQL file 122 | mkdir dump\sql 123 | pg_dump -d %PG_DB% -h %PG_HOST% -p %PG_PORT% -t %OSM_VLD_NODE_TABLE% > dump\sql\%OSM_VLD_NODE_TABLE%.sql 124 | 125 | :: dump as shape data 126 | mkdir dump\shape\shp_%OSM_VLD_NODE_TABLE% 127 | %PG_BIN_PATH%\pgsql2shp -h %PG_HOST% -p %PG_PORT% -f dump\shape\shp_%OSM_VLD_NODE_TABLE%\%OSM_VLD_NODE_TABLE%.shp %PG_DB% %OSM_VLD_NODE_TABLE% 128 | 129 | 130 | 131 | psql -U %PG_ID% -d %PG_DB% -h %PG_HOST% -p %PG_PORT% -q -c "select count(distinct groupno) as N_group, count(distinct case when num>=100 then groupno else null end) as N_valid from %OSM_CHK_TABLE%" 132 | 133 | -------------------------------------------------------------------------------- /InfrastructureUpdates/sample/3_create_building_poi_table.bat: -------------------------------------------------------------------------------- 1 | @echo off 2 | 3 | :: ======================================================== 4 | :: OSM data conversion on building POI 5 | :: ======================================================== 6 | :: POI data from OSM building data 7 | :: set parameters 8 | set PG_HOST=localhost 9 | set PG_ID=apichon 10 | set PGPASSWORD=thinkpad 11 | set PG_DB=osmsrilanka 12 | set PG_PORT=5433 13 | set PG_BIN_PATH=D:\PostgreSQL\9.6\bin 14 | set OSM_SCHEMA=srilanka 15 | set TEMP_DIR=D:\git\CDR-analysis-tools-std\InfrastructureUpdates\tmp 16 | set OSM_BLT_TABLE=%OSM_SCHEMA%.osm_buildings 17 | 18 | :: convert shape to sql 19 | 20 | %PG_BIN_PATH%\shp2pgsql -s 4326:4326 -I %OSM_SCHEMA%-latest-free.shp\gis_osm_buildings_a_free_1.shp %OSM_BLT_TABLE% > %OSM_SCHEMA%.osm_buildings.sql 21 | 22 | :: import into PostgreSQL/PostGIS DB 23 | psql -U %PG_ID% -d %PG_DB% -h %PG_HOST% -p %PG_PORT% -c "create schema if not exists %OSM_SCHEMA%;" 24 | psql -U %PG_ID% -d %PG_DB% -h %PG_HOST% -p %PG_PORT% -c "drop table if exists %OSM_BLT_TABLE%;" 25 | psql -U %PG_ID% -d %PG_DB% -h %PG_HOST% -p %PG_PORT% -q -f %OSM_SCHEMA%.osm_buildings.sql 26 | 27 | :: add column for building area size(m^2) 28 | psql -U %PG_ID% -d %PG_DB% -h %PG_HOST% -p %PG_PORT% -c "alter table %OSM_BLT_TABLE% add column area float8;" 29 | psql -U %PG_ID% -d %PG_DB% -h %PG_HOST% -p %PG_PORT% -c "update %OSM_BLT_TABLE% set area = ST_Area(Geography(geom));" 30 | 31 | :: add column of building centroid 32 | psql -U %PG_ID% -d %PG_DB% -h %PG_HOST% -p %PG_PORT% -c "alter table %OSM_BLT_TABLE% add column centroid GEOMETRY(POINT,4326);" 33 | psql -U %PG_ID% -d %PG_DB% -h %PG_HOST% -p %PG_PORT% -c "update %OSM_BLT_TABLE% set centroid = ST_PointOnSurface(geom) where ST_IsValid(geom);" 34 | psql -U %PG_ID% -d %PG_DB% -h %PG_HOST% -p %PG_PORT% -c "CREATE INDEX idx_%OSM_SCHEMA%_osm_buildings_centroid on %OSM_BLT_TABLE% USING Gist(centroid);" 35 | 36 | 37 | :: export road data as tsv format 38 | mkdir dump\tsv 39 | psql -d %PG_DB% -h %PG_HOST% -p %PG_PORT% -q -c "copy %OSM_BLT_TABLE% to '%TEMP_DIR%\%OSM_BLT_TABLE%.tsv' (delimiter E'\t',format csv,header true)" 40 | copy %TEMP_DIR%\%OSM_BLT_TABLE%.tsv dump\tsv\ 41 | 42 | :: dump road data as sql 43 | mkdir dump\sql 44 | pg_dump -d %PG_DB% -h %PG_HOST% -p %PG_PORT% -t %OSM_BLT_TABLE% > dump\sql\%OSM_BLT_TABLE%.sql 45 | 46 | :: dump as shape 47 | ::del -rf dump\shape\shp_osm_buildings 48 | mkdir dump\shape\shp_osm_buildings 49 | %PG_BIN_PATH%\pgsql2shp -h %PG_HOST% -p %PG_PORT% -f dump\shape\shp_osm_buildings\%OSM_BLT_TABLE%.shp %PG_DB% "select gid,osm_id,name,type,area,centroid from %OSM_BLT_TABLE% where centroid is not null" 50 | 51 | psql -U %PG_ID% -d %PG_DB% -h %PG_HOST% -p %PG_PORT% -q -AF, -c "select type,count(*) as N from %OSM_BLT_TABLE% group by type order by N desc" > dump\%OSM_BLT_TABLE%.fclass_stats.txt 52 | :: 53 | :: tempdb=> \d %OSM_SCHEMA%.osm_buildings 54 | :: Table "%OSM_SCHEMA%.osm_buildings" 55 | :: Column | Type | Modifiers 56 | :: ----------+-----------------------------+---------------------------------------------------------------------- 57 | :: gid | integer | not null default nextval('%OSM_SCHEMA%.osm_buildings_gid_seq'::regclass) 58 | :: osm_id | character varying(10) | 59 | :: code | smallint | 60 | :: fclass | character varying(20) | 61 | :: name | character varying(100) | 62 | :: type | character varying(20) | 63 | :: geom | geometry(MultiPolygon,4326) | 64 | :: area | double precision | 65 | :: centroid | geometry(Point,4326) | 66 | :: Indexes: 67 | :: "osm_buildings_pkey" PRIMARY KEY, btree (gid) 68 | :: "idx_thailand_osm_buildings_centroid" gist (centroid) 69 | :: "osm_buildings_geom_idx" gist (geom) 70 | :: 71 | 72 | psql -U %PG_ID% -d %PG_DB% -h %PG_HOST% -p %PG_PORT% -c "select 1-count(type)::float8/count(gid) from %OSM_BLT_TABLE%" 73 | 74 | 75 | -------------------------------------------------------------------------------- /Interpolation/docs/cdr_info.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SpatialDataCommons/CDR-analysis-tools-std/68862be38af4bf21ef004683c9d16bb971068b0c/Interpolation/docs/cdr_info.jpg -------------------------------------------------------------------------------- /Interpolation/docs/interpolation_info.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SpatialDataCommons/CDR-analysis-tools-std/68862be38af4bf21ef004683c9d16bb971068b0c/Interpolation/docs/interpolation_info.jpg -------------------------------------------------------------------------------- /Interpolation/docs/interpolation_step.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SpatialDataCommons/CDR-analysis-tools-std/68862be38af4bf21ef004683c9d16bb971068b0c/Interpolation/docs/interpolation_step.jpg -------------------------------------------------------------------------------- /Interpolation/exportformobmap.bat: -------------------------------------------------------------------------------- 1 | @echo off 2 | :: 2019-10-19 ****** Export Trip for Mobmap ****** :: 3 | :: :: 4 | :: :: 5 | :: [Preparation] :: 6 | :: 1) Java 8 :: 7 | :: 2) input data from interpolation :: 8 | :: (/output/interpolation :: 9 | :: :: 10 | :: ****************************************************** :: 11 | 12 | 13 | echo Export Trip for Mobmap... 14 | 15 | set threadNum=2 16 | set logdir=log 17 | set output_path=output 18 | set idfile=id.csv 19 | set int_output_path=%output_path%\mobmap-temp 20 | set input_file=%1 21 | 22 | mkdir %logdir% 2> NUL 23 | mkdir %output_path% 2> NUL 24 | mkdir %int_output_path% 2> NUL 25 | mkdir %output_path%\mobmap 2> NUL 26 | 27 | echo Export Trip for Mobmap on %input_file% 28 | :: run trip reallocation (java) 29 | 30 | for %%f in (%input_file%\*) DO ( 31 | echo %%f 32 | 33 | java -Xmx2G -classpath .;lib/* jp.utokyo.shibalab.cdrworks.ToMob2 %%f %int_output_path% 1> %logdir%/stdout-mobmap.log 2> %logdir%/stderr-mobmap.log 34 | 35 | :: post processing:: merging all files 36 | for /D %%f in (%int_output_path%\*) DO ( 37 | echo %%f 38 | type %%f\*csv > %%f.csv 39 | rmdir /S /Q %%f 40 | ) 41 | type %int_output_path%\*.csv > %output_path%\mobmap\mobmap_%%~nxf 42 | ) 43 | 44 | rmdir /S /Q %int_output_path% 45 | 46 | -------------------------------------------------------------------------------- /Interpolation/id.csv: -------------------------------------------------------------------------------- 1 | A59432230 1 2 | A6583568 2 3 | A92606346 3 4 | B20073597 4 5 | B25699246 5 6 | B25863732 6 7 | B50880072 7 8 | B64201306 8 9 | B66847881 9 10 | B89957453 10 11 | B94841644 11 12 | C40403733 12 13 | D11269710 13 14 | D8782179 14 15 | D9075146 15 16 | E14917031 16 17 | E7163200 17 18 | E82121406 18 19 | E88186217 19 20 | E93530080 20 21 | E99276233 21 22 | F30895279 22 23 | F31578302 23 24 | F36858340 24 25 | F39958526 25 26 | F7284549 26 27 | G10041485 27 28 | G42690537 28 29 | G45771252 29 30 | G57434476 30 31 | G78678183 31 32 | H461451 32 33 | H54867586 33 34 | H60703164 34 35 | H98199372 35 36 | H98978955 36 37 | J14317481 37 38 | J39867959 38 39 | J59199008 39 40 | J80888780 40 41 | J93268583 41 42 | K24875616 42 43 | K33279725 43 44 | K76506825 44 45 | K93588579 45 46 | K98849355 46 47 | L79848001 47 48 | L83121244 48 49 | M51806386 49 50 | N13465597 50 51 | N13965834 51 52 | N44215039 52 53 | N5098435 53 54 | N59789455 54 55 | N90111116 55 56 | P42846190 56 57 | Q22277748 57 58 | Q23286823 58 59 | Q28512878 59 60 | Q98663707 60 61 | R24023358 61 62 | R39388935 62 63 | R56548183 63 64 | R95132876 64 65 | T52712899 65 66 | T99695355 66 67 | V14931036 67 68 | V40517946 68 69 | V6855804 69 70 | V84452376 70 71 | V98436807 71 72 | W23231623 72 73 | W29657142 73 74 | W74368480 74 75 | W84112616 75 76 | W85274455 76 77 | W97957628 77 78 | X25397784 78 79 | X3952384 79 80 | X64698163 80 81 | Y11746546 81 82 | Y42998614 82 83 | Y46117392 83 84 | Y74938825 84 85 | Y95236628 85 86 | Z10747924 86 87 | Z38042814 87 88 | Z44516570 88 89 | G85355191 89 90 | H242176 90 91 | Q68194336 91 92 | R19936983 92 93 | V76883130 93 94 | Z61297887 94 95 | -------------------------------------------------------------------------------- /Interpolation/lib/PFlowLibFull-0.1.1.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SpatialDataCommons/CDR-analysis-tools-std/68862be38af4bf21ef004683c9d16bb971068b0c/Interpolation/lib/PFlowLibFull-0.1.1.jar -------------------------------------------------------------------------------- /Interpolation/lib/cdrmobilitylib.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SpatialDataCommons/CDR-analysis-tools-std/68862be38af4bf21ef004683c9d16bb971068b0c/Interpolation/lib/cdrmobilitylib.jar -------------------------------------------------------------------------------- /Interpolation/lib/cdrmobilitylibge.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SpatialDataCommons/CDR-analysis-tools-std/68862be38af4bf21ef004683c9d16bb971068b0c/Interpolation/lib/cdrmobilitylibge.jar -------------------------------------------------------------------------------- /Interpolation/lib/cdrmobilitylibjica.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SpatialDataCommons/CDR-analysis-tools-std/68862be38af4bf21ef004683c9d16bb971068b0c/Interpolation/lib/cdrmobilitylibjica.jar -------------------------------------------------------------------------------- /Interpolation/lib/cdrworkspace-0.0.1.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SpatialDataCommons/CDR-analysis-tools-std/68862be38af4bf21ef004683c9d16bb971068b0c/Interpolation/lib/cdrworkspace-0.0.1.jar -------------------------------------------------------------------------------- /Interpolation/lib/hadoop-common-2.2.0.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SpatialDataCommons/CDR-analysis-tools-std/68862be38af4bf21ef004683c9d16bb971068b0c/Interpolation/lib/hadoop-common-2.2.0.jar -------------------------------------------------------------------------------- /Interpolation/lib/hive-exec-0.13.1.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SpatialDataCommons/CDR-analysis-tools-std/68862be38af4bf21ef004683c9d16bb971068b0c/Interpolation/lib/hive-exec-0.13.1.jar -------------------------------------------------------------------------------- /Interpolation/lib/javaml-0.1.6.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SpatialDataCommons/CDR-analysis-tools-std/68862be38af4bf21ef004683c9d16bb971068b0c/Interpolation/lib/javaml-0.1.6.jar -------------------------------------------------------------------------------- /Interpolation/lib/tools.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SpatialDataCommons/CDR-analysis-tools-std/68862be38af4bf21ef004683c9d16bb971068b0c/Interpolation/lib/tools.jar -------------------------------------------------------------------------------- /Interpolation/routeinterpolation.bat: -------------------------------------------------------------------------------- 1 | @echo off 2 | :: 2019-10-19 ****** Trip Interpolation ****** :: 3 | :: :: 4 | :: :: 5 | :: [Preparation] :: 6 | :: 1) Java 8 :: 7 | :: 2) input data from stay point reallocaiton :: 8 | :: (/output/trippadding :: 9 | :: :: 10 | :: ****************************************************** :: 11 | 12 | 13 | echo trip interpolation... 14 | 15 | set threadNum=2 16 | set logdir=log 17 | set output_path=output 18 | set idfile=id.csv 19 | set int_output_path=%output_path%\interpolation-temp 20 | set input_file=%1 21 | set roadfile=parameters/osm_road.tsv 22 | 23 | mkdir %logdir% 2> NUL 24 | mkdir %output_path% 2> NUL 25 | mkdir %int_output_path% 2> NUL 26 | mkdir %output_path%\interpolation 2> NUL 27 | 28 | echo trip interpolation on %input_file% 29 | :: run trip reallocation (java) 30 | 31 | for %%f in (%input_file%\*) DO ( 32 | echo %%f 33 | 34 | java -Xmx2G -classpath .;lib/* jp.utokyo.shibalab.cdrworks.TripInterpolationMain %threadNum% %roadfile% %%f %int_output_path% 1> %logdir%/stdout-interpolation.log 2> %logdir%/stderr-interpolation.log 35 | 36 | 37 | :: post processing:: merging all files 38 | for /D %%f in (%int_output_path%\*) DO ( 39 | echo %%f 40 | type %%f\*csv > %%f.csv 41 | rmdir /S /Q %%f 42 | ) 43 | type %int_output_path%\*.csv > %output_path%\interpolation\interpo_%%~nxf 44 | ) 45 | 46 | rmdir /S /Q %int_output_path% 47 | 48 | -------------------------------------------------------------------------------- /Interpolation/staypointreallocation.bat: -------------------------------------------------------------------------------- 1 | @echo off 2 | :: 2019-10-19 ****** Stay Point Reallocation ****** :: 3 | :: :: 4 | :: :: 5 | :: [Preparation] :: 6 | :: 1) Java 8 :: 7 | :: 2) input data from trip segment with padding :: 8 | 9 | :: ****************************************************** :: 10 | 11 | 12 | echo Stay Point Reallocation... 13 | 14 | set threadNum=2 15 | set logdir=log 16 | set output_path=output 17 | set idfile=id.csv 18 | set int_output_path=%output_path%\reallocation-temp 19 | set input_file=%1 20 | set poifile=parameters/relocation_pois.csv 21 | 22 | mkdir %logdir% 2> NUL 23 | mkdir %output_path% 2> NUL 24 | mkdir %int_output_path% 2> NUL 25 | mkdir %output_path%\reallocation 2> NUL 26 | 27 | echo start reallocation on %input_file% 28 | :: run trip reallocation (java) 29 | 30 | for %%f in (%input_file%\*) DO ( 31 | echo %%f 32 | 33 | java -Xmx2G -classpath .;lib/* jp.utokyo.shibalab.cdrworks.RelocationMain %threadNum% %poifile% %%f %int_output_path% 1> %logdir%/stdout-reallocation.log 2> %logdir%/stderr-reallocation.log 34 | 35 | :: post processing:: merging all files 36 | for /D %%f in (%int_output_path%\*) DO ( 37 | echo %%f 38 | type %%f\*csv > %%f.csv 39 | rmdir /S /Q %%f 40 | ) 41 | type %int_output_path%\*.csv > %output_path%\reallocation\reallo_%%~nxf 42 | ) 43 | 44 | rmdir /S /Q %int_output_path% 45 | 46 | -------------------------------------------------------------------------------- /Interpolation/tripsegmentation.bat: -------------------------------------------------------------------------------- 1 | @echo off 2 | :: 2019-10-19 ****** Trip Segmentation ****** :: 3 | :: :: 4 | :: :: 5 | :: [Preparation] :: 6 | :: 1) Java 8 :: 7 | :: 2) input data for trip segment :: 8 | 9 | :: ****************************************************** :: 10 | 11 | 12 | echo Trip segmentation... 13 | 14 | set threadNum=2 15 | set logdir=log 16 | set output_path=output 17 | set idfile=id.csv 18 | set int_output_path=%output_path%\trip-segment-temp 19 | set input_file=%1 20 | 21 | mkdir %logdir% 2> NUL 22 | mkdir %output_path% 2> NUL 23 | mkdir %int_output_path% 2> NUL 24 | mkdir %output_path%\tripsegment 2> NUL 25 | 26 | echo start segmetation on %input_file% 27 | :: run trip segmentation (java) 28 | 29 | for %%f in (%input_file%\*) DO ( 30 | echo %%f 31 | java -Xmx2G -classpath .;lib/* jp.utokyo.shibalab.cdrworks.TripSegmentationMain %threadNum% %idfile% %%f %int_output_path% 1> %logdir%/stdout-tripsegment.log 2> %logdir%/stderr-tripsegment.log 32 | 33 | :: post processing:: merging all files 34 | for /D %%f in (%int_output_path%\*) DO ( 35 | echo %%f 36 | type %%f\*csv > %%f.csv 37 | rmdir /S /Q %%f 38 | ) 39 | type %int_output_path%\*.csv > %output_path%\tripsegment\tripsegment_result_%%~nxf 40 | ) 41 | 42 | rmdir /S /Q %int_output_path% 43 | 44 | :: trip padding 45 | echo start trip padding 46 | set output_path_trippadding=%output_path%\trippadding-temp 47 | set output_path_tripsegment=%output_path%\tripsegment 48 | 49 | rmdir /S /Q %output_path_trippadding% 2> NUL 50 | mkdir %output_path_trippadding% 2> NUL 51 | mkdir %output_path%\trippadding 2> NUL 52 | 53 | for %%f in (%output_path%\tripsegment\*.csv) DO ( 54 | echo %%f 55 | java -Xmx2G -classpath .;lib/* jp.utokyo.shibalab.cdrworks.TripFormatterMain %threadNum% %%f %output_path_trippadding% 1> %logdir%/stdout-trippadding.log 2> %logdir%/stderr-trippadding.log 56 | 57 | :: post processing:: merging all files 58 | for /D %%f in (%output_path_trippadding%\*) DO ( 59 | echo %%f 60 | type %%f\*csv > %%f.csv 61 | ) 62 | type %output_path_trippadding%\*.csv > %output_path%\trippadding\pad_%%~nxf 63 | ) 64 | 65 | rmdir /S /Q %output_path_trippadding% 66 | 67 | 68 | 69 | 70 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2020 Spatial Data Commons 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # CDR Data Analysis Package (Standalone Edition) 2 | This is a set of software/tools for analysis of CDR (Call Detail Record) Data including anonymization, pre-processing, interpolation and visualization. It run in a standalone mode with multi-threads support for large data size. For faster processing and scalabiltiy support, please refer to Hadoop Edition (release soon!) 3 | 4 | **This repositoty is being update, some modules might not be available yet, keep checking!** 5 | 6 | ## Getting Started 7 | 8 | These instructions will get you a copy of the software package and running on your local machine. It can be run on both Windows and Mac as the software was developed by Java. 9 | 10 | ## Structure this package 11 | ``` 12 | ├─Common: 13 | │ A set of necessary libraries. 14 | │ 15 | ├─Anonymization: 16 | │ A tool for Anonymizing identifiable value in Data such as IMEI,IMSI, Mobile No. 17 | │ 18 | ├─Interpolation: 19 | | A set of software for route interpolation including 20 | | - Extracting stay points 21 | | - Extract tripsegment 22 | | - Relocation PoI 23 | | - Route Interpolation with transpotation network 24 | │ 25 | ├─Visualization: 26 | | A set of tools for drawing trajectory data on map and generating movie data 27 | | - Render Trajectory with Mobmap Web (no need installation) 28 | | - Render Trajectory with Mobmap App (Large Dataset, standalone application) 29 | | - Polygon-based aggregation with time-series (under development) 30 | │ 31 | ├─InfrastructureUpdates: 32 | | A set of tools for creating infrastructure data files/database 33 | | such as PoI data, Road Network Data, Voronoi of Cell Tower 34 | | 35 | 36 | ``` 37 | 38 | ## Prerequisites 39 | Java JDK 8 or higher 40 | 41 | ## Software List 42 | 43 | #### Anonymization 44 | * A tool for Anonymizing identifiable value in Data such as IMEI,IMSI, Mobile No. It is Java application which can be run in any operating system and also support running anonymization with multi-thread to speed up the process. Using a machine with a GPU will make encoding faster. 45 | * See the link: [Anonymization Tool](/Anonymization) 46 | ___ 47 | #### Interpolation 48 | * A set of software for route interpolation including extracting stay points, extract tripsegment, relocation POI and route Interpolation with transpotation network. CDR data are generated according to the usage of mobile phone such making a call, sending SMS, use internet. Hence, there is no data when no activity with mobile phone and resulting in missing movement information during those period. The route interpolation help to recover those missing part by accommodate road network with interpolation technique. 49 | * See the link: [Interpolation Package](/Interpolation) 50 | ___ 51 | #### Visualization - Mobmap Online 52 | * An online tool for visualization and analysis of movement/trajectory data such as GPS/CDR. with its functionally, it supports color labeling, various maker style and data filter. 53 | * See the link: [Mobmap Online](/Visualization/MobmapWeb) 54 | *** 55 | #### Visualization - Mobmap Win App 56 | * An windows application tool for visualization of movement/trajectory data such as GPS/CDR. It supports larger dataset compare to Mobmap Online. 57 | * See the link: [Mobmap Native Win ](/Visualization/MobMapNativeWin) 58 | *** 59 | #### Infrastructure Updates 60 | * A set of tools for creating/extracting infrastructure data files/database from OSM (Open Street Map) such as PoI data for reallocation, Road Network Data for route interpolation, Voronoi of Cell Tower 61 | * See the link: [Infrastructure Updates](/InfrastructureUpdates) 62 | *** 63 | 64 | 65 | ## Authors 66 | * Ryosuke Shibasaki 67 | * Hiroshi KANASUGI 68 | * Apichon Witayangkurn 69 | * Ayumi Arai 70 | * Satoshi Ueyama 71 | 72 | 73 | ## License 74 | This software is licensed under the MIT License. 75 | http://opensource.org/licenses/mit-license.php 76 | 77 | Copyright (c) 2020 Spatial Data Commons 78 | Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: 79 | The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. 80 | THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 81 | 82 | ## Acknowledgments 83 | 84 | * [Spatial Data Commons](http://sdc.csis.u-tokyo.ac.jp/), CSIS, The University of Tokyo 85 | * [Shibasaki Lab](https://shiba.iis.u-tokyo.ac.jp), The University of Tokyo 86 | * [Center for Spatial Information Science](http://www.csis.u-tokyo.ac.jp/en/), The University of Tokyo 87 | 88 | -------------------------------------------------------------------------------- /Visualization/MobMapNativeWin/MobMapNativeWin/MobmapNativeWin.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SpatialDataCommons/CDR-analysis-tools-std/68862be38af4bf21ef004683c9d16bb971068b0c/Visualization/MobMapNativeWin/MobMapNativeWin/MobmapNativeWin.exe -------------------------------------------------------------------------------- /Visualization/MobMapNativeWin/MobMapNativeWin/SDL.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SpatialDataCommons/CDR-analysis-tools-std/68862be38af4bf21ef004683c9d16bb971068b0c/Visualization/MobMapNativeWin/MobMapNativeWin/SDL.dll -------------------------------------------------------------------------------- /Visualization/MobMapNativeWin/MobMapNativeWin/SDL_image.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SpatialDataCommons/CDR-analysis-tools-std/68862be38af4bf21ef004683c9d16bb971068b0c/Visualization/MobMapNativeWin/MobMapNativeWin/SDL_image.dll -------------------------------------------------------------------------------- /Visualization/MobMapNativeWin/MobMapNativeWin/assets/clock-tex.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SpatialDataCommons/CDR-analysis-tools-std/68862be38af4bf21ef004683c9d16bb971068b0c/Visualization/MobMapNativeWin/MobMapNativeWin/assets/clock-tex.png -------------------------------------------------------------------------------- /Visualization/MobMapNativeWin/MobMapNativeWin/assets/mk-color-spot - ใ‚ณใƒ”ใƒผ.json: -------------------------------------------------------------------------------- 1 | { 2 | "cols": 2, 3 | "chip-width": 16, 4 | "chip-height": 16, 5 | "composite": "ADD" 6 | 7 | } -------------------------------------------------------------------------------- /Visualization/MobMapNativeWin/MobMapNativeWin/assets/mk-color-spot - ใ‚ณใƒ”ใƒผ.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SpatialDataCommons/CDR-analysis-tools-std/68862be38af4bf21ef004683c9d16bb971068b0c/Visualization/MobMapNativeWin/MobMapNativeWin/assets/mk-color-spot - ใ‚ณใƒ”ใƒผ.png -------------------------------------------------------------------------------- /Visualization/MobMapNativeWin/MobMapNativeWin/assets/mk-color-spot.json: -------------------------------------------------------------------------------- 1 | { 2 | "cols": 2, 3 | "chip-width": 8, 4 | "chip-height": 8, 5 | "composite": "ADD" 6 | 7 | } -------------------------------------------------------------------------------- /Visualization/MobMapNativeWin/MobMapNativeWin/assets/mk-color-spot.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SpatialDataCommons/CDR-analysis-tools-std/68862be38af4bf21ef004683c9d16bb971068b0c/Visualization/MobMapNativeWin/MobMapNativeWin/assets/mk-color-spot.png -------------------------------------------------------------------------------- /Visualization/MobMapNativeWin/MobMapNativeWin/assets/mk-red-strong-spot.json: -------------------------------------------------------------------------------- 1 | { 2 | "cols": 2, 3 | "chip-width": 16, 4 | "chip-height": 16, 5 | "composite": "ADD" 6 | } -------------------------------------------------------------------------------- /Visualization/MobMapNativeWin/MobMapNativeWin/assets/mk-red-strong-spot.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SpatialDataCommons/CDR-analysis-tools-std/68862be38af4bf21ef004683c9d16bb971068b0c/Visualization/MobMapNativeWin/MobMapNativeWin/assets/mk-red-strong-spot.png -------------------------------------------------------------------------------- /Visualization/MobMapNativeWin/MobMapNativeWin/assets/mk-strong-spot.json: -------------------------------------------------------------------------------- 1 | { 2 | "cols": 2, 3 | "chip-width": 16, 4 | "chip-height": 16, 5 | "composite": "ADD" 6 | } -------------------------------------------------------------------------------- /Visualization/MobMapNativeWin/MobMapNativeWin/assets/mk-strong-spot.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SpatialDataCommons/CDR-analysis-tools-std/68862be38af4bf21ef004683c9d16bb971068b0c/Visualization/MobMapNativeWin/MobMapNativeWin/assets/mk-strong-spot.png -------------------------------------------------------------------------------- /Visualization/MobMapNativeWin/MobMapNativeWin/glut32.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SpatialDataCommons/CDR-analysis-tools-std/68862be38af4bf21ef004683c9d16bb971068b0c/Visualization/MobMapNativeWin/MobMapNativeWin/glut32.dll -------------------------------------------------------------------------------- /Visualization/MobMapNativeWin/MobMapNativeWin/libjpeg-8.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SpatialDataCommons/CDR-analysis-tools-std/68862be38af4bf21ef004683c9d16bb971068b0c/Visualization/MobMapNativeWin/MobMapNativeWin/libjpeg-8.dll -------------------------------------------------------------------------------- /Visualization/MobMapNativeWin/MobMapNativeWin/libpng15-15.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SpatialDataCommons/CDR-analysis-tools-std/68862be38af4bf21ef004683c9d16bb971068b0c/Visualization/MobMapNativeWin/MobMapNativeWin/libpng15-15.dll -------------------------------------------------------------------------------- /Visualization/MobMapNativeWin/MobMapNativeWin/libtiff-5.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SpatialDataCommons/CDR-analysis-tools-std/68862be38af4bf21ef004683c9d16bb971068b0c/Visualization/MobMapNativeWin/MobMapNativeWin/libtiff-5.dll -------------------------------------------------------------------------------- /Visualization/MobMapNativeWin/MobMapNativeWin/libwebp-2.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SpatialDataCommons/CDR-analysis-tools-std/68862be38af4bf21ef004683c9d16bb971068b0c/Visualization/MobMapNativeWin/MobMapNativeWin/libwebp-2.dll -------------------------------------------------------------------------------- /Visualization/MobMapNativeWin/MobMapNativeWin/out/frames/0352.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SpatialDataCommons/CDR-analysis-tools-std/68862be38af4bf21ef004683c9d16bb971068b0c/Visualization/MobMapNativeWin/MobMapNativeWin/out/frames/0352.png -------------------------------------------------------------------------------- /Visualization/MobMapNativeWin/MobMapNativeWin/out/frames/0353.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SpatialDataCommons/CDR-analysis-tools-std/68862be38af4bf21ef004683c9d16bb971068b0c/Visualization/MobMapNativeWin/MobMapNativeWin/out/frames/0353.png -------------------------------------------------------------------------------- /Visualization/MobMapNativeWin/MobMapNativeWin/out/frames/0354.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SpatialDataCommons/CDR-analysis-tools-std/68862be38af4bf21ef004683c9d16bb971068b0c/Visualization/MobMapNativeWin/MobMapNativeWin/out/frames/0354.png -------------------------------------------------------------------------------- /Visualization/MobMapNativeWin/MobMapNativeWin/out/frames/0355.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SpatialDataCommons/CDR-analysis-tools-std/68862be38af4bf21ef004683c9d16bb971068b0c/Visualization/MobMapNativeWin/MobMapNativeWin/out/frames/0355.png -------------------------------------------------------------------------------- /Visualization/MobMapNativeWin/MobMapNativeWin/out/frames/0356.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SpatialDataCommons/CDR-analysis-tools-std/68862be38af4bf21ef004683c9d16bb971068b0c/Visualization/MobMapNativeWin/MobMapNativeWin/out/frames/0356.png -------------------------------------------------------------------------------- /Visualization/MobMapNativeWin/MobMapNativeWin/out/frames/0357.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SpatialDataCommons/CDR-analysis-tools-std/68862be38af4bf21ef004683c9d16bb971068b0c/Visualization/MobMapNativeWin/MobMapNativeWin/out/frames/0357.png -------------------------------------------------------------------------------- /Visualization/MobMapNativeWin/MobMapNativeWin/out/frames/0358.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SpatialDataCommons/CDR-analysis-tools-std/68862be38af4bf21ef004683c9d16bb971068b0c/Visualization/MobMapNativeWin/MobMapNativeWin/out/frames/0358.png -------------------------------------------------------------------------------- /Visualization/MobMapNativeWin/MobMapNativeWin/out/frames/0359.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SpatialDataCommons/CDR-analysis-tools-std/68862be38af4bf21ef004683c9d16bb971068b0c/Visualization/MobMapNativeWin/MobMapNativeWin/out/frames/0359.png -------------------------------------------------------------------------------- /Visualization/MobMapNativeWin/MobMapNativeWin/out/frames/0360.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SpatialDataCommons/CDR-analysis-tools-std/68862be38af4bf21ef004683c9d16bb971068b0c/Visualization/MobMapNativeWin/MobMapNativeWin/out/frames/0360.png -------------------------------------------------------------------------------- /Visualization/MobMapNativeWin/MobMapNativeWin/out/frames/0361.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SpatialDataCommons/CDR-analysis-tools-std/68862be38af4bf21ef004683c9d16bb971068b0c/Visualization/MobMapNativeWin/MobMapNativeWin/out/frames/0361.png -------------------------------------------------------------------------------- /Visualization/MobMapNativeWin/MobMapNativeWin/out/frames/0362.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SpatialDataCommons/CDR-analysis-tools-std/68862be38af4bf21ef004683c9d16bb971068b0c/Visualization/MobMapNativeWin/MobMapNativeWin/out/frames/0362.png -------------------------------------------------------------------------------- /Visualization/MobMapNativeWin/MobMapNativeWin/out/frames/0363.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SpatialDataCommons/CDR-analysis-tools-std/68862be38af4bf21ef004683c9d16bb971068b0c/Visualization/MobMapNativeWin/MobMapNativeWin/out/frames/0363.png -------------------------------------------------------------------------------- /Visualization/MobMapNativeWin/MobMapNativeWin/out/frames/0364.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SpatialDataCommons/CDR-analysis-tools-std/68862be38af4bf21ef004683c9d16bb971068b0c/Visualization/MobMapNativeWin/MobMapNativeWin/out/frames/0364.png -------------------------------------------------------------------------------- /Visualization/MobMapNativeWin/MobMapNativeWin/presets/sample.json: -------------------------------------------------------------------------------- 1 | { 2 | "global": { 3 | "base-map": { 4 | "lat": 35.23682656, 5 | "lng": 135.9392372, 6 | "zoom": 10 7 | }, 8 | 9 | "begin-time": 0, 10 | "end-time": 86400, 11 | "step": 40 12 | }, 13 | 14 | "layers": [ 15 | { 16 | "type": "MovingPoints", 17 | "source": "dataset/mobmap.csv", 18 | "marker": "Color-Spot", 19 | "appearance": "spot", 20 | "color-rule": "user-specified" 21 | } 22 | ] 23 | } 24 | -------------------------------------------------------------------------------- /Visualization/MobMapNativeWin/MobMapNativeWin/scripts/fetchBaseMap.rb: -------------------------------------------------------------------------------- 1 | #!/var/ruby19/bin/ruby 2 | 3 | API_BASE = "http://maps.google.co.jp/maps/api/staticmap?" 4 | API_KEY = "Please put google map key here" # updated at 2018.10.11 5 | TILE_SIZE = 640 6 | OVERLAP = 48 7 | DL_DIR = "./temp" 8 | OUT_DIR = "./temp" 9 | OUT_BASENAME = "basemap" 10 | 11 | def gmap_bround(v, min, max) 12 | return max if (v>max) 13 | return min if (v "all", 63 | "element" => "geometry", 64 | "saturation" => "-100", 65 | "invert_lightness" => "true", 66 | "lightness" => "0", 67 | "gamma" => "1" 68 | }) 69 | 70 | params << make_map_style({ 71 | "feature" => "all", 72 | "element" => "labels", 73 | "visibility" => "off" 74 | }) 75 | 76 | url = "#{API_BASE}#{params.join('&')}" 77 | 78 | require 'open-uri' 79 | open(url) {|f| 80 | File.open(outname, "wb") {|outf| 81 | outf.write(f.read) 82 | } 83 | } 84 | end 85 | 86 | def download_a_tile(x, y, z, index = 1, save_file = true) 87 | world_size = 2 ** (8 + z) 88 | x /= world_size.to_f 89 | y /= world_size.to_f 90 | 91 | r2d = 180.0 / Math::PI 92 | ll = convertXYtoLL(x, y) 93 | lat = ll[0] * r2d 94 | lng = ll[1] * r2d 95 | 96 | if save_file 97 | dlmap(lat, lng, z, "#{DL_DIR}/t#{index}.png") 98 | end 99 | end 100 | 101 | def bulk_dl(lat, lng, z) 102 | world_size = 2 ** (8 + z) 103 | xy = convertLLtoXY(lat, lng) 104 | xy[0] *= world_size.to_f 105 | xy[1] *= world_size.to_f 106 | 107 | x = xy[0] 108 | y = xy[1] 109 | hsize = TILE_SIZE >> 1 110 | download_a_tile(x - hsize, y - hsize, z, 1) 111 | download_a_tile(x + hsize, y - hsize, z, 2) 112 | download_a_tile(x - hsize, y + hsize - OVERLAP, z, 3) 113 | download_a_tile(x + hsize, y + hsize - OVERLAP, z, 4) 114 | 115 | require 'rubygems' 116 | require 'json' 117 | meta = Hash.new 118 | 119 | meta['center-lat'] = lat 120 | meta['center-lng'] = lng 121 | meta['zoom'] = z 122 | meta['overlap-height'] = OVERLAP 123 | 124 | return JSON.pretty_generate(meta) 125 | end 126 | 127 | def concat_image(filenames) 128 | require 'rubygems' 129 | require 'RMagick' 130 | 131 | outi = Magick::Image.new(TILE_SIZE*2, TILE_SIZE*2){ 132 | self.background_color = 'white' 133 | } 134 | 135 | images = filenames.map{|fn| 136 | Magick::ImageList.new(fn)[0] 137 | } 138 | 139 | images.length.times{|i| 140 | x = i%2 141 | y = (i/2).floor 142 | 143 | outi.composite!(images[i], TILE_SIZE * x, (TILE_SIZE - OVERLAP) *y, Magick::OverCompositeOp) 144 | } 145 | 146 | outi.write("#{OUT_DIR}/#{OUT_BASENAME}.png") 147 | end 148 | 149 | def ensure_dir(dname) 150 | if not File.exists?(dname) 151 | Dir::mkdir(dname) 152 | end 153 | end 154 | 155 | def save_meta(s) 156 | File.open("#{OUT_DIR}/#{OUT_BASENAME}.json", "w") {|f| 157 | f.write(s) 158 | } 159 | end 160 | 161 | 162 | center_pos = ARGV 163 | ensure_dir(DL_DIR) 164 | meta_json = bulk_dl(center_pos[0].to_f, center_pos[1].to_f, center_pos[2].to_i) 165 | save_meta(meta_json) 166 | #concat_image([ 167 | # "#{DL_DIR}/t1.png", 168 | # "#{DL_DIR}/t2.png", 169 | # "#{DL_DIR}/t3.png", 170 | # "#{DL_DIR}/t4.png" 171 | #]) 172 | -------------------------------------------------------------------------------- /Visualization/MobMapNativeWin/MobMapNativeWin/scripts/fetchBaseMap_bk20191003.rb: -------------------------------------------------------------------------------- 1 | #!/var/ruby19/bin/ruby 2 | 3 | API_BASE = "http://maps.google.co.jp/maps/api/staticmap?" 4 | TILE_SIZE = 640 5 | OVERLAP = 48 6 | DL_DIR = "./temp" 7 | OUT_DIR = "./temp" 8 | OUT_BASENAME = "basemap" 9 | 10 | def gmap_bround(v, min, max) 11 | return max if (v>max) 12 | return min if (v "all", 60 | "element" => "all", 61 | "saturation" => "-99", 62 | "invert_lightness" => "true", 63 | "lightness" => "-59", 64 | "gamma" => "1" 65 | }) 66 | 67 | url = "#{API_BASE}#{params.join('&')}" 68 | 69 | require 'open-uri' 70 | open(url) {|f| 71 | File.open(outname, "wb") {|outf| 72 | outf.write(f.read) 73 | } 74 | } 75 | end 76 | 77 | def download_a_tile(x, y, z, index = 1, save_file = true) 78 | world_size = 2 ** (8 + z) 79 | x /= world_size.to_f 80 | y /= world_size.to_f 81 | 82 | r2d = 180.0 / Math::PI 83 | ll = convertXYtoLL(x, y) 84 | lat = ll[0] * r2d 85 | lng = ll[1] * r2d 86 | 87 | if save_file 88 | dlmap(lat, lng, z, "#{DL_DIR}/t#{index}.png") 89 | end 90 | end 91 | 92 | def bulk_dl(lat, lng, z) 93 | world_size = 2 ** (8 + z) 94 | xy = convertLLtoXY(lat, lng) 95 | xy[0] *= world_size.to_f 96 | xy[1] *= world_size.to_f 97 | 98 | x = xy[0] 99 | y = xy[1] 100 | hsize = TILE_SIZE >> 1 101 | download_a_tile(x - hsize, y - hsize, z, 1) 102 | download_a_tile(x + hsize, y - hsize, z, 2) 103 | download_a_tile(x - hsize, y + hsize - OVERLAP, z, 3) 104 | download_a_tile(x + hsize, y + hsize - OVERLAP, z, 4) 105 | 106 | require 'rubygems' 107 | require 'json' 108 | meta = Hash.new 109 | 110 | meta['center-lat'] = lat 111 | meta['center-lng'] = lng 112 | meta['zoom'] = z 113 | meta['overlap-height'] = OVERLAP 114 | 115 | return JSON.pretty_generate(meta) 116 | end 117 | 118 | def concat_image(filenames) 119 | require 'rubygems' 120 | require 'RMagick' 121 | 122 | outi = Magick::Image.new(TILE_SIZE*2, TILE_SIZE*2){ 123 | self.background_color = 'white' 124 | } 125 | 126 | images = filenames.map{|fn| 127 | Magick::ImageList.new(fn)[0] 128 | } 129 | 130 | images.length.times{|i| 131 | x = i%2 132 | y = (i/2).floor 133 | 134 | outi.composite!(images[i], TILE_SIZE * x, (TILE_SIZE - OVERLAP) *y, Magick::OverCompositeOp) 135 | } 136 | 137 | outi.write("#{OUT_DIR}/#{OUT_BASENAME}.png") 138 | end 139 | 140 | def ensure_dir(dname) 141 | if not File.exists?(dname) 142 | Dir::mkdir(dname) 143 | end 144 | end 145 | 146 | def save_meta(s) 147 | File.open("#{OUT_DIR}/#{OUT_BASENAME}.json", "w") {|f| 148 | f.write(s) 149 | } 150 | end 151 | 152 | 153 | center_pos = ARGV 154 | ensure_dir(DL_DIR) 155 | meta_json = bulk_dl(center_pos[0].to_f, center_pos[1].to_f, center_pos[2].to_i) 156 | save_meta(meta_json) 157 | #concat_image([ 158 | # "#{DL_DIR}/t1.png", 159 | # "#{DL_DIR}/t2.png", 160 | # "#{DL_DIR}/t3.png", 161 | # "#{DL_DIR}/t4.png" 162 | #]) 163 | -------------------------------------------------------------------------------- /Visualization/MobMapNativeWin/MobMapNativeWin/temp/basemap.json: -------------------------------------------------------------------------------- 1 | { 2 | "center-lat": 39.546412, 3 | "center-lng": 140.822754, 4 | "zoom": 9, 5 | "overlap-height": 48 6 | } -------------------------------------------------------------------------------- /Visualization/MobMapNativeWin/MobMapNativeWin/temp/basemap.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SpatialDataCommons/CDR-analysis-tools-std/68862be38af4bf21ef004683c9d16bb971068b0c/Visualization/MobMapNativeWin/MobMapNativeWin/temp/basemap.png -------------------------------------------------------------------------------- /Visualization/MobMapNativeWin/MobMapNativeWin/temp/t1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SpatialDataCommons/CDR-analysis-tools-std/68862be38af4bf21ef004683c9d16bb971068b0c/Visualization/MobMapNativeWin/MobMapNativeWin/temp/t1.png -------------------------------------------------------------------------------- /Visualization/MobMapNativeWin/MobMapNativeWin/temp/t2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SpatialDataCommons/CDR-analysis-tools-std/68862be38af4bf21ef004683c9d16bb971068b0c/Visualization/MobMapNativeWin/MobMapNativeWin/temp/t2.png -------------------------------------------------------------------------------- /Visualization/MobMapNativeWin/MobMapNativeWin/temp/t3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SpatialDataCommons/CDR-analysis-tools-std/68862be38af4bf21ef004683c9d16bb971068b0c/Visualization/MobMapNativeWin/MobMapNativeWin/temp/t3.png -------------------------------------------------------------------------------- /Visualization/MobMapNativeWin/MobMapNativeWin/temp/t4.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SpatialDataCommons/CDR-analysis-tools-std/68862be38af4bf21ef004683c9d16bb971068b0c/Visualization/MobMapNativeWin/MobMapNativeWin/temp/t4.png -------------------------------------------------------------------------------- /Visualization/MobMapNativeWin/MobMapNativeWin/zlib1.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SpatialDataCommons/CDR-analysis-tools-std/68862be38af4bf21ef004683c9d16bb971068b0c/Visualization/MobMapNativeWin/MobMapNativeWin/zlib1.dll -------------------------------------------------------------------------------- /Visualization/MobMapNativeWin/README.md: -------------------------------------------------------------------------------- 1 | # MobmapNativeWin: Visualization Movement Data 2 | An windows application tool for visualization and analysis of movement/trajectory data such as GPS/CDR. with its functionally, it supports large dataset. 3 | 4 | ![Screenshot](SampleOutput/frames/0352.png) 5 | 6 | 7 | ## Prerequisites 8 | * Ruby 2.6+ ([https://rubyinstaller.org](https://rubyinstaller.org)) 9 | * Google Map Token Key with static map enable 10 | ([https://developers.google.com/maps/documentation/javascript/get-api-key](https://developers.google.com/maps/documentation/javascript/get-api-key)) 11 | 12 | ## Usage 13 | 1. Open "run.bat" and update Ruby path 14 | ``` 15 | :: [check and modify if required] *********************** :: 16 | :: update path configuration of ruby :: 17 | :: ****************************************************** :: 18 | set PATH=%PATH%;C:\ruby\Ruby26\bin 19 | ... 20 | ``` 21 | 2. In MobMapNativeWin\scripts\fetchBaseMap.rb, input your google token key 22 | ``` 23 | #!/var/ruby19/bin/ruby 24 | 25 | API_BASE = "http://maps.google.co.jp/maps/api/staticmap?" 26 | API_KEY = "put your google token key" # updated here 27 | TILE_SIZE = 640 28 | OVERLAP = 48 29 | DL_DIR = "./temp" 30 | OUT_DIR = "./temp" 31 | OUT_BASENAME = "basemap" 32 | ... 33 | ``` 34 | 3. In MobMapNativeWin\presets\preset\sample.json, update parameters 35 | ``` 36 | { 37 | "global": { 38 | "base-map": { ## Specify center of map for rendering 39 | "lat": 39.546412, 40 | "lng": 140.822754, 41 | "zoom": 9 ## Specify zoom level 42 | }, 43 | 44 | "begin-time": 0, ## Specify start time in seconds 45 | "end-time": 86400, ## Specify end time in seconds 46 | "step": 40 ## Specify moving step in seconds 47 | }, 48 | 49 | "layers": [ 50 | { 51 | "type": "MovingPoints", 52 | "source": "dataset/gps.csv", ## Specify data for rendering 53 | "marker": "Color-Spot", 54 | "appearance": "spot", ## spot, tail, tail+spot 55 | "color-rule": "user-specified" 56 | } 57 | ] 58 | } 59 | ``` 60 | 4. Open command prompt (cmd) and goto program path, then run "run.bat" 61 | ``` 62 | C:\>cd \Test\MobMapNativeWin-full 63 | C:\Test\MobMapNativeWin-full>run.bat 64 | 65 | ``` 66 | 5. Output will be in path "MobMapNativeWin\out" 67 | ``` 68 | out\frames ## output in PNG image of each frame 69 | out\movies ## output in mp4 created from image frames using ffmpeg 70 | ``` 71 | 72 | ## Input File (CSV) 73 | 74 | * The inpurt file must be in CSV format with comma separated. 75 | * File must contain at least the following attributes. 76 | ``` 77 | Object ID : Positive Integer value 78 | Time : “YYYY/MM/DD hh:mm:ss ” format need to be sort in time order 79 | Longitude : Real decimal degree) in WGS84 80 | Latitude : Real Number(decimal degree) in WGS84 81 | marker-color : Color code in decimal notation 82 | ``` 83 | * No Header in file. 84 | 85 | 86 | 87 | ## Author 88 | * **Satoshi Ueyama** : A project researcher at Center for Spatial Information Science, University of Tokyo, Japan until Oct. 2019, will be a researcher at LocationMind Inc. from Nov. 2019. 89 | In 2019 he obtained his Ph.D. in Engineering from the University of Tokyo. And he is interested in utilizing visualization and computer graphics in the field of geographic information. 90 | 91 | * **Hiroshi KANASUGI** : A project researcher at Center for Spatial Information Science, University of Tokyo. 92 | 93 | ## License 94 | 95 | Free to use 96 | 97 | ## Acknowledgments 98 | * [Spatial Data Commons](http://sdc.csis.u-tokyo.ac.jp/), CSIS, The University of Tokyo 99 | * [Shibasaki Lab](https://shiba.iis.u-tokyo.ac.jp), The University of Tokyo 100 | * [Center for Spatial Information Science](http://www.csis.u-tokyo.ac.jp/en/), The University of Tokyo 101 | 102 | 103 | -------------------------------------------------------------------------------- /Visualization/MobMapNativeWin/SampleOutput/frames/0352.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SpatialDataCommons/CDR-analysis-tools-std/68862be38af4bf21ef004683c9d16bb971068b0c/Visualization/MobMapNativeWin/SampleOutput/frames/0352.png -------------------------------------------------------------------------------- /Visualization/MobMapNativeWin/SampleOutput/frames/0353.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SpatialDataCommons/CDR-analysis-tools-std/68862be38af4bf21ef004683c9d16bb971068b0c/Visualization/MobMapNativeWin/SampleOutput/frames/0353.png -------------------------------------------------------------------------------- /Visualization/MobMapNativeWin/SampleOutput/frames/0354.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SpatialDataCommons/CDR-analysis-tools-std/68862be38af4bf21ef004683c9d16bb971068b0c/Visualization/MobMapNativeWin/SampleOutput/frames/0354.png -------------------------------------------------------------------------------- /Visualization/MobMapNativeWin/SampleOutput/frames/0355.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SpatialDataCommons/CDR-analysis-tools-std/68862be38af4bf21ef004683c9d16bb971068b0c/Visualization/MobMapNativeWin/SampleOutput/frames/0355.png -------------------------------------------------------------------------------- /Visualization/MobMapNativeWin/SampleOutput/frames/0356.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SpatialDataCommons/CDR-analysis-tools-std/68862be38af4bf21ef004683c9d16bb971068b0c/Visualization/MobMapNativeWin/SampleOutput/frames/0356.png -------------------------------------------------------------------------------- /Visualization/MobMapNativeWin/SampleOutput/frames/0357.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SpatialDataCommons/CDR-analysis-tools-std/68862be38af4bf21ef004683c9d16bb971068b0c/Visualization/MobMapNativeWin/SampleOutput/frames/0357.png -------------------------------------------------------------------------------- /Visualization/MobMapNativeWin/SampleOutput/frames/0358.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SpatialDataCommons/CDR-analysis-tools-std/68862be38af4bf21ef004683c9d16bb971068b0c/Visualization/MobMapNativeWin/SampleOutput/frames/0358.png -------------------------------------------------------------------------------- /Visualization/MobMapNativeWin/SampleOutput/frames/0359.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SpatialDataCommons/CDR-analysis-tools-std/68862be38af4bf21ef004683c9d16bb971068b0c/Visualization/MobMapNativeWin/SampleOutput/frames/0359.png -------------------------------------------------------------------------------- /Visualization/MobMapNativeWin/SampleOutput/frames/0360.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SpatialDataCommons/CDR-analysis-tools-std/68862be38af4bf21ef004683c9d16bb971068b0c/Visualization/MobMapNativeWin/SampleOutput/frames/0360.png -------------------------------------------------------------------------------- /Visualization/MobMapNativeWin/SampleOutput/frames/0361.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SpatialDataCommons/CDR-analysis-tools-std/68862be38af4bf21ef004683c9d16bb971068b0c/Visualization/MobMapNativeWin/SampleOutput/frames/0361.png -------------------------------------------------------------------------------- /Visualization/MobMapNativeWin/SampleOutput/frames/0362.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SpatialDataCommons/CDR-analysis-tools-std/68862be38af4bf21ef004683c9d16bb971068b0c/Visualization/MobMapNativeWin/SampleOutput/frames/0362.png -------------------------------------------------------------------------------- /Visualization/MobMapNativeWin/SampleOutput/frames/0363.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SpatialDataCommons/CDR-analysis-tools-std/68862be38af4bf21ef004683c9d16bb971068b0c/Visualization/MobMapNativeWin/SampleOutput/frames/0363.png -------------------------------------------------------------------------------- /Visualization/MobMapNativeWin/SampleOutput/frames/0364.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SpatialDataCommons/CDR-analysis-tools-std/68862be38af4bf21ef004683c9d16bb971068b0c/Visualization/MobMapNativeWin/SampleOutput/frames/0364.png -------------------------------------------------------------------------------- /Visualization/MobMapNativeWin/SampleOutput/result.mp4: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SpatialDataCommons/CDR-analysis-tools-std/68862be38af4bf21ef004683c9d16bb971068b0c/Visualization/MobMapNativeWin/SampleOutput/result.mp4 -------------------------------------------------------------------------------- /Visualization/MobMapNativeWin/ffmpeg/README.txt: -------------------------------------------------------------------------------- 1 | This is a FFmpeg Win64 static build by Kyle Schwarz. 2 | 3 | Zeranoe's FFmpeg Builds Home Page: 4 | 5 | This build was compiled on: Jul 2 2013, at: 22:21:00 6 | 7 | FFmpeg version: 2013-07-03 git-e0be3cb 8 | libavutil 52. 38.100 / 52. 38.100 9 | libavcodec 55. 18.100 / 55. 18.100 10 | libavformat 55. 11.100 / 55. 11.100 11 | libavdevice 55. 2.100 / 55. 2.100 12 | libavfilter 3. 77.101 / 3. 77.101 13 | libswscale 2. 3.100 / 2. 3.100 14 | libswresample 0. 17.102 / 0. 17.102 15 | libpostproc 52. 3.100 / 52. 3.100 16 | 17 | This FFmpeg build was configured with: 18 | --enable-gpl 19 | --enable-version3 20 | --disable-w32threads 21 | --enable-avisynth 22 | --enable-bzlib 23 | --enable-fontconfig 24 | --enable-frei0r 25 | --enable-gnutls 26 | --enable-iconv 27 | --enable-libass 28 | --enable-libbluray 29 | --enable-libcaca 30 | --enable-libfreetype 31 | --enable-libgsm 32 | --enable-libilbc 33 | --enable-libmodplug 34 | --enable-libmp3lame 35 | --enable-libopencore-amrnb 36 | --enable-libopencore-amrwb 37 | --enable-libopenjpeg 38 | --enable-libopus 39 | --enable-librtmp 40 | --enable-libschroedinger 41 | --enable-libsoxr 42 | --enable-libspeex 43 | --enable-libtheora 44 | --enable-libtwolame 45 | --enable-libvo-aacenc 46 | --enable-libvo-amrwbenc 47 | --enable-libvorbis 48 | --enable-libvpx 49 | --enable-libx264 50 | --enable-libxavs 51 | --enable-libxvid 52 | --enable-zlib 53 | 54 | This build was compiled with the following external libraries: 55 | bzip2 1.0.6 56 | Fontconfig 2.10.93 57 | Frei0r 20130321-git-245bb38 58 | GnuTLS 3.1.9 59 | libiconv 1.14 60 | libass 0.10.1 61 | libbluray 0.3.0 62 | libcaca 0.99.beta18 63 | FreeType 2.4.12 64 | GSM 1.0.13-4 65 | iLBC 20120913-git-b5f9b10 66 | Modplug-XMMS 0.8.8.4 67 | LAME 3.99.5 68 | OpenCORE AMR 0.1.3 69 | OpenJPEG 1.5.1 70 | Opus 1.0.2 71 | RTMPDump 20121230-git-df6c518 72 | Schroedinger 1.0.11 73 | libsoxr 0.1.1 74 | Speex 1.2rc1 75 | Theora 1.1.1 76 | TwoLAME 0.3.13 77 | VisualOn AAC 0.1.2 78 | VisualOn AMR-WB 0.1.2 79 | Vorbis 1.3.3 80 | vpx 1.2.0 81 | x264 20130520-git-a3ac64b 82 | XAVS svn-r55 83 | Xvid 1.3.2 84 | zlib 1.2.8 85 | 86 | The source code for this FFmpeg build can be found at: 87 | 88 | This build was compiled on Debian 7.1 (64-bit): 89 | 90 | GCC 4.7.3 was used to compile this FFmpeg build: 91 | 92 | This build was compiled using the MinGW-w64 toolchain: 93 | 94 | Licenses for each library can be found in the 'licenses' folder. 95 | -------------------------------------------------------------------------------- /Visualization/MobMapNativeWin/ffmpeg/bin/ffmpeg.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SpatialDataCommons/CDR-analysis-tools-std/68862be38af4bf21ef004683c9d16bb971068b0c/Visualization/MobMapNativeWin/ffmpeg/bin/ffmpeg.exe -------------------------------------------------------------------------------- /Visualization/MobMapNativeWin/ffmpeg/bin/ffplay.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SpatialDataCommons/CDR-analysis-tools-std/68862be38af4bf21ef004683c9d16bb971068b0c/Visualization/MobMapNativeWin/ffmpeg/bin/ffplay.exe -------------------------------------------------------------------------------- /Visualization/MobMapNativeWin/ffmpeg/bin/ffprobe.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SpatialDataCommons/CDR-analysis-tools-std/68862be38af4bf21ef004683c9d16bb971068b0c/Visualization/MobMapNativeWin/ffmpeg/bin/ffprobe.exe -------------------------------------------------------------------------------- /Visualization/MobMapNativeWin/ffmpeg/doc/examples/Makefile: -------------------------------------------------------------------------------- 1 | # use pkg-config for getting CFLAGS and LDLIBS 2 | FFMPEG_LIBS= libavdevice \ 3 | libavformat \ 4 | libavfilter \ 5 | libavcodec \ 6 | libswresample \ 7 | libswscale \ 8 | libavutil \ 9 | 10 | CFLAGS += -Wall -g 11 | CFLAGS := $(shell pkg-config --cflags $(FFMPEG_LIBS)) $(CFLAGS) 12 | LDLIBS := $(shell pkg-config --libs $(FFMPEG_LIBS)) $(LDLIBS) 13 | 14 | EXAMPLES= decoding_encoding \ 15 | demuxing \ 16 | filtering_video \ 17 | filtering_audio \ 18 | metadata \ 19 | muxing \ 20 | resampling_audio \ 21 | scaling_video \ 22 | 23 | OBJS=$(addsuffix .o,$(EXAMPLES)) 24 | 25 | # the following examples make explicit use of the math library 26 | decoding_encoding: LDLIBS += -lm 27 | muxing: LDLIBS += -lm 28 | 29 | .phony: all clean-test clean 30 | 31 | all: $(OBJS) $(EXAMPLES) 32 | 33 | clean-test: 34 | $(RM) test*.pgm test.h264 test.mp2 test.sw test.mpg 35 | 36 | clean: clean-test 37 | $(RM) $(EXAMPLES) $(OBJS) 38 | -------------------------------------------------------------------------------- /Visualization/MobMapNativeWin/ffmpeg/doc/examples/README: -------------------------------------------------------------------------------- 1 | FFmpeg examples README 2 | ---------------------- 3 | 4 | Both following use cases rely on pkg-config and make, thus make sure 5 | that you have them installed and working on your system. 6 | 7 | 8 | 1) Build the installed examples in a generic read/write user directory 9 | 10 | Copy to a read/write user directory and just use "make", it will link 11 | to the libraries on your system, assuming the PKG_CONFIG_PATH is 12 | correctly configured. 13 | 14 | 2) Build the examples in-tree 15 | 16 | Assuming you are in the source FFmpeg checkout directory, you need to build 17 | FFmpeg (no need to make install in any prefix). Then you can go into the 18 | doc/examples and run a command such as PKG_CONFIG_PATH=pc-uninstalled make. 19 | -------------------------------------------------------------------------------- /Visualization/MobMapNativeWin/ffmpeg/doc/examples/filtering_video.c: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2010 Nicolas George 3 | * Copyright (c) 2011 Stefano Sabatini 4 | * 5 | * Permission is hereby granted, free of charge, to any person obtaining a copy 6 | * of this software and associated documentation files (the "Software"), to deal 7 | * in the Software without restriction, including without limitation the rights 8 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | * copies of the Software, and to permit persons to whom the Software is 10 | * furnished to do so, subject to the following conditions: 11 | * 12 | * The above copyright notice and this permission notice shall be included in 13 | * all copies or substantial portions of the Software. 14 | * 15 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL 18 | * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 21 | * THE SOFTWARE. 22 | */ 23 | 24 | /** 25 | * @file 26 | * API example for decoding and filtering 27 | * @example doc/examples/filtering_video.c 28 | */ 29 | 30 | #define _XOPEN_SOURCE 600 /* for usleep */ 31 | #include 32 | 33 | #include 34 | #include 35 | #include 36 | #include 37 | #include 38 | #include 39 | 40 | const char *filter_descr = "scale=78:24"; 41 | 42 | static AVFormatContext *fmt_ctx; 43 | static AVCodecContext *dec_ctx; 44 | AVFilterContext *buffersink_ctx; 45 | AVFilterContext *buffersrc_ctx; 46 | AVFilterGraph *filter_graph; 47 | static int video_stream_index = -1; 48 | static int64_t last_pts = AV_NOPTS_VALUE; 49 | 50 | static int open_input_file(const char *filename) 51 | { 52 | int ret; 53 | AVCodec *dec; 54 | 55 | if ((ret = avformat_open_input(&fmt_ctx, filename, NULL, NULL)) < 0) { 56 | av_log(NULL, AV_LOG_ERROR, "Cannot open input file\n"); 57 | return ret; 58 | } 59 | 60 | if ((ret = avformat_find_stream_info(fmt_ctx, NULL)) < 0) { 61 | av_log(NULL, AV_LOG_ERROR, "Cannot find stream information\n"); 62 | return ret; 63 | } 64 | 65 | /* select the video stream */ 66 | ret = av_find_best_stream(fmt_ctx, AVMEDIA_TYPE_VIDEO, -1, -1, &dec, 0); 67 | if (ret < 0) { 68 | av_log(NULL, AV_LOG_ERROR, "Cannot find a video stream in the input file\n"); 69 | return ret; 70 | } 71 | video_stream_index = ret; 72 | dec_ctx = fmt_ctx->streams[video_stream_index]->codec; 73 | 74 | /* init the video decoder */ 75 | if ((ret = avcodec_open2(dec_ctx, dec, NULL)) < 0) { 76 | av_log(NULL, AV_LOG_ERROR, "Cannot open video decoder\n"); 77 | return ret; 78 | } 79 | 80 | return 0; 81 | } 82 | 83 | static int init_filters(const char *filters_descr) 84 | { 85 | char args[512]; 86 | int ret; 87 | AVFilter *buffersrc = avfilter_get_by_name("buffer"); 88 | AVFilter *buffersink = avfilter_get_by_name("buffersink"); 89 | AVFilterInOut *outputs = avfilter_inout_alloc(); 90 | AVFilterInOut *inputs = avfilter_inout_alloc(); 91 | enum AVPixelFormat pix_fmts[] = { AV_PIX_FMT_GRAY8, AV_PIX_FMT_NONE }; 92 | AVBufferSinkParams *buffersink_params; 93 | 94 | filter_graph = avfilter_graph_alloc(); 95 | 96 | /* buffer video source: the decoded frames from the decoder will be inserted here. */ 97 | snprintf(args, sizeof(args), 98 | "video_size=%dx%d:pix_fmt=%d:time_base=%d/%d:pixel_aspect=%d/%d", 99 | dec_ctx->width, dec_ctx->height, dec_ctx->pix_fmt, 100 | dec_ctx->time_base.num, dec_ctx->time_base.den, 101 | dec_ctx->sample_aspect_ratio.num, dec_ctx->sample_aspect_ratio.den); 102 | 103 | ret = avfilter_graph_create_filter(&buffersrc_ctx, buffersrc, "in", 104 | args, NULL, filter_graph); 105 | if (ret < 0) { 106 | av_log(NULL, AV_LOG_ERROR, "Cannot create buffer source\n"); 107 | return ret; 108 | } 109 | 110 | /* buffer video sink: to terminate the filter chain. */ 111 | buffersink_params = av_buffersink_params_alloc(); 112 | buffersink_params->pixel_fmts = pix_fmts; 113 | ret = avfilter_graph_create_filter(&buffersink_ctx, buffersink, "out", 114 | NULL, buffersink_params, filter_graph); 115 | av_free(buffersink_params); 116 | if (ret < 0) { 117 | av_log(NULL, AV_LOG_ERROR, "Cannot create buffer sink\n"); 118 | return ret; 119 | } 120 | 121 | /* Endpoints for the filter graph. */ 122 | outputs->name = av_strdup("in"); 123 | outputs->filter_ctx = buffersrc_ctx; 124 | outputs->pad_idx = 0; 125 | outputs->next = NULL; 126 | 127 | inputs->name = av_strdup("out"); 128 | inputs->filter_ctx = buffersink_ctx; 129 | inputs->pad_idx = 0; 130 | inputs->next = NULL; 131 | 132 | if ((ret = avfilter_graph_parse(filter_graph, filters_descr, 133 | &inputs, &outputs, NULL)) < 0) 134 | return ret; 135 | 136 | if ((ret = avfilter_graph_config(filter_graph, NULL)) < 0) 137 | return ret; 138 | return 0; 139 | } 140 | 141 | static void display_frame(const AVFrame *frame, AVRational time_base) 142 | { 143 | int x, y; 144 | uint8_t *p0, *p; 145 | int64_t delay; 146 | 147 | if (frame->pts != AV_NOPTS_VALUE) { 148 | if (last_pts != AV_NOPTS_VALUE) { 149 | /* sleep roughly the right amount of time; 150 | * usleep is in microseconds, just like AV_TIME_BASE. */ 151 | delay = av_rescale_q(frame->pts - last_pts, 152 | time_base, AV_TIME_BASE_Q); 153 | if (delay > 0 && delay < 1000000) 154 | usleep(delay); 155 | } 156 | last_pts = frame->pts; 157 | } 158 | 159 | /* Trivial ASCII grayscale display. */ 160 | p0 = frame->data[0]; 161 | puts("\033c"); 162 | for (y = 0; y < frame->height; y++) { 163 | p = p0; 164 | for (x = 0; x < frame->width; x++) 165 | putchar(" .-+#"[*(p++) / 52]); 166 | putchar('\n'); 167 | p0 += frame->linesize[0]; 168 | } 169 | fflush(stdout); 170 | } 171 | 172 | int main(int argc, char **argv) 173 | { 174 | int ret; 175 | AVPacket packet; 176 | AVFrame *frame = av_frame_alloc(); 177 | AVFrame *filt_frame = av_frame_alloc(); 178 | int got_frame; 179 | 180 | if (!frame || !filt_frame) { 181 | perror("Could not allocate frame"); 182 | exit(1); 183 | } 184 | if (argc != 2) { 185 | fprintf(stderr, "Usage: %s file\n", argv[0]); 186 | exit(1); 187 | } 188 | 189 | avcodec_register_all(); 190 | av_register_all(); 191 | avfilter_register_all(); 192 | 193 | if ((ret = open_input_file(argv[1])) < 0) 194 | goto end; 195 | if ((ret = init_filters(filter_descr)) < 0) 196 | goto end; 197 | 198 | /* read all packets */ 199 | while (1) { 200 | if ((ret = av_read_frame(fmt_ctx, &packet)) < 0) 201 | break; 202 | 203 | if (packet.stream_index == video_stream_index) { 204 | avcodec_get_frame_defaults(frame); 205 | got_frame = 0; 206 | ret = avcodec_decode_video2(dec_ctx, frame, &got_frame, &packet); 207 | if (ret < 0) { 208 | av_log(NULL, AV_LOG_ERROR, "Error decoding video\n"); 209 | break; 210 | } 211 | 212 | if (got_frame) { 213 | frame->pts = av_frame_get_best_effort_timestamp(frame); 214 | 215 | /* push the decoded frame into the filtergraph */ 216 | if (av_buffersrc_add_frame_flags(buffersrc_ctx, frame, AV_BUFFERSRC_FLAG_KEEP_REF) < 0) { 217 | av_log(NULL, AV_LOG_ERROR, "Error while feeding the filtergraph\n"); 218 | break; 219 | } 220 | 221 | /* pull filtered frames from the filtergraph */ 222 | while (1) { 223 | ret = av_buffersink_get_frame(buffersink_ctx, filt_frame); 224 | if (ret == AVERROR(EAGAIN) || ret == AVERROR_EOF) 225 | break; 226 | if (ret < 0) 227 | goto end; 228 | display_frame(filt_frame, buffersink_ctx->inputs[0]->time_base); 229 | av_frame_unref(filt_frame); 230 | } 231 | } 232 | } 233 | av_free_packet(&packet); 234 | } 235 | end: 236 | avfilter_graph_free(&filter_graph); 237 | if (dec_ctx) 238 | avcodec_close(dec_ctx); 239 | avformat_close_input(&fmt_ctx); 240 | av_frame_free(&frame); 241 | av_frame_free(&filt_frame); 242 | 243 | if (ret < 0 && ret != AVERROR_EOF) { 244 | char buf[1024]; 245 | av_strerror(ret, buf, sizeof(buf)); 246 | fprintf(stderr, "Error occurred: %s\n", buf); 247 | exit(1); 248 | } 249 | 250 | exit(0); 251 | } 252 | -------------------------------------------------------------------------------- /Visualization/MobMapNativeWin/ffmpeg/doc/examples/metadata.c: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2011 Reinhard Tartler 3 | * 4 | * Permission is hereby granted, free of charge, to any person obtaining a copy 5 | * of this software and associated documentation files (the "Software"), to deal 6 | * in the Software without restriction, including without limitation the rights 7 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 8 | * copies of the Software, and to permit persons to whom the Software is 9 | * furnished to do so, subject to the following conditions: 10 | * 11 | * The above copyright notice and this permission notice shall be included in 12 | * all copies or substantial portions of the Software. 13 | * 14 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL 17 | * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 18 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 19 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 20 | * THE SOFTWARE. 21 | */ 22 | 23 | /** 24 | * @file 25 | * Shows how the metadata API can be used in application programs. 26 | * @example doc/examples/metadata.c 27 | */ 28 | 29 | #include 30 | 31 | #include 32 | #include 33 | 34 | int main (int argc, char **argv) 35 | { 36 | AVFormatContext *fmt_ctx = NULL; 37 | AVDictionaryEntry *tag = NULL; 38 | int ret; 39 | 40 | if (argc != 2) { 41 | printf("usage: %s \n" 42 | "example program to demonstrate the use of the libavformat metadata API.\n" 43 | "\n", argv[0]); 44 | return 1; 45 | } 46 | 47 | av_register_all(); 48 | if ((ret = avformat_open_input(&fmt_ctx, argv[1], NULL, NULL))) 49 | return ret; 50 | 51 | while ((tag = av_dict_get(fmt_ctx->metadata, "", tag, AV_DICT_IGNORE_SUFFIX))) 52 | printf("%s=%s\n", tag->key, tag->value); 53 | 54 | avformat_close_input(&fmt_ctx); 55 | return 0; 56 | } 57 | -------------------------------------------------------------------------------- /Visualization/MobMapNativeWin/ffmpeg/doc/examples/resampling_audio.c: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2012 Stefano Sabatini 3 | * 4 | * Permission is hereby granted, free of charge, to any person obtaining a copy 5 | * of this software and associated documentation files (the "Software"), to deal 6 | * in the Software without restriction, including without limitation the rights 7 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 8 | * copies of the Software, and to permit persons to whom the Software is 9 | * furnished to do so, subject to the following conditions: 10 | * 11 | * The above copyright notice and this permission notice shall be included in 12 | * all copies or substantial portions of the Software. 13 | * 14 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL 17 | * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 18 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 19 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 20 | * THE SOFTWARE. 21 | */ 22 | 23 | /** 24 | * @example doc/examples/resampling_audio.c 25 | * libswresample API use example. 26 | */ 27 | 28 | #include 29 | #include 30 | #include 31 | #include 32 | 33 | static int get_format_from_sample_fmt(const char **fmt, 34 | enum AVSampleFormat sample_fmt) 35 | { 36 | int i; 37 | struct sample_fmt_entry { 38 | enum AVSampleFormat sample_fmt; const char *fmt_be, *fmt_le; 39 | } sample_fmt_entries[] = { 40 | { AV_SAMPLE_FMT_U8, "u8", "u8" }, 41 | { AV_SAMPLE_FMT_S16, "s16be", "s16le" }, 42 | { AV_SAMPLE_FMT_S32, "s32be", "s32le" }, 43 | { AV_SAMPLE_FMT_FLT, "f32be", "f32le" }, 44 | { AV_SAMPLE_FMT_DBL, "f64be", "f64le" }, 45 | }; 46 | *fmt = NULL; 47 | 48 | for (i = 0; i < FF_ARRAY_ELEMS(sample_fmt_entries); i++) { 49 | struct sample_fmt_entry *entry = &sample_fmt_entries[i]; 50 | if (sample_fmt == entry->sample_fmt) { 51 | *fmt = AV_NE(entry->fmt_be, entry->fmt_le); 52 | return 0; 53 | } 54 | } 55 | 56 | fprintf(stderr, 57 | "Sample format %s not supported as output format\n", 58 | av_get_sample_fmt_name(sample_fmt)); 59 | return AVERROR(EINVAL); 60 | } 61 | 62 | /** 63 | * Fill dst buffer with nb_samples, generated starting from t. 64 | */ 65 | void fill_samples(double *dst, int nb_samples, int nb_channels, int sample_rate, double *t) 66 | { 67 | int i, j; 68 | double tincr = 1.0 / sample_rate, *dstp = dst; 69 | const double c = 2 * M_PI * 440.0; 70 | 71 | /* generate sin tone with 440Hz frequency and duplicated channels */ 72 | for (i = 0; i < nb_samples; i++) { 73 | *dstp = sin(c * *t); 74 | for (j = 1; j < nb_channels; j++) 75 | dstp[j] = dstp[0]; 76 | dstp += nb_channels; 77 | *t += tincr; 78 | } 79 | } 80 | 81 | int main(int argc, char **argv) 82 | { 83 | int64_t src_ch_layout = AV_CH_LAYOUT_STEREO, dst_ch_layout = AV_CH_LAYOUT_SURROUND; 84 | int src_rate = 48000, dst_rate = 44100; 85 | uint8_t **src_data = NULL, **dst_data = NULL; 86 | int src_nb_channels = 0, dst_nb_channels = 0; 87 | int src_linesize, dst_linesize; 88 | int src_nb_samples = 1024, dst_nb_samples, max_dst_nb_samples; 89 | enum AVSampleFormat src_sample_fmt = AV_SAMPLE_FMT_DBL, dst_sample_fmt = AV_SAMPLE_FMT_S16; 90 | const char *dst_filename = NULL; 91 | FILE *dst_file; 92 | int dst_bufsize; 93 | const char *fmt; 94 | struct SwrContext *swr_ctx; 95 | double t; 96 | int ret; 97 | 98 | if (argc != 2) { 99 | fprintf(stderr, "Usage: %s output_file\n" 100 | "API example program to show how to resample an audio stream with libswresample.\n" 101 | "This program generates a series of audio frames, resamples them to a specified " 102 | "output format and rate and saves them to an output file named output_file.\n", 103 | argv[0]); 104 | exit(1); 105 | } 106 | dst_filename = argv[1]; 107 | 108 | dst_file = fopen(dst_filename, "wb"); 109 | if (!dst_file) { 110 | fprintf(stderr, "Could not open destination file %s\n", dst_filename); 111 | exit(1); 112 | } 113 | 114 | /* create resampler context */ 115 | swr_ctx = swr_alloc(); 116 | if (!swr_ctx) { 117 | fprintf(stderr, "Could not allocate resampler context\n"); 118 | ret = AVERROR(ENOMEM); 119 | goto end; 120 | } 121 | 122 | /* set options */ 123 | av_opt_set_int(swr_ctx, "in_channel_layout", src_ch_layout, 0); 124 | av_opt_set_int(swr_ctx, "in_sample_rate", src_rate, 0); 125 | av_opt_set_sample_fmt(swr_ctx, "in_sample_fmt", src_sample_fmt, 0); 126 | 127 | av_opt_set_int(swr_ctx, "out_channel_layout", dst_ch_layout, 0); 128 | av_opt_set_int(swr_ctx, "out_sample_rate", dst_rate, 0); 129 | av_opt_set_sample_fmt(swr_ctx, "out_sample_fmt", dst_sample_fmt, 0); 130 | 131 | /* initialize the resampling context */ 132 | if ((ret = swr_init(swr_ctx)) < 0) { 133 | fprintf(stderr, "Failed to initialize the resampling context\n"); 134 | goto end; 135 | } 136 | 137 | /* allocate source and destination samples buffers */ 138 | 139 | src_nb_channels = av_get_channel_layout_nb_channels(src_ch_layout); 140 | ret = av_samples_alloc_array_and_samples(&src_data, &src_linesize, src_nb_channels, 141 | src_nb_samples, src_sample_fmt, 0); 142 | if (ret < 0) { 143 | fprintf(stderr, "Could not allocate source samples\n"); 144 | goto end; 145 | } 146 | 147 | /* compute the number of converted samples: buffering is avoided 148 | * ensuring that the output buffer will contain at least all the 149 | * converted input samples */ 150 | max_dst_nb_samples = dst_nb_samples = 151 | av_rescale_rnd(src_nb_samples, dst_rate, src_rate, AV_ROUND_UP); 152 | 153 | /* buffer is going to be directly written to a rawaudio file, no alignment */ 154 | dst_nb_channels = av_get_channel_layout_nb_channels(dst_ch_layout); 155 | ret = av_samples_alloc_array_and_samples(&dst_data, &dst_linesize, dst_nb_channels, 156 | dst_nb_samples, dst_sample_fmt, 0); 157 | if (ret < 0) { 158 | fprintf(stderr, "Could not allocate destination samples\n"); 159 | goto end; 160 | } 161 | 162 | t = 0; 163 | do { 164 | /* generate synthetic audio */ 165 | fill_samples((double *)src_data[0], src_nb_samples, src_nb_channels, src_rate, &t); 166 | 167 | /* compute destination number of samples */ 168 | dst_nb_samples = av_rescale_rnd(swr_get_delay(swr_ctx, src_rate) + 169 | src_nb_samples, dst_rate, src_rate, AV_ROUND_UP); 170 | if (dst_nb_samples > max_dst_nb_samples) { 171 | av_free(dst_data[0]); 172 | ret = av_samples_alloc(dst_data, &dst_linesize, dst_nb_channels, 173 | dst_nb_samples, dst_sample_fmt, 1); 174 | if (ret < 0) 175 | break; 176 | max_dst_nb_samples = dst_nb_samples; 177 | } 178 | 179 | /* convert to destination format */ 180 | ret = swr_convert(swr_ctx, dst_data, dst_nb_samples, (const uint8_t **)src_data, src_nb_samples); 181 | if (ret < 0) { 182 | fprintf(stderr, "Error while converting\n"); 183 | goto end; 184 | } 185 | dst_bufsize = av_samples_get_buffer_size(&dst_linesize, dst_nb_channels, 186 | ret, dst_sample_fmt, 1); 187 | printf("t:%f in:%d out:%d\n", t, src_nb_samples, ret); 188 | fwrite(dst_data[0], 1, dst_bufsize, dst_file); 189 | } while (t < 10); 190 | 191 | if ((ret = get_format_from_sample_fmt(&fmt, dst_sample_fmt)) < 0) 192 | goto end; 193 | fprintf(stderr, "Resampling succeeded. Play the output file with the command:\n" 194 | "ffplay -f %s -channel_layout %"PRId64" -channels %d -ar %d %s\n", 195 | fmt, dst_ch_layout, dst_nb_channels, dst_rate, dst_filename); 196 | 197 | end: 198 | if (dst_file) 199 | fclose(dst_file); 200 | 201 | if (src_data) 202 | av_freep(&src_data[0]); 203 | av_freep(&src_data); 204 | 205 | if (dst_data) 206 | av_freep(&dst_data[0]); 207 | av_freep(&dst_data); 208 | 209 | swr_free(&swr_ctx); 210 | return ret < 0; 211 | } 212 | -------------------------------------------------------------------------------- /Visualization/MobMapNativeWin/ffmpeg/doc/examples/scaling_video.c: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2012 Stefano Sabatini 3 | * 4 | * Permission is hereby granted, free of charge, to any person obtaining a copy 5 | * of this software and associated documentation files (the "Software"), to deal 6 | * in the Software without restriction, including without limitation the rights 7 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 8 | * copies of the Software, and to permit persons to whom the Software is 9 | * furnished to do so, subject to the following conditions: 10 | * 11 | * The above copyright notice and this permission notice shall be included in 12 | * all copies or substantial portions of the Software. 13 | * 14 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL 17 | * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 18 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 19 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 20 | * THE SOFTWARE. 21 | */ 22 | 23 | /** 24 | * @file 25 | * libswscale API use example. 26 | * @example doc/examples/scaling_video.c 27 | */ 28 | 29 | #include 30 | #include 31 | #include 32 | 33 | static void fill_yuv_image(uint8_t *data[4], int linesize[4], 34 | int width, int height, int frame_index) 35 | { 36 | int x, y; 37 | 38 | /* Y */ 39 | for (y = 0; y < height; y++) 40 | for (x = 0; x < width; x++) 41 | data[0][y * linesize[0] + x] = x + y + frame_index * 3; 42 | 43 | /* Cb and Cr */ 44 | for (y = 0; y < height / 2; y++) { 45 | for (x = 0; x < width / 2; x++) { 46 | data[1][y * linesize[1] + x] = 128 + y + frame_index * 2; 47 | data[2][y * linesize[2] + x] = 64 + x + frame_index * 5; 48 | } 49 | } 50 | } 51 | 52 | int main(int argc, char **argv) 53 | { 54 | uint8_t *src_data[4], *dst_data[4]; 55 | int src_linesize[4], dst_linesize[4]; 56 | int src_w = 320, src_h = 240, dst_w, dst_h; 57 | enum AVPixelFormat src_pix_fmt = AV_PIX_FMT_YUV420P, dst_pix_fmt = AV_PIX_FMT_RGB24; 58 | const char *dst_size = NULL; 59 | const char *dst_filename = NULL; 60 | FILE *dst_file; 61 | int dst_bufsize; 62 | struct SwsContext *sws_ctx; 63 | int i, ret; 64 | 65 | if (argc != 3) { 66 | fprintf(stderr, "Usage: %s output_file output_size\n" 67 | "API example program to show how to scale an image with libswscale.\n" 68 | "This program generates a series of pictures, rescales them to the given " 69 | "output_size and saves them to an output file named output_file\n." 70 | "\n", argv[0]); 71 | exit(1); 72 | } 73 | dst_filename = argv[1]; 74 | dst_size = argv[2]; 75 | 76 | if (av_parse_video_size(&dst_w, &dst_h, dst_size) < 0) { 77 | fprintf(stderr, 78 | "Invalid size '%s', must be in the form WxH or a valid size abbreviation\n", 79 | dst_size); 80 | exit(1); 81 | } 82 | 83 | dst_file = fopen(dst_filename, "wb"); 84 | if (!dst_file) { 85 | fprintf(stderr, "Could not open destination file %s\n", dst_filename); 86 | exit(1); 87 | } 88 | 89 | /* create scaling context */ 90 | sws_ctx = sws_getContext(src_w, src_h, src_pix_fmt, 91 | dst_w, dst_h, dst_pix_fmt, 92 | SWS_BILINEAR, NULL, NULL, NULL); 93 | if (!sws_ctx) { 94 | fprintf(stderr, 95 | "Impossible to create scale context for the conversion " 96 | "fmt:%s s:%dx%d -> fmt:%s s:%dx%d\n", 97 | av_get_pix_fmt_name(src_pix_fmt), src_w, src_h, 98 | av_get_pix_fmt_name(dst_pix_fmt), dst_w, dst_h); 99 | ret = AVERROR(EINVAL); 100 | goto end; 101 | } 102 | 103 | /* allocate source and destination image buffers */ 104 | if ((ret = av_image_alloc(src_data, src_linesize, 105 | src_w, src_h, src_pix_fmt, 16)) < 0) { 106 | fprintf(stderr, "Could not allocate source image\n"); 107 | goto end; 108 | } 109 | 110 | /* buffer is going to be written to rawvideo file, no alignment */ 111 | if ((ret = av_image_alloc(dst_data, dst_linesize, 112 | dst_w, dst_h, dst_pix_fmt, 1)) < 0) { 113 | fprintf(stderr, "Could not allocate destination image\n"); 114 | goto end; 115 | } 116 | dst_bufsize = ret; 117 | 118 | for (i = 0; i < 100; i++) { 119 | /* generate synthetic video */ 120 | fill_yuv_image(src_data, src_linesize, src_w, src_h, i); 121 | 122 | /* convert to destination format */ 123 | sws_scale(sws_ctx, (const uint8_t * const*)src_data, 124 | src_linesize, 0, src_h, dst_data, dst_linesize); 125 | 126 | /* write scaled image to file */ 127 | fwrite(dst_data[0], 1, dst_bufsize, dst_file); 128 | } 129 | 130 | fprintf(stderr, "Scaling succeeded. Play the output file with the command:\n" 131 | "ffplay -f rawvideo -pix_fmt %s -video_size %dx%d %s\n", 132 | av_get_pix_fmt_name(dst_pix_fmt), dst_w, dst_h, dst_filename); 133 | 134 | end: 135 | if (dst_file) 136 | fclose(dst_file); 137 | av_freep(&src_data[0]); 138 | av_freep(&dst_data[0]); 139 | sws_freeContext(sws_ctx); 140 | return ret < 0; 141 | } 142 | -------------------------------------------------------------------------------- /Visualization/MobMapNativeWin/ffmpeg/doc/ffmpeg-bitstream-filters.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 14 | 15 | FFmpeg documentation : FFmpeg Bitstream Filters 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 |
29 | 30 | 31 |

FFmpeg Bitstream Filters Documentation

32 | 33 | 34 |

Table of Contents

35 | 58 | 59 | 60 |

1. Description

61 | 62 |

This document describes the bitstream filters provided by the 63 | libavcodec library. 64 |

65 |

A bitstream filter operates on the encoded stream data, and performs 66 | bitstream level modifications without performing decoding. 67 |

68 | 69 | 70 |

2. Bitstream Filters

71 | 72 |

When you configure your FFmpeg build, all the supported bitstream 73 | filters are enabled by default. You can list all available ones using 74 | the configure option --list-bsfs. 75 |

76 |

You can disable all the bitstream filters using the configure option 77 | --disable-bsfs, and selectively enable any bitstream filter using 78 | the option --enable-bsf=BSF, or you can disable a particular 79 | bitstream filter using the option --disable-bsf=BSF. 80 |

81 |

The option -bsfs of the ff* tools will display the list of 82 | all the supported bitstream filters included in your build. 83 |

84 |

Below is a description of the currently available bitstream filters. 85 |

86 | 87 |

2.1 aac_adtstoasc

88 | 89 |

Convert MPEG-2/4 AAC ADTS to MPEG-4 Audio Specific Configuration 90 | bitstream filter. 91 |

92 |

This filter creates an MPEG-4 AudioSpecificConfig from an MPEG-2/4 93 | ADTS header and removes the ADTS header. 94 |

95 |

This is required for example when copying an AAC stream from a raw 96 | ADTS AAC container to a FLV or a MOV/MP4 file. 97 |

98 | 99 |

2.2 chomp

100 | 101 |

Remove zero padding at the end of a packet. 102 |

103 | 104 |

2.3 dump_extradata

105 | 106 | 107 |

2.4 h264_mp4toannexb

108 | 109 |

Convert an H.264 bitstream from length prefixed mode to start code 110 | prefixed mode (as defined in the Annex B of the ITU-T H.264 111 | specification). 112 |

113 |

This is required by some streaming formats, typically the MPEG-2 114 | transport stream format ("mpegts"). 115 |

116 |

For example to remux an MP4 file containing an H.264 stream to mpegts 117 | format with ffmpeg, you can use the command: 118 |

119 |
 
ffmpeg -i INPUT.mp4 -codec copy -bsf:v h264_mp4toannexb OUTPUT.ts
120 | 
121 | 122 | 123 |

2.5 imx_dump_header

124 | 125 | 126 |

2.6 mjpeg2jpeg

127 | 128 |

Convert MJPEG/AVI1 packets to full JPEG/JFIF packets. 129 |

130 |

MJPEG is a video codec wherein each video frame is essentially a 131 | JPEG image. The individual frames can be extracted without loss, 132 | e.g. by 133 |

134 |
 
ffmpeg -i ../some_mjpeg.avi -c:v copy frames_%d.jpg
135 | 
136 | 137 |

Unfortunately, these chunks are incomplete JPEG images, because 138 | they lack the DHT segment required for decoding. Quoting from 139 | http://www.digitalpreservation.gov/formats/fdd/fdd000063.shtml: 140 |

141 |

Avery Lee, writing in the rec.video.desktop newsgroup in 2001, 142 | commented that "MJPEG, or at least the MJPEG in AVIs having the 143 | MJPG fourcc, is restricted JPEG with a fixed – and *omitted* – 144 | Huffman table. The JPEG must be YCbCr colorspace, it must be 4:2:2, 145 | and it must use basic Huffman encoding, not arithmetic or 146 | progressive. . . . You can indeed extract the MJPEG frames and 147 | decode them with a regular JPEG decoder, but you have to prepend 148 | the DHT segment to them, or else the decoder won’t have any idea 149 | how to decompress the data. The exact table necessary is given in 150 | the OpenDML spec." 151 |

152 |

This bitstream filter patches the header of frames extracted from an MJPEG 153 | stream (carrying the AVI1 header ID and lacking a DHT segment) to 154 | produce fully qualified JPEG images. 155 |

156 |
 
ffmpeg -i mjpeg-movie.avi -c:v copy -bsf:v mjpeg2jpeg frame_%d.jpg
157 | exiftran -i -9 frame*.jpg
158 | ffmpeg -i frame_%d.jpg -c:v copy rotated.avi
159 | 
160 | 161 | 162 |

2.7 mjpega_dump_header

163 | 164 | 165 |

2.8 movsub

166 | 167 | 168 |

2.9 mp3_header_compress

169 | 170 | 171 |

2.10 mp3_header_decompress

172 | 173 | 174 |

2.11 noise

175 | 176 | 177 |

2.12 remove_extradata

178 | 179 | 180 | 181 |

3. See Also

182 | 183 |

ffmpeg, ffplay, ffprobe, ffserver, 184 | libavcodec 185 |

186 | 187 | 188 |

4. Authors

189 | 190 |

The FFmpeg developers. 191 |

192 |

For details about the authorship, see the Git history of the project 193 | (git://source.ffmpeg.org/ffmpeg), e.g. by typing the command 194 | git log in the FFmpeg source directory, or browsing the 195 | online repository at http://source.ffmpeg.org. 196 |

197 |

Maintainers for the specific components are listed in the file 198 | ‘MAINTAINERS’ in the source code tree. 199 |

200 | 201 |
202 | This document was generated by Kyle Schwarz on July 2, 2013 using texi2html 1.82.
203 | -------------------------------------------------------------------------------- /Visualization/MobMapNativeWin/ffmpeg/doc/ffmpeg-scaler.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 14 | 15 | FFmpeg documentation : FFmpeg Scaler 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 |
29 | 30 | 31 |

FFmpeg Scaler Documentation

32 | 33 | 34 |

Table of Contents

35 |
36 | 37 | 43 |
44 | 45 | 46 |

1. Description

47 | 48 |

The FFmpeg rescaler provides an high-level interface to the libswscale 49 | library image conversion utilities. In particular it allows to perform 50 | image rescaling and pixel format conversion. 51 |

52 | 53 | 54 |

2. Scaler Options

55 | 56 |

The video scaler supports the following named options. 57 |

58 |

Options may be set by specifying -option value in the 59 | FFmpeg tools. For programmatic use, they can be set explicitly in the 60 | SwsContext options or through the ‘libavutil/opt.h’ API. 61 |

62 |
63 |
sws_flags
64 |

Set the scaler flags. This is also used to set the scaling 65 | algorithm. Only a single algorithm should be selected. 66 |

67 |

It accepts the following values: 68 |

69 |
fast_bilinear
70 |

Select fast bilinear scaling algorithm. 71 |

72 |
73 |
bilinear
74 |

Select bilinear scaling algorithm. 75 |

76 |
77 |
bicubic
78 |

Select bicubic scaling algorithm. 79 |

80 |
81 |
experimental
82 |

Select experimental scaling algorithm. 83 |

84 |
85 |
neighbor
86 |

Select nearest neighbor rescaling algorithm. 87 |

88 |
89 |
area
90 |

Select averaging area rescaling algorithm. 91 |

92 |
93 |
bicubiclin
94 |

Select bicubic scaling algorithm for the luma component, bilinear for 95 | chroma components. 96 |

97 |
98 |
gauss
99 |

Select Gaussian rescaling algorithm. 100 |

101 |
102 |
sinc
103 |

Select sinc rescaling algorithm. 104 |

105 |
106 |
lanczos
107 |

Select lanczos rescaling algorithm. 108 |

109 |
110 |
spline
111 |

Select natural bicubic spline rescaling algorithm. 112 |

113 |
114 |
print_info
115 |

Enable printing/debug logging. 116 |

117 |
118 |
accurate_rnd
119 |

Enable accurate rounding. 120 |

121 |
122 |
full_chroma_int
123 |

Enable full chroma interpolation. 124 |

125 |
126 |
full_chroma_inp
127 |

Select full chroma input. 128 |

129 |
130 |
bitexact
131 |

Enable bitexact output. 132 |

133 |
134 | 135 |
136 |
srcw
137 |

Set source width. 138 |

139 |
140 |
srch
141 |

Set source height. 142 |

143 |
144 |
dstw
145 |

Set destination width. 146 |

147 |
148 |
dsth
149 |

Set destination height. 150 |

151 |
152 |
src_format
153 |

Set source pixel format (must be expressed as an integer). 154 |

155 |
156 |
dst_format
157 |

Set destination pixel format (must be expressed as an integer). 158 |

159 |
160 |
src_range
161 |

Select source range. 162 |

163 |
164 |
dst_range
165 |

Select destination range. 166 |

167 |
168 |
param0, param1
169 |

Set scaling algorithm parameters. The specified values are specific of 170 | some scaling algorithms and ignored by others. The specified values 171 | are floating point number values. 172 |

173 |
174 |
175 | 176 | 177 | 178 |

3. See Also

179 | 180 |

ffmpeg, ffplay, ffprobe, ffserver, 181 | libswscale 182 |

183 | 184 | 185 |

4. Authors

186 | 187 |

The FFmpeg developers. 188 |

189 |

For details about the authorship, see the Git history of the project 190 | (git://source.ffmpeg.org/ffmpeg), e.g. by typing the command 191 | git log in the FFmpeg source directory, or browsing the 192 | online repository at http://source.ffmpeg.org. 193 |

194 |

Maintainers for the specific components are listed in the file 195 | ‘MAINTAINERS’ in the source code tree. 196 |

197 | 198 |
199 | This document was generated by Kyle Schwarz on July 2, 2013 using texi2html 1.82.
200 | -------------------------------------------------------------------------------- /Visualization/MobMapNativeWin/ffmpeg/doc/libavcodec.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 14 | 15 | FFmpeg documentation : Libavcodec 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 |
29 | 30 | 31 |

Libavcodec Documentation

32 | 33 | 34 |

Table of Contents

35 |
36 | 37 | 42 |
43 | 44 | 45 |

1. Description

46 | 47 |

The libavcodec library provides a generic encoding/decoding framework 48 | and contains multiple decoders and encoders for audio, video and 49 | subtitle streams, and several bitstream filters. 50 |

51 |

The shared architecture provides various services ranging from bit 52 | stream I/O to DSP optimizations, and makes it suitable for 53 | implementing robust and fast codecs as well as for experimentation. 54 |

55 | 56 | 57 |

2. See Also

58 | 59 |

ffmpeg, ffplay, ffprobe, ffserver, 60 | ffmpeg-codecs, bitstream-filters, 61 | libavutil 62 |

63 | 64 | 65 |

3. Authors

66 | 67 |

The FFmpeg developers. 68 |

69 |

For details about the authorship, see the Git history of the project 70 | (git://source.ffmpeg.org/ffmpeg), e.g. by typing the command 71 | git log in the FFmpeg source directory, or browsing the 72 | online repository at http://source.ffmpeg.org. 73 |

74 |

Maintainers for the specific components are listed in the file 75 | ‘MAINTAINERS’ in the source code tree. 76 |

77 | 78 |
79 | This document was generated by Kyle Schwarz on July 2, 2013 using texi2html 1.82.
80 | -------------------------------------------------------------------------------- /Visualization/MobMapNativeWin/ffmpeg/doc/libavdevice.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 14 | 15 | FFmpeg documentation : Libavdevice 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 |
29 | 30 | 31 |

Libavdevice Documentation

32 | 33 | 34 |

Table of Contents

35 |
36 | 37 | 42 |
43 | 44 | 45 |

1. Description

46 | 47 |

The libavdevice library provides a generic framework for grabbing from 48 | and rendering to many common multimedia input/output devices, and 49 | supports several input and output devices, including Video4Linux2, 50 | VfW, DShow, and ALSA. 51 |

52 | 53 | 54 |

2. See Also

55 | 56 |

ffmpeg, ffplay, ffprobe, ffserver, 57 | ffmpeg-devices, 58 | libavutil, libavcodec, libavformat 59 |

60 | 61 | 62 |

3. Authors

63 | 64 |

The FFmpeg developers. 65 |

66 |

For details about the authorship, see the Git history of the project 67 | (git://source.ffmpeg.org/ffmpeg), e.g. by typing the command 68 | git log in the FFmpeg source directory, or browsing the 69 | online repository at http://source.ffmpeg.org. 70 |

71 |

Maintainers for the specific components are listed in the file 72 | ‘MAINTAINERS’ in the source code tree. 73 |

74 | 75 |
76 | This document was generated by Kyle Schwarz on July 2, 2013 using texi2html 1.82.
77 | -------------------------------------------------------------------------------- /Visualization/MobMapNativeWin/ffmpeg/doc/libavfilter.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 14 | 15 | FFmpeg documentation : Libavfilter 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 |
29 | 30 | 31 |

Libavfilter Documentation

32 | 33 | 34 |

Table of Contents

35 |
36 | 37 | 42 |
43 | 44 | 45 |

1. Description

46 | 47 |

The libavfilter library provides a generic audio/video filtering 48 | framework containing several filters, sources and sinks. 49 |

50 | 51 | 52 |

2. See Also

53 | 54 |

ffmpeg, ffplay, ffprobe, ffserver, 55 | ffmpeg-filters, 56 | libavutil, libswscale, libswresample, 57 | libavcodec, libavformat, libavdevice 58 |

59 | 60 | 61 |

3. Authors

62 | 63 |

The FFmpeg developers. 64 |

65 |

For details about the authorship, see the Git history of the project 66 | (git://source.ffmpeg.org/ffmpeg), e.g. by typing the command 67 | git log in the FFmpeg source directory, or browsing the 68 | online repository at http://source.ffmpeg.org. 69 |

70 |

Maintainers for the specific components are listed in the file 71 | ‘MAINTAINERS’ in the source code tree. 72 |

73 | 74 |
75 | This document was generated by Kyle Schwarz on July 2, 2013 using texi2html 1.82.
76 | -------------------------------------------------------------------------------- /Visualization/MobMapNativeWin/ffmpeg/doc/libavformat.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 14 | 15 | FFmpeg documentation : Libavformat 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 |
29 | 30 | 31 |

Libavformat Documentation

32 | 33 | 34 |

Table of Contents

35 |
36 | 37 | 42 |
43 | 44 | 45 |

1. Description

46 | 47 |

The libavformat library provides a generic framework for multiplexing 48 | and demultiplexing (muxing and demuxing) audio, video and subtitle 49 | streams. It encompasses multiple muxers and demuxers for multimedia 50 | container formats. 51 |

52 |

It also supports several input and output protocols to access a media 53 | resource. 54 |

55 | 56 | 57 |

2. See Also

58 | 59 |

ffmpeg, ffplay, ffprobe, ffserver, 60 | ffmpeg-formats, ffmpeg-protocols, 61 | libavutil, libavcodec 62 |

63 | 64 | 65 |

3. Authors

66 | 67 |

The FFmpeg developers. 68 |

69 |

For details about the authorship, see the Git history of the project 70 | (git://source.ffmpeg.org/ffmpeg), e.g. by typing the command 71 | git log in the FFmpeg source directory, or browsing the 72 | online repository at http://source.ffmpeg.org. 73 |

74 |

Maintainers for the specific components are listed in the file 75 | ‘MAINTAINERS’ in the source code tree. 76 |

77 | 78 |
79 | This document was generated by Kyle Schwarz on July 2, 2013 using texi2html 1.82.
80 | -------------------------------------------------------------------------------- /Visualization/MobMapNativeWin/ffmpeg/doc/libavutil.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 14 | 15 | FFmpeg documentation : Libavutil 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 |
29 | 30 | 31 |

Libavutil Documentation

32 | 33 | 34 |

Table of Contents

35 |
36 | 37 | 42 |
43 | 44 | 45 |

1. Description

46 | 47 |

The libavutil library is a utility library to aid portable 48 | multimedia programming. It contains safe portable string functions, 49 | random number generators, data structures, additional mathematics 50 | functions, cryptography and multimedia related functionality (like 51 | enumerations for pixel and sample formats). 52 |

53 | 54 | 55 |

2. See Also

56 | 57 |

ffmpeg, ffplay, ffprobe, ffserver, 58 | ffmpeg-utils 59 |

60 | 61 | 62 |

3. Authors

63 | 64 |

The FFmpeg developers. 65 |

66 |

For details about the authorship, see the Git history of the project 67 | (git://source.ffmpeg.org/ffmpeg), e.g. by typing the command 68 | git log in the FFmpeg source directory, or browsing the 69 | online repository at http://source.ffmpeg.org. 70 |

71 |

Maintainers for the specific components are listed in the file 72 | ‘MAINTAINERS’ in the source code tree. 73 |

74 | 75 |
76 | This document was generated by Kyle Schwarz on July 2, 2013 using texi2html 1.82.
77 | -------------------------------------------------------------------------------- /Visualization/MobMapNativeWin/ffmpeg/doc/libswresample.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 14 | 15 | FFmpeg documentation : Libswresample 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 |
29 | 30 | 31 |

Libswresample Documentation

32 | 33 | 34 |

Table of Contents

35 |
36 | 37 | 42 |
43 | 44 | 45 |

1. Description

46 | 47 |

The libswresample library performs highly optimized audio resampling, 48 | rematrixing and sample format conversion operations. 49 |

50 |

Specifically, this library performs the following conversions: 51 |

52 |
    53 |
  • 54 | Resampling: is the process of changing the audio rate, for 55 | example from an high sample rate of 44100Hz to 8000Hz. Audio 56 | conversion from high to low sample rate is a lossy process. Several 57 | resampling options and algorithms are available. 58 | 59 |
  • 60 | Format conversion: is the process of converting the type of 61 | samples, for example from 16-bit signed samples to unsigned 8-bit or 62 | float samples. It also handles packing conversion, when passing from 63 | packed layout (all samples belonging to distinct channels interleaved 64 | in the same buffer), to planar layout (all samples belonging to the 65 | same channel stored in a dedicated buffer or "plane"). 66 | 67 |
  • 68 | Rematrixing: is the process of changing the channel layout, for 69 | example from stereo to mono. When the input channels cannot be mapped 70 | to the output streams, the process is lossy, since it involves 71 | different gain factors and mixing. 72 |
73 | 74 |

Various other audio conversions (e.g. stretching and padding) are 75 | enabled through dedicated options. 76 |

77 | 78 | 79 |

2. See Also

80 | 81 |

ffmpeg, ffplay, ffprobe, ffserver, 82 | ffmpeg-resampler, 83 | libavutil 84 |

85 | 86 | 87 |

3. Authors

88 | 89 |

The FFmpeg developers. 90 |

91 |

For details about the authorship, see the Git history of the project 92 | (git://source.ffmpeg.org/ffmpeg), e.g. by typing the command 93 | git log in the FFmpeg source directory, or browsing the 94 | online repository at http://source.ffmpeg.org. 95 |

96 |

Maintainers for the specific components are listed in the file 97 | ‘MAINTAINERS’ in the source code tree. 98 |

99 | 100 |
101 | This document was generated by Kyle Schwarz on July 2, 2013 using texi2html 1.82.
102 | -------------------------------------------------------------------------------- /Visualization/MobMapNativeWin/ffmpeg/doc/libswscale.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 14 | 15 | FFmpeg documentation : Libswscale 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 |
29 | 30 | 31 |

Libswscale Documentation

32 | 33 | 34 |

Table of Contents

35 |
36 | 37 | 42 |
43 | 44 | 45 |

1. Description

46 | 47 |

The libswscale library performs highly optimized image scaling and 48 | colorspace and pixel format conversion operations. 49 |

50 |

Specifically, this library performs the following conversions: 51 |

52 |
    53 |
  • 54 | Rescaling: is the process of changing the video size. Several 55 | rescaling options and algorithms are available. This is usually a 56 | lossy process. 57 | 58 |
  • 59 | Pixel format conversion: is the process of converting the image 60 | format and colorspace of the image, for example from planar YUV420P to 61 | RGB24 packed. It also handles packing conversion, that is converts 62 | from packed layout (all pixels belonging to distinct planes 63 | interleaved in the same buffer), to planar layout (all samples 64 | belonging to the same plane stored in a dedicated buffer or "plane"). 65 | 66 |

    This is usually a lossy process in case the source and destination 67 | colorspaces differ. 68 |

69 | 70 | 71 | 72 |

2. See Also

73 | 74 |

ffmpeg, ffplay, ffprobe, ffserver, 75 | ffmpeg-scaler, 76 | libavutil 77 |

78 | 79 | 80 |

3. Authors

81 | 82 |

The FFmpeg developers. 83 |

84 |

For details about the authorship, see the Git history of the project 85 | (git://source.ffmpeg.org/ffmpeg), e.g. by typing the command 86 | git log in the FFmpeg source directory, or browsing the 87 | online repository at http://source.ffmpeg.org. 88 |

89 |

Maintainers for the specific components are listed in the file 90 | ‘MAINTAINERS’ in the source code tree. 91 |

92 | 93 |
94 | This document was generated by Kyle Schwarz on July 2, 2013 using texi2html 1.82.
95 | -------------------------------------------------------------------------------- /Visualization/MobMapNativeWin/ffmpeg/doc/nut.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 14 | 15 | FFmpeg documentation : NUT: 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 |
29 | 30 | 31 |

NUT

32 | 33 | 34 |

Table of Contents

35 | 50 | 51 | 52 |

1. Description

53 |

NUT is a low overhead generic container format. It stores audio, video, 54 | subtitle and user-defined streams in a simple, yet efficient, way. 55 |

56 |

It was created by a group of FFmpeg and MPlayer developers in 2003 57 | and was finalized in 2008. 58 |

59 |

The official nut specification is at svn://svn.mplayerhq.hu/nut 60 | In case of any differences between this text and the official specification, 61 | the official specification shall prevail. 62 |

63 | 64 |

2. Container-specific codec tags

65 | 66 | 67 |

2.1 Generic raw YUVA formats

68 | 69 |

Since many exotic planar YUVA pixel formats are not considered by 70 | the AVI/QuickTime FourCC lists, the following scheme is adopted for 71 | representing them. 72 |

73 |

The first two bytes can contain the values: 74 | Y1 = only Y 75 | Y2 = Y+A 76 | Y3 = YUV 77 | Y4 = YUVA 78 |

79 |

The third byte represents the width and height chroma subsampling 80 | values for the UV planes, that is the amount to shift the luma 81 | width/height right to find the chroma width/height. 82 |

83 |

The fourth byte is the number of bits used (8, 16, ...). 84 |

85 |

If the order of bytes is inverted, that means that each component has 86 | to be read big-endian. 87 |

88 | 89 |

2.2 Raw Audio

90 | 91 | 92 | 93 | 94 | 95 | 96 |
ALAWA-LAW
ULAWMU-LAW
P<type><interleaving><bits>little-endian PCM
<bits><interleaving><type>Pbig-endian PCM
97 | 98 |

<type> is S for signed integer, U for unsigned integer, F for IEEE float 99 | <interleaving> is D for default, P is for planar. 100 | <bits> is 8/16/24/32 101 |

102 |
 
PFD[32]   would for example be signed 32 bit little-endian IEEE float
103 | 
104 | 105 | 106 |

2.3 Subtitles

107 | 108 | 109 | 110 | 111 | 112 | 113 |
UTF8Raw UTF-8
SSA[0]SubStation Alpha
DVDSDVD subtitles
DVBSDVB subtitles
114 | 115 | 116 |

2.4 Raw Data

117 | 118 | 119 | 120 |
UTF8Raw UTF-8
121 | 122 | 123 |

2.5 Codecs

124 | 125 | 126 | 127 | 128 | 129 | 130 | 131 | 132 | 133 | 134 | 135 | 136 | 137 | 138 | 139 | 140 | 141 | 142 | 143 | 144 | 145 | 146 | 147 | 148 | 149 | 150 | 151 | 152 | 153 | 154 | 155 | 156 | 157 | 158 | 159 | 160 | 161 | 162 | 163 | 164 | 165 | 166 | 167 | 168 | 169 | 170 | 171 | 172 | 173 | 174 | 175 | 176 | 177 | 178 | 179 | 180 | 181 |
3IV1non-compliant MPEG-4 generated by old 3ivx
ASV1Asus Video
ASV2Asus Video 2
CVIDCinepak
CYUVCreative YUV
DIVXnon-compliant MPEG-4 generated by old DivX
DUCKTruemotion 1
FFV1FFmpeg video 1
FFVHFFmpeg Huffyuv
H261ITU H.261
H262ITU H.262
H263ITU H.263
H264ITU H.264
HFYUHuffyuv
I263Intel H.263
IV31Indeo 3.1
IV32Indeo 3.2
IV50Indeo 5.0
LJPGITU JPEG (lossless)
MJLSITU JPEG-LS
MJPGITU JPEG
MPG4MS MPEG-4v1 (not ISO MPEG-4)
MP42MS MPEG-4v2
MP43MS MPEG-4v3
MP4VISO MPEG-4 Part 2 Video (from old encoders)
mpg1ISO MPEG-1 Video
mpg2ISO MPEG-2 Video
MRLEMS RLE
MSVCMS Video 1
RT21Indeo 2.1
RV10RealVideo 1.0
RV20RealVideo 2.0
RV30RealVideo 3.0
RV40RealVideo 4.0
SNOWFFmpeg Snow
SVQ1Sorenson Video 1
SVQ3Sorenson Video 3
theoXiph Theora
TM20Truemotion 2.0
UMP4non-compliant MPEG-4 generated by UB Video MPEG-4
VCR1ATI VCR1
VP30VP 3.0
VP31VP 3.1
VP50VP 5.0
VP60VP 6.0
VP61VP 6.1
VP62VP 6.2
VP70VP 7.0
WMV1MS WMV7
WMV2MS WMV8
WMV3MS WMV9
WV1Fnon-compliant MPEG-4 generated by ?
WVC1VC-1
XVIDnon-compliant MPEG-4 generated by old Xvid
XVIXnon-compliant MPEG-4 generated by old Xvid with interlacing bug
182 | 183 |
185 | -------------------------------------------------------------------------------- /Visualization/MobMapNativeWin/ffmpeg/licenses/bzip2.txt: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------- 3 | 4 | This program, "bzip2", the associated library "libbzip2", and all 5 | documentation, are copyright (C) 1996-2010 Julian R Seward. All 6 | rights reserved. 7 | 8 | Redistribution and use in source and binary forms, with or without 9 | modification, are permitted provided that the following conditions 10 | are met: 11 | 12 | 1. Redistributions of source code must retain the above copyright 13 | notice, this list of conditions and the following disclaimer. 14 | 15 | 2. The origin of this software must not be misrepresented; you must 16 | not claim that you wrote the original software. If you use this 17 | software in a product, an acknowledgment in the product 18 | documentation would be appreciated but is not required. 19 | 20 | 3. Altered source versions must be plainly marked as such, and must 21 | not be misrepresented as being the original software. 22 | 23 | 4. The name of the author may not be used to endorse or promote 24 | products derived from this software without specific prior written 25 | permission. 26 | 27 | THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS 28 | OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 29 | WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 30 | ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY 31 | DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 32 | DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE 33 | GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 34 | INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 35 | WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING 36 | NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 37 | SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 38 | 39 | Julian Seward, jseward@bzip.org 40 | bzip2/libbzip2 version 1.0.6 of 6 September 2010 41 | 42 | -------------------------------------------------------------------------- 43 | -------------------------------------------------------------------------------- /Visualization/MobMapNativeWin/ffmpeg/licenses/fontconfig.txt: -------------------------------------------------------------------------------- 1 | fontconfig/COPYING 2 | 3 | Copyright © 2000,2001,2002,2003,2004,2006,2007 Keith Packard 4 | Copyright © 2005 Patrick Lam 5 | Copyright © 2009 Roozbeh Pournader 6 | Copyright © 2008,2009 Red Hat, Inc. 7 | Copyright © 2008 Danilo Šegan 8 | 9 | 10 | Permission to use, copy, modify, distribute, and sell this software and its 11 | documentation for any purpose is hereby granted without fee, provided that 12 | the above copyright notice appear in all copies and that both that 13 | copyright notice and this permission notice appear in supporting 14 | documentation, and that the name of the author(s) not be used in 15 | advertising or publicity pertaining to distribution of the software without 16 | specific, written prior permission. The authors make no 17 | representations about the suitability of this software for any purpose. It 18 | is provided "as is" without express or implied warranty. 19 | 20 | THE AUTHOR(S) DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, 21 | INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO 22 | EVENT SHALL THE AUTHOR(S) BE LIABLE FOR ANY SPECIAL, INDIRECT OR 23 | CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, 24 | DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER 25 | TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR 26 | PERFORMANCE OF THIS SOFTWARE. 27 | 28 | -------------------------------------------------------------------------------- /Visualization/MobMapNativeWin/ffmpeg/licenses/freetype.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SpatialDataCommons/CDR-analysis-tools-std/68862be38af4bf21ef004683c9d16bb971068b0c/Visualization/MobMapNativeWin/ffmpeg/licenses/freetype.txt -------------------------------------------------------------------------------- /Visualization/MobMapNativeWin/ffmpeg/licenses/libass.txt: -------------------------------------------------------------------------------- 1 | Permission to use, copy, modify, and/or distribute this software for any 2 | purpose with or without fee is hereby granted, provided that the above 3 | copyright notice and this permission notice appear in all copies. 4 | 5 | THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES 6 | WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF 7 | MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR 8 | ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES 9 | WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN 10 | ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF 11 | OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. 12 | -------------------------------------------------------------------------------- /Visualization/MobMapNativeWin/ffmpeg/licenses/libcaca.txt: -------------------------------------------------------------------------------- 1 | DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE 2 | Version 2, December 2004 3 | 4 | Copyright (C) 2004 Sam Hocevar 5 | 14 rue de Plaisance, 75014 Paris, France 6 | Everyone is permitted to copy and distribute verbatim or modified 7 | copies of this license document, and changing it is allowed as long 8 | as the name is changed. 9 | 10 | DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE 11 | TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION 12 | 13 | 0. You just DO WHAT THE FUCK YOU WANT TO. 14 | 15 | -------------------------------------------------------------------------------- /Visualization/MobMapNativeWin/ffmpeg/licenses/libgsm.txt: -------------------------------------------------------------------------------- 1 | Copyright 1992, 1993, 1994 by Jutta Degener and Carsten Bormann, 2 | Technische Universitaet Berlin 3 | 4 | Any use of this software is permitted provided that this notice is not 5 | removed and that neither the authors nor the Technische Universitaet Berlin 6 | are deemed to have made any representations as to the suitability of this 7 | software for any purpose nor are held responsible for any defects of 8 | this software. THERE IS ABSOLUTELY NO WARRANTY FOR THIS SOFTWARE. 9 | 10 | As a matter of courtesy, the authors request to be informed about uses 11 | this software has found, about bugs in this software, and about any 12 | improvements that may be of general interest. 13 | 14 | Berlin, 28.11.1994 15 | Jutta Degener 16 | Carsten Bormann 17 | 18 | oOo 19 | 20 | Since the original terms of 15 years ago maybe do not make our 21 | intentions completely clear given today's refined usage of the legal 22 | terms, we append this additional permission: 23 | 24 | Permission to use, copy, modify, and distribute this software 25 | for any purpose with or without fee is hereby granted, 26 | provided that this notice is not removed and that neither 27 | the authors nor the Technische Universitaet Berlin are 28 | deemed to have made any representations as to the suitability 29 | of this software for any purpose nor are held responsible 30 | for any defects of this software. THERE IS ABSOLUTELY NO 31 | WARRANTY FOR THIS SOFTWARE. 32 | 33 | Berkeley/Bremen, 05.04.2009 34 | Jutta Degener 35 | Carsten Bormann 36 | -------------------------------------------------------------------------------- /Visualization/MobMapNativeWin/ffmpeg/licenses/libilbc.txt: -------------------------------------------------------------------------------- 1 | Copyright (c) 2011, The WebRTC project authors. All rights reserved. 2 | 3 | Redistribution and use in source and binary forms, with or without 4 | modification, are permitted provided that the following conditions are 5 | met: 6 | 7 | * Redistributions of source code must retain the above copyright 8 | notice, this list of conditions and the following disclaimer. 9 | 10 | * Redistributions in binary form must reproduce the above copyright 11 | notice, this list of conditions and the following disclaimer in 12 | the documentation and/or other materials provided with the 13 | distribution. 14 | 15 | * Neither the name of Google nor the names of its contributors may 16 | be used to endorse or promote products derived from this software 17 | without specific prior written permission. 18 | 19 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 20 | "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 21 | LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 22 | A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 23 | HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 24 | SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 25 | LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 26 | DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 27 | THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 28 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 29 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 30 | -------------------------------------------------------------------------------- /Visualization/MobMapNativeWin/ffmpeg/licenses/libmodplug.txt: -------------------------------------------------------------------------------- 1 | ModPlug-XMMS and libmodplug are now in the public domain. 2 | -------------------------------------------------------------------------------- /Visualization/MobMapNativeWin/ffmpeg/licenses/libtheora.txt: -------------------------------------------------------------------------------- 1 | Copyright (C) 2002-2009 Xiph.org Foundation 2 | 3 | Redistribution and use in source and binary forms, with or without 4 | modification, are permitted provided that the following conditions 5 | are met: 6 | 7 | - Redistributions of source code must retain the above copyright 8 | notice, this list of conditions and the following disclaimer. 9 | 10 | - Redistributions in binary form must reproduce the above copyright 11 | notice, this list of conditions and the following disclaimer in the 12 | documentation and/or other materials provided with the distribution. 13 | 14 | - Neither the name of the Xiph.org Foundation nor the names of its 15 | contributors may be used to endorse or promote products derived from 16 | this software without specific prior written permission. 17 | 18 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 19 | ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 20 | LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 21 | A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION 22 | OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 23 | SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 24 | LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 25 | DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 26 | THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 27 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 28 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 29 | -------------------------------------------------------------------------------- /Visualization/MobMapNativeWin/ffmpeg/licenses/libvorbis.txt: -------------------------------------------------------------------------------- 1 | Copyright (c) 2002-2008 Xiph.org Foundation 2 | 3 | Redistribution and use in source and binary forms, with or without 4 | modification, are permitted provided that the following conditions 5 | are met: 6 | 7 | - Redistributions of source code must retain the above copyright 8 | notice, this list of conditions and the following disclaimer. 9 | 10 | - Redistributions in binary form must reproduce the above copyright 11 | notice, this list of conditions and the following disclaimer in the 12 | documentation and/or other materials provided with the distribution. 13 | 14 | - Neither the name of the Xiph.org Foundation nor the names of its 15 | contributors may be used to endorse or promote products derived from 16 | this software without specific prior written permission. 17 | 18 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 19 | ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 20 | LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 21 | A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION 22 | OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 23 | SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 24 | LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 25 | DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 26 | THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 27 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 28 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 29 | -------------------------------------------------------------------------------- /Visualization/MobMapNativeWin/ffmpeg/licenses/libvpx.txt: -------------------------------------------------------------------------------- 1 | Copyright (c) 2010, The WebM Project authors. All rights reserved. 2 | 3 | Redistribution and use in source and binary forms, with or without 4 | modification, are permitted provided that the following conditions are 5 | met: 6 | 7 | * Redistributions of source code must retain the above copyright 8 | notice, this list of conditions and the following disclaimer. 9 | 10 | * Redistributions in binary form must reproduce the above copyright 11 | notice, this list of conditions and the following disclaimer in 12 | the documentation and/or other materials provided with the 13 | distribution. 14 | 15 | * Neither the name of Google, nor the WebM Project, nor the names 16 | of its contributors may be used to endorse or promote products 17 | derived from this software without specific prior written 18 | permission. 19 | 20 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 21 | "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 22 | LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 23 | A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 24 | HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 25 | SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 26 | LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 27 | DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 28 | THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 29 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 30 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 31 | 32 | -------------------------------------------------------------------------------- /Visualization/MobMapNativeWin/ffmpeg/licenses/openjpeg.txt: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2002-2012, Communications and Remote Sensing Laboratory, Universite catholique de Louvain (UCL), Belgium 3 | * Copyright (c) 2002-2012, Professor Benoit Macq 4 | * Copyright (c) 2003-2012, Antonin Descampe 5 | * Copyright (c) 2003-2009, Francois-Olivier Devaux 6 | * Copyright (c) 2005, Herve Drolon, FreeImage Team 7 | * Copyright (c) 2002-2003, Yannick Verschueren 8 | * Copyright (c) 2001-2003, David Janssens 9 | * Copyright (c) 2011-2012, Centre National d'Etudes Spatiales (CNES), France 10 | * Copyright (c) 2012, CS Systemes d'Information, France 11 | * 12 | * All rights reserved. 13 | * 14 | * Redistribution and use in source and binary forms, with or without 15 | * modification, are permitted provided that the following conditions 16 | * are met: 17 | * 1. Redistributions of source code must retain the above copyright 18 | * notice, this list of conditions and the following disclaimer. 19 | * 2. Redistributions in binary form must reproduce the above copyright 20 | * notice, this list of conditions and the following disclaimer in the 21 | * documentation and/or other materials provided with the distribution. 22 | * 23 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS `AS IS' 24 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 25 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 26 | * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE 27 | * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 28 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 29 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 30 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 31 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 32 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 33 | * POSSIBILITY OF SUCH DAMAGE. 34 | */ 35 | -------------------------------------------------------------------------------- /Visualization/MobMapNativeWin/ffmpeg/licenses/opus.txt: -------------------------------------------------------------------------------- 1 | Copyright 2001-2011 Xiph.Org, Skype Limited, Octasic, 2 | Jean-Marc Valin, Timothy B. Terriberry, 3 | CSIRO, Gregory Maxwell, Mark Borgerding, 4 | Erik de Castro Lopo 5 | 6 | Redistribution and use in source and binary forms, with or without 7 | modification, are permitted provided that the following conditions 8 | are met: 9 | 10 | - Redistributions of source code must retain the above copyright 11 | notice, this list of conditions and the following disclaimer. 12 | 13 | - Redistributions in binary form must reproduce the above copyright 14 | notice, this list of conditions and the following disclaimer in the 15 | documentation and/or other materials provided with the distribution. 16 | 17 | - Neither the name of Internet Society, IETF or IETF Trust, nor the 18 | names of specific contributors, may be used to endorse or promote 19 | products derived from this software without specific prior written 20 | permission. 21 | 22 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 23 | ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 24 | LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 25 | A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER 26 | OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 27 | EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 28 | PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR 29 | PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF 30 | LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING 31 | NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 32 | SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 33 | 34 | Opus is subject to the royalty-free patent licenses which are 35 | specified at: 36 | 37 | Xiph.Org Foundation: 38 | https://datatracker.ietf.org/ipr/1524/ 39 | 40 | Microsoft Corporation: 41 | https://datatracker.ietf.org/ipr/1914/ 42 | 43 | Broadcom Corporation: 44 | https://datatracker.ietf.org/ipr/1526/ 45 | -------------------------------------------------------------------------------- /Visualization/MobMapNativeWin/ffmpeg/licenses/soxr.txt: -------------------------------------------------------------------------------- 1 | SoX Resampler Library Copyright (c) 2007-13 robs@users.sourceforge.net 2 | 3 | This library is free software; you can redistribute it and/or modify it 4 | under the terms of the GNU Lesser General Public License as published by 5 | the Free Software Foundation; either version 2.1 of the License, or (at 6 | your option) any later version. 7 | 8 | This library is distributed in the hope that it will be useful, but 9 | WITHOUT ANY WARRANTY; without even the implied warranty of 10 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser 11 | General Public License for more details. 12 | 13 | You should have received a copy of the GNU Lesser General Public License 14 | along with this library; if not, write to the Free Software Foundation, 15 | Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. 16 | 17 | 18 | Notes 19 | 20 | 1. Re software in the `examples' directory: works that are not resampling 21 | examples but are based on the given examples -- for example, applications using 22 | the library -- shall not be considered to be derivative works of the examples. 23 | 24 | 2. If building with pffft.c, see the licence embedded in that file. 25 | -------------------------------------------------------------------------------- /Visualization/MobMapNativeWin/ffmpeg/licenses/speex.txt: -------------------------------------------------------------------------------- 1 | Copyright 2002-2008 Xiph.org Foundation 2 | Copyright 2002-2008 Jean-Marc Valin 3 | Copyright 2005-2007 Analog Devices Inc. 4 | Copyright 2005-2008 Commonwealth Scientific and Industrial Research 5 | Organisation (CSIRO) 6 | Copyright 1993, 2002, 2006 David Rowe 7 | Copyright 2003 EpicGames 8 | Copyright 1992-1994 Jutta Degener, Carsten Bormann 9 | 10 | Redistribution and use in source and binary forms, with or without 11 | modification, are permitted provided that the following conditions 12 | are met: 13 | 14 | - Redistributions of source code must retain the above copyright 15 | notice, this list of conditions and the following disclaimer. 16 | 17 | - Redistributions in binary form must reproduce the above copyright 18 | notice, this list of conditions and the following disclaimer in the 19 | documentation and/or other materials provided with the distribution. 20 | 21 | - Neither the name of the Xiph.org Foundation nor the names of its 22 | contributors may be used to endorse or promote products derived from 23 | this software without specific prior written permission. 24 | 25 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 26 | ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 27 | LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 28 | A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR 29 | CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 30 | EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 31 | PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR 32 | PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF 33 | LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING 34 | NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 35 | SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 36 | -------------------------------------------------------------------------------- /Visualization/MobMapNativeWin/ffmpeg/licenses/zlib.txt: -------------------------------------------------------------------------------- 1 | /* zlib.h -- interface of the 'zlib' general purpose compression library 2 | version 1.2.7, May 2nd, 2012 3 | 4 | Copyright (C) 1995-2012 Jean-loup Gailly and Mark Adler 5 | 6 | This software is provided 'as-is', without any express or implied 7 | warranty. In no event will the authors be held liable for any damages 8 | arising from the use of this software. 9 | 10 | Permission is granted to anyone to use this software for any purpose, 11 | including commercial applications, and to alter it and redistribute it 12 | freely, subject to the following restrictions: 13 | 14 | 1. The origin of this software must not be misrepresented; you must not 15 | claim that you wrote the original software. If you use this software 16 | in a product, an acknowledgment in the product documentation would be 17 | appreciated but is not required. 18 | 2. Altered source versions must be plainly marked as such, and must not be 19 | misrepresented as being the original software. 20 | 3. This notice may not be removed or altered from any source distribution. 21 | 22 | Jean-loup Gailly Mark Adler 23 | jloup@gzip.org madler@alumni.caltech.edu 24 | 25 | */ 26 | 27 | -------------------------------------------------------------------------------- /Visualization/MobMapNativeWin/ffmpeg/presets/libvpx-1080p.ffpreset: -------------------------------------------------------------------------------- 1 | vcodec=libvpx 2 | 3 | g=120 4 | lag-in-frames=16 5 | deadline=good 6 | cpu-used=0 7 | vprofile=1 8 | qmax=51 9 | qmin=11 10 | slices=4 11 | b=2M 12 | 13 | #ignored unless using -pass 2 14 | maxrate=24M 15 | minrate=100k 16 | auto-alt-ref=1 17 | arnr-maxframes=7 18 | arnr-strength=5 19 | arnr-type=centered 20 | -------------------------------------------------------------------------------- /Visualization/MobMapNativeWin/ffmpeg/presets/libvpx-1080p50_60.ffpreset: -------------------------------------------------------------------------------- 1 | vcodec=libvpx 2 | 3 | g=120 4 | lag-in-frames=25 5 | deadline=good 6 | cpu-used=0 7 | vprofile=1 8 | qmax=51 9 | qmin=11 10 | slices=4 11 | b=2M 12 | 13 | #ignored unless using -pass 2 14 | maxrate=24M 15 | minrate=100k 16 | auto-alt-ref=1 17 | arnr-maxframes=7 18 | arnr-strength=5 19 | arnr-type=centered 20 | -------------------------------------------------------------------------------- /Visualization/MobMapNativeWin/ffmpeg/presets/libvpx-360p.ffpreset: -------------------------------------------------------------------------------- 1 | vcodec=libvpx 2 | 3 | g=120 4 | lag-in-frames=16 5 | deadline=good 6 | cpu-used=0 7 | vprofile=0 8 | qmax=63 9 | qmin=0 10 | b=768k 11 | 12 | #ignored unless using -pass 2 13 | maxrate=1.5M 14 | minrate=40k 15 | auto-alt-ref=1 16 | arnr-maxframes=7 17 | arnr-strength=5 18 | arnr-type=centered 19 | -------------------------------------------------------------------------------- /Visualization/MobMapNativeWin/ffmpeg/presets/libvpx-720p.ffpreset: -------------------------------------------------------------------------------- 1 | vcodec=libvpx 2 | 3 | g=120 4 | lag-in-frames=16 5 | deadline=good 6 | cpu-used=0 7 | vprofile=0 8 | qmax=51 9 | qmin=11 10 | slices=4 11 | b=2M 12 | 13 | #ignored unless using -pass 2 14 | maxrate=24M 15 | minrate=100k 16 | auto-alt-ref=1 17 | arnr-maxframes=7 18 | arnr-strength=5 19 | arnr-type=centered 20 | -------------------------------------------------------------------------------- /Visualization/MobMapNativeWin/ffmpeg/presets/libvpx-720p50_60.ffpreset: -------------------------------------------------------------------------------- 1 | vcodec=libvpx 2 | 3 | g=120 4 | lag-in-frames=25 5 | deadline=good 6 | cpu-used=0 7 | vprofile=0 8 | qmax=51 9 | qmin=11 10 | slices=4 11 | b=2M 12 | 13 | #ignored unless using -pass 2 14 | maxrate=24M 15 | minrate=100k 16 | auto-alt-ref=1 17 | arnr-maxframes=7 18 | arnr-strength=5 19 | arnr-type=centered 20 | -------------------------------------------------------------------------------- /Visualization/MobMapNativeWin/ffmpeg/presets/libx264-ipod320.ffpreset: -------------------------------------------------------------------------------- 1 | vcodec=libx264 2 | 3 | vprofile=baseline 4 | level=13 5 | maxrate=768000 6 | bufsize=3000000 7 | -------------------------------------------------------------------------------- /Visualization/MobMapNativeWin/ffmpeg/presets/libx264-ipod640.ffpreset: -------------------------------------------------------------------------------- 1 | vcodec=libx264 2 | 3 | vprofile=baseline 4 | level=30 5 | maxrate=10000000 6 | bufsize=10000000 7 | -------------------------------------------------------------------------------- /Visualization/MobMapNativeWin/run.bat: -------------------------------------------------------------------------------- 1 | @ehco off 2 | :: 2013-12-09 Movie creation with MobMapNative4Win ****** :: 3 | :: - configuration specification described by H.Kanasugi :: 4 | :: :: 5 | :: [Preparation] :: 6 | :: 1) install ruby :: 7 | :: 2) online environment for obtaining base map images :: 8 | :: ****************************************************** :: 9 | 10 | 11 | :: [check and modify if required] *********************** :: 12 | :: update path configuration of ruby :: 13 | :: ****************************************************** :: 14 | set PATH=%PATH%;C:\ruby\Ruby-2.0.0-x64\bin 15 | 16 | 17 | :: set file pathes ************************************** :: 18 | :: MDIR : mobmap dir :: 19 | :: MOBMAP: executable file of mobmap native :: 20 | :: PRESET: configuration file path for mobmap :: 21 | :: FFMPEG: executable file of ffmpeg(movie creation) :: 22 | :: FRAMES: file path for frame images generated by mobmap :: 23 | :: MOVIE : destination file of movie creation process :: 24 | :: ****************************************************** :: 25 | 26 | :: run MobMapNativeWin ********************************** :: 27 | set MDIR=MobMapNativeWin 28 | set MOBMAP=MobmapNativeWin.exe 29 | set PRESET=presets\sample.json 30 | 31 | cd %MDIR% 32 | %MOBMAP% -f %PRESET% -x yes 33 | cd .. 34 | 35 | :: run ffmpeg for movie creation ************************ :: 36 | set FFMPEG=ffmpeg\bin\ffmpeg.exe 37 | set FRAMES=MobMapNativeWin\out\frames 38 | set MOVIE=MobMapNativeWin\out\movies\result.mp4 39 | 40 | %FFMPEG% -i %FRAMES%\%%04d.png ^ 41 | -c:v libx264 ^ 42 | -pix_fmt yuv420p ^ 43 | %MOVIE% 44 | 45 | 46 | pause 47 | -------------------------------------------------------------------------------- /Visualization/MobmapWeb/MobmapTutorial.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SpatialDataCommons/CDR-analysis-tools-std/68862be38af4bf21ef004683c9d16bb971068b0c/Visualization/MobmapWeb/MobmapTutorial.pdf -------------------------------------------------------------------------------- /Visualization/MobmapWeb/README.md: -------------------------------------------------------------------------------- 1 | # Mobmap: Visualization and Analysis of Movement Data 2 | An online tool for visualization and analysis of movement/trajectory data such as GPS/CDR. with its functionally, it supports color labeling, various maker style and data filter. 3 | 4 | ![Screenshot](docs/mobmap.JPG) 5 | 6 | 7 | ## How it works 8 | In principle, [Mobmap](https://shiba.iis.u-tokyo.ac.jp/member/ueyama/mm/) is an online tool which can be accessed via web browser (Google Chrome). You can load input data in CSV format, then visualize on map with time-series movement, adjust marker style, change color with attribute, change basemap and apply data filter. 9 | 10 | 11 | 12 | ## Usage 13 | 14 | 1. Access to [Mobmap](https://shiba.iis.u-tokyo.ac.jp/member/ueyama/mm/) Website and click "Lunch" button 15 | 2. Load input data in CSV format and selected columns correspond to the column definition. 16 | 3. Click “Start loading” to load CSV data 17 | 4. Click "Play" to start see movement data on map 18 | 5. Adjust parameters at your preference. 19 | 20 | 21 | ## Tutorial 22 | 23 | Please access to the link to download tutorial file: [MobmapTutorial](MobmapTutorial.pdf) 24 | 25 | 26 | ## Input File (CSV) 27 | 28 | * The inpurt file must be in CSV format with comma separated. 29 | * File must contain at least the following attributes. 30 | ``` 31 | Object ID : Positive Integer value 32 | Time : “ hh:mm:ss ” or “YYYY MM DD hh:mm:ss ” format need to be sort in time order 33 | Latitude : Real Number(decimal degree) in WGS84 34 | Longitude : Real decimal degree) in WGS84 35 | ``` 36 | * Columns don’t have to be fixed with the following order 37 | * Additional columns are acceptable, e.g. transportation 38 | * Header line can exclude at loading data 39 | 40 | ![Screenshot](docs/csvformat.JPG) 41 | 42 | ## Personal use 43 | 44 | Mobmap is hosted on the web and loads base map from the internet. However, your own data will be loaded and processed on your local PC. Don't worry about data leakage, network traffic or server usage. 45 | 46 | ## Author 47 | **Satoshi Ueyama** : A project researcher at Center for Spatial Information Science, University of Tokyo, Japan until Oct. 2019, will be a researcher at LocationMind Inc. from Nov. 2019. 48 | In 2019 he obtained his Ph.D. in Engineering from the University of Tokyo. And he is interested in utilizing visualization and computer graphics in the field of geographic information. 49 | 50 | 51 | ## License 52 | 53 | Free to use 54 | 55 | ## Acknowledgments 56 | * [Spatial Data Commons](http://sdc.csis.u-tokyo.ac.jp/), CSIS, The University of Tokyo 57 | * [Shibasaki Lab](https://shiba.iis.u-tokyo.ac.jp), The University of Tokyo 58 | * [Center for Spatial Information Science](http://www.csis.u-tokyo.ac.jp/en/), The University of Tokyo 59 | 60 | -------------------------------------------------------------------------------- /Visualization/MobmapWeb/docs/csvformat.JPG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SpatialDataCommons/CDR-analysis-tools-std/68862be38af4bf21ef004683c9d16bb971068b0c/Visualization/MobmapWeb/docs/csvformat.JPG -------------------------------------------------------------------------------- /Visualization/MobmapWeb/docs/mobmap.JPG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SpatialDataCommons/CDR-analysis-tools-std/68862be38af4bf21ef004683c9d16bb971068b0c/Visualization/MobmapWeb/docs/mobmap.JPG -------------------------------------------------------------------------------- /Visualization/MobmapWeb/docs/mobmap.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SpatialDataCommons/CDR-analysis-tools-std/68862be38af4bf21ef004683c9d16bb971068b0c/Visualization/MobmapWeb/docs/mobmap.png -------------------------------------------------------------------------------- /Visualization/README.md: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SpatialDataCommons/CDR-analysis-tools-std/68862be38af4bf21ef004683c9d16bb971068b0c/Visualization/README.md --------------------------------------------------------------------------------