Giter VIP home page Giter VIP logo

tickets's People

Contributors

bpeng avatar

Watchers

 avatar  avatar

tickets's Issues

Docker

=== install/start docker === 
 1003  sudo yum install docker-io
      sudo systemctl start docker.service
 1021  sudo systemctl status docker.service

 1023   sudo docker run busybox echo hello world
=== run image container ===
 1027  sudo docker images

 1028  sudo docker run busybox echo 'hello'
 1029  time  sudo docker run busybox echo hello world
 1030  sudo docker run busybox ping google.com
 1031  sudo docker run -it ubuntu /bin/bash

 1035  sudo docker run -p 8000:80 atbacker/nginx-example
 1036  sudo docker run -p 8000:80 atbaker/nginx-example
 1037  sudo docker ps -a
 1039  sudo docker ps -a

 1040  time  sudo docker run docker.service

 1045  sudo docker ps -a

 1050  sudo systemctl status docker.service

 1052  sudo docker run -it ubuntu /bin/bash

 1056  sudo docker rm 88e617a00e73
 1057  sudo docker run -p 8000:80 atbaker/nginx-example
 1059  sudo docker run -d -p  8000:80 atbaker/nginx-example
 1060  sudo docker ps
 1061  sudo docker ps -a
 1063  sudo docker stop a67fb408f218
 1003  sudo yum install docker-io
 1004   sudo docker run busybox echo hello world
 1005  docker start
 1006  boot2docker start
 1007   sudo docker run busybox echo hello world
 1008  docker images
 1009  docker version
 1010  FATA[0000] Get http:///var/run/docker.sock/v1.16/version: dial unix /var/run/docker.sock: no such file or directory. Are you trying to connect to a TLS-enabled daemon without TLS?
 1011  boot2docker shellinit
 1012  $(boot2docker shellinit)
 1013  docker
 1015   sudo docker run busybox echo hello world
 1016  sudo systemctl start docker.service
 1017   sudo docker run busybox echo hello world
 1020   sudo docker run busybox echo hello world
 1021  sudo systemctl status docker.service
 1022  docker images
 1023   sudo docker run busybox echo hello world
 1024  docker
 1025  docker image
 1026  docker images
 1027  sudo docker images
 1028  sudo docker run busybox echo 'hello'
 1029  time  sudo docker run busybox echo hello world
 1030  sudo docker run busybox ping google.com
 1031  sudo docker run -it ubuntu /bin/bash
 1032  sudo docker run -it busybox /bin/sh 
 1034  sudo docker run -it busybox /bin/sh 
 1035  sudo docker run -p 8000:80 atbacker/nginx-example
 1036  sudo docker run -p 8000:80 atbaker/nginx-example
 1037  sudo docker ps -a
 1039  sudo docker ps -a
 1040  time  sudo docker run docker.service
 1041   sudo docker run docker.service
 1042   sudo docker run 60c976162915
 1045  sudo docker ps -a
 1046  sysctl status docker
 1050  sudo systemctl status docker.service
 1051  docker
 1052  sudo docker run -it ubuntu /bin/bash
 1053  sudo docker run -p 8000:80 atbaker/nginx-example
 1054  sudo docker images
 1055  sudo docker images -a
 1056  sudo docker rm 88e617a00e73
 1057  sudo docker run -p 8000:80 atbaker/nginx-example
 1058  sudo docker run -p -d  8000:80 atbaker/nginx-example
 1059  sudo docker run -d -p  8000:80 atbaker/nginx-example
 1060  sudo docker ps
 1061  sudo docker ps -a
 1062  sudo docker ps
 1063  sudo docker stop a67fb408f218
 1064  sudo docker ps
 1065  sudo docker rm  a67fb408f218
 1066  sudo docker ps
 1067  sudo docker ps -a
 1068  sudo docker rm  bc29dc52455a
 1069  sudo docker rm  09e79657d82c
 1070  sudo docker rm  93f712a5cd5a
 1071  sudo docker ps -a
 1072  sudo docker run -p -d --name webserver  8000:80 atbaker/nginx-example
 1073  sudo docker run -p --name webserver  8000:80 atbaker/nginx-example
 1074  sudo docker run -p   8000:80 --name webserver atbaker/nginx-example

 1064  sudo docker ps
 1065  sudo docker rm  a67fb408f218
 1066  sudo docker ps
 1067  sudo docker ps -a

=== stop/start/remove containers====
 1074  sudo docker run -d -p   8000:80 --name webserver atbaker/nginx-example

1043   sudo docker stop webserver
1043   sudo docker start webserver
1043   sudo docker rm webserver

 1003  sudo docker logs webserver
 1005  sudo docker diff  webserver
 1015  sudo docker inspect  webserver
 1016  sudo docker cp webserver:/usr/share/nginx/html/index.html .
 1020  sudo docker inspect 
 1021  sudo docker ps
 1022  sudo docker ps -aq

--- remove all containers ---
 1024  sudo docker rm -f $(sudo docker ps -aq)
 1025  sudo docker ps -aq
 1026  sudo docker ps -a

 sudo docker rmi -f $(sudo docker images -aq)
sudo docker rm $(sudo docker ps -a |grep mapserver | awk '{ print $1 }')

--- build from docker file ---
 sudo docker build -t nginx-static .
 sudo docker run  -p 8080:80 nginx-static
 (expose 80--on container, 8080 on host)
 sudo docker ps
 sudo docker inspect fe9ee3f0e4d
 (note network settings)
 <code>
 "NetworkSettings": {
        "Bridge": "docker0",
        "Gateway": "172.17.42.1",
        "IPAddress": "172.17.0.32",
        "IPPrefixLen": 16,
        "MacAddress": "02:42:ac:11:00:20",
        "PortMapping": null,
        "Ports": {
            "443/tcp": null,
            "80/tcp": [
                {
                    "HostIp": "0.0.0.0",
                    "HostPort": "8080"
                }
            ]
        }
    },

  access from http://172.17.42.1:8080/ or http://localhost:8080/
</code>



=== geonet ===
https://github.com/GeoNet/geonet/blob/master/README-DB.md

-- remove image
sudo docker rmi  3e643e0df8dc

-- docker build specify directory for docker file
sudo docker build -t 'geonet/postgis' ./db/
sudo docker run --name geonet_postgis -p 5432:5432 -i -d -t geonet/geonet

------ geonet-news-md
sudo docker build  -t 'geonet-news-md' .
sudo docker run --name geonet-news-md -p 8080:8080 -i -d -t geonet-news-md
sudo docker stop/start geonet-news-md


sudo docker run --name geonet-fits-web -p 8080:8080 -i -d -t geonet-fits-web

-- find ip address of a running container:
docker inspect --format '{{ .NetworkSettings.IPAddress }}' geonet_fit

sudo docker run -e "FITS_DATABASE_HOST=172.17.0.2"  -e "FITS_DATABASE_PASSWORD=test" -e "FITS_DATABASE_SSL_MODE=disable" -e "FITS_DATABASE_MAX_OPEN_CONNS=30" -e "FITS_DATABASE_MAX_IDLE_CONNS=20" -e "FITS_WEB_SERVER_PORT=8080" -e "FITS_WEB_SERVER_CNAME=localhost" -e "FITS_WEB_SERVER_PRODUCTION=false" -e "LIBRATO_USER=" -e "LIBRATO_KEY=" -e "LOGENTRIES_TOKEN="  -p 8080:8080 geonet-fits-web


psql --host=127.0.0.1  --username=hazard_w hazard -f events.ddl

------
hazdb docker

 cd dev/go/src/github.com/GeoNet/haz/etc/
# 1. build image
  518  sudo docker build -t 'hazdb' ./
  519  sudo docker images
  521  sudo docker ps -a
# 2. run container  
  523  sudo docker run --name hazdb -p 5432:5432 -i -d -t hazdb
  524  sudo docker ps -a
# 3. init db
  527  ll scripts/
  528  ./scripts/initdb.sh 

# 4. load quakes into db
cd cmd/haz-db-loader 
# vim env.list # edit SC3_SPOOL_DIR=/Users/baishan/work/seismcompml07  
envlist
export SC3_SPOOL_DIR=/Users/baishan/work/seismcompml07 
./haz-db-loader 


======
2016-03-11
update docker
https://docs.docker.com/linux/step_one/

sudo yum remove libdb4-4.8.30-11.fc20.x86_64
sudo yum remove libertas-usb8388-firmware-20150521-48.git3161bfa4.fc20.noarch
sudo yum remove libgssglue-0.4-2.fc19.x86_64
sudo yum remove liblognorm-0.3.7-1.fc20.x86_64
sudo yum remove libmicrohttpd-0.9.34-2.fc20.x86_64
sudo yum remove libopenraw-gnome-0.0.9-6.fc20.x86_64
sudo yum remove libproxy-mozjs-0.4.11-8.fc20.x86_64
sudo yum remove libreoffice-4.2.8.2-8.fc20.x86_64
sudo yum remove libreoffice-langpack-en-4.2.8.2-8.fc20.x86_64
sudo yum remove libreport-newt-2.2.3-3.fc20.x86_64
sudo yum remove libsane-hpaio-3.14.10-3.fc20.x86_64
sudo yum remove libytnef-1.5-11.fc20.x86_64
sudo yum remove libzeitgeist-0.3.18-5.fc20.x86_64
sudo yum remove pulseaudio-libs-glib2-5.0-25.fc20.i686


Android

GO

https://github.com/uber/go-torch

[9:46 AM] Howard Wu: Try add "GOSSAFUNC=" env var as prefix when you do go build. You can see how go compiler optimises your code.
[9:47 AM] Howard Wu: For example "GOSSAFUNC=main go build"โ€‚โ€‚("main" is the function you wanna know how is being optimised). Then it generates some reports in the console and "ssa.html". You can open that html to see the optimisation processes.

OSM tiles regeneration 2016

Re-rendering OSM tiles 2016-05-20

1. OSM Data source:

1.1 Docs

https://gist.github.com/jpetazzo/5177554
https://github.com/gravitystorm/openstreetmap-carto/blob/master/INSTALL.md
http://planet.openstreetmap.org/
http://wiki.openstreetmap.org/wiki/Planet.osm#Downloading
http://wiki.openstreetmap.org/wiki/Downloading_data
http://wiki.openstreetmap.org/wiki/Planet.osm#Country_and_area_extracts

1.2 Dowload from http://download.geofabrik.de/

-- updated 2016-05-21 THIS IS THE ONLY WORKING SERVER!!!
wget http://download.geofabrik.de/australia-oceania-latest.osm.pbf
wget http://download.geofabrik.de/australia-oceania/new-zealand-latest.osm.pbf

but unable to download chatham islands, use past data

1.3 world boundaries
https://github.com/gravitystorm/openstreetmap-carto/blob/master/INSTALL.md
http://wiki.openstreetmap.org/wiki/Mapnik/Installation_on_Fedora_18

1.4 previous data source
wget -O new_zealand.osm http://www.informationfreeway.org/api/0.6/*[bbox=165.9,-47.9,179.0,-34.0]
wget -O new_zealand.osm 'http://api.openstreetmap.org/api/0.6/map?bbox=165.9,-47.9,179.0,-34.0'

wget -O chathams.osm http://www.informationfreeway.org/api/0.6/*[bbox=-177.4,-44.5,-175.7,-43.5]
wget http://downloads.cloudmade.com/oceania/new_zealand/new_zealand.osm.bz2
wget http://downloads.cloudmade.com/oceania/new_zealand/new_zealand.osm.administrative.bz2
wget http://downloads.cloudmade.com/oceania/new_zealand/new_zealand.osm.coastline.bz2

no longer available

1.5 download from central server
wget -O new_zealand.osm "http://api.openstreetmap.org/api/0.6/map?bbox=165.9,-47.9,179.0,-34.0"
https://help.openstreetmap.org/questions/8543/wget-cant-download-requested-file
The maximum bbox size is 0.25, and your request was too large. Either request a smaller area, or use planet.osm

2. create gis db

use geonet_haz_db docker image (haz database)
-- steps

psql --host=127.0.0.1 --username=postgres       

CREATE DATABASE gis WITH OWNER postgres TEMPLATE template0 ENCODING 'UTF8' ;
ALTER DATABASE gis SET timezone TO UTC; 
\connect gis;
create extension postgis;

create role apache WITH LOGIN PASSWORD 'test'; 

GRANT ALL ON SCHEMA PUBLIC TO apache;
grant all on spatial_ref_sys to apache;
grant all on geography_columns to apache;
grant all on geometry_columns to apache;

3. Load osm data to pgsql

3.1 install osm2pgsql
sudo dnf install osm2pgsql

3.2 load data to pgsql
there is a newer Carto css styles (no clear doc for how to use):
https://github.com/gravitystorm/openstreetmap-carto
https://github.com/gravitystorm/openstreetmap-carto/blob/master/INSTALL.md
https://github.com/mapbox/carto

osm2pgsql -c -s -C 2000 -H 127.0.0.1 -d gis -U apache -W -p anz --style openstreetmap-carto/openstreetmap-carto.style data/new-zealand-latest.osm.pbf 

osm2pgsql -a -s -C 2000 -H 127.0.0.1 -d gis -U apache -W -p anz --style openstreetmap-carto/openstreetmap-carto.style data/chatham_islands.osm.bz2 
osm2pgsql -a -s -C 2000 -H 127.0.0.1 -d gis -U apache -W -p anz --style openstreetmap-carto/openstreetmap-carto.style data/chatham_islands.administrative.osm.bz2  
osm2pgsql -a -s -C 2000 -H 127.0.0.1 -d gis -U apache -W -p anz --style openstreetmap-carto/openstreetmap-carto.style data/chatham_islands.coastline.osm.bz2  
osm2pgsql -a -s -C 2000 -H 127.0.0.1 -d gis -U apache -W -p anz --style openstreetmap-carto/openstreetmap-carto.style data/chatham_islands.highway.osm.bz2 

but we use the old default style (NZ):
cd osm
osm2pgsql -c -s -C 2000 -H 127.0.0.1 -d gis -U apache -W -p anz data/new-zealand-latest.osm.pbf

chatham_islands use past data as there is no where to download
osm2pgsql -a -s -C 2000 -H 127.0.0.1 -d gis -U apache -W -p anz data/chatham_islands.osm.bz2 
osm2pgsql -a -s -C 2000 -H 127.0.0.1 -d gis -U apache -W -p anz data/chatham_islands.administrative.osm.bz2 
osm2pgsql -a -s -C 2000 -H 127.0.0.1 -d gis -U apache -W -p anz data/chatham_islands.coastline.osm.bz2 
osm2pgsql -a -s -C 2000 -H 127.0.0.1 -d gis -U apache -W -p anz data/chatham_islands.highway.osm.bz2

osm2pgsql -a -s -C 2000 -H 127.0.0.1 -d gis -U apache -W -p anz  data/chatham_islands.highway.osm.bz2

3.3 issues: key violation
3.3.1 Osm2pgsql failed due to ERROR: PREPARE insert_node (int8, int4, int4, text[]) AS INSERT INTO anz_nodes VALUES ($1,$2,$3,$4);
PREPARE get_node (int8) AS SELECT lat,lon,tags FROM anz_nodes WHERE id = $1 LIMIT 1;
PREPARE get_node_list(int8[]) AS SELECT id, lat, lon FROM anz_nodes WHERE id = ANY($1::int8[]);
PREPARE delete_node (int8) AS DELETE FROM anz_nodes WHERE id = $1;
failed: ERROR: relation "anz_nodes" does not exist
LINE 1: ...rt_node (int8, int4, int4, text[]) AS INSERT INTO anz_nodes ...

osm2pgsql-dev/osm2pgsql#126 (have to be slim mode, solved)

3.3.2 duplicate key value violates unique constraint "nz_nodes_pkey": not solved, affect chatham_islands.highway, chatham_islands.coastline
Reading in file: data/chatham_islands.highway.osm.bz2

COPY_END for COPY anz_ways FROM STDIN;
failed: ERROR: duplicate key value violates unique constraint "anz_ways_pkey"
DETAIL: Key (id)=(53435516) already exists.

Reading in file: data/chatham_islands.coastline.osm.bz2
node cache: stored: 12(100.00%), storage efficiency: 1.15% (dense blocks: 1, sparse nodes: 11), hit rate: 0.00%
Osm2pgsql failed due to ERROR: insert_node failed: ERROR: duplicate key value violates unique constraint "anz_nodes_pkey"
DETAIL: Key (id)=(189916239) already exists.

check
select * from gis.anz_polygon where name like 'Lake Taupo'

4. Render map tiles

4.1 install mapnik
https://github.com/mapnik/mapnik/wiki/Mapnik-Installation

sudo dnf install mapnik mapnik-devel mapnik-python proj-epsg

4.2 Create MAPNIK_MAP_FILE

svn co http://svn.openstreetmap.org/applications/rendering/mapnik
cd mapnik
./generate_xml.py osm.xml anz_osm.xml --host 127.0.0.1 --port 5432 --user 'apache' --dbname gis --symbols ./symbols/ --world_boundaries ../data/world_boundaries/  --password 'test'  --prefix='anz'
vi anz_osm.xml
  export MAPNIK_MAP_FILE="anz_osm.xml" 
  export MAPNIK_TILE_DIR="tiles/" 

  cp archive/set-mapnik-env .
  vim set-mapnik-env
  change "export MAPNIK_DBNAME='osm'" to 'gis'
  change "export MAPNIK_DBUSER=`whoami`" to 'apache'

  ...
  source set-mapnik-env
  ./generate_image.py 

4.3 Render tiles
4.3.1. whole world for zoom levels 0-8

  cp generate_tiles.py generate_tiles_world.py
  vim generate_tiles_world.py ##change zoom level 0-8, bbox
  source set-mapnik-env  
  ./generate_tiles_world.py

4.3.2. NZ region for zoom levels 9 - 13

   cp generate_tiles.py generate_tiles_nz.py
   vim generate_tiles_nz.py ## zoom level 9-13
   source set-mapnik-env
   ./generate_tiles_nz.py

4.3.3. Zoom levels 14 - 15
http://api.openstreetmap.org/
define regions (to reduce the tiles on the ocean)
from South to North:

  r1: Southland
   cp generate_tiles.py generate_tiles_r1.py   
   vim generate_tiles_r1.py
   source set-mapnik-env
   ./generate_tiles_r1.py

  r2: Central south island
  r3: North south island
  r4: south North Island
  r5: central North Island
  r6: North North Island

4.3.4. Zoom level 16-18

  city centres
  z0: wellington
  cp generate_tiles.py generate_tiles_z0.py
  source set-mapnik-env
   ./generate_tiles_z0.py

  z0: wellington
  z01: chch
  z1: akl
  z2: hamilton
  z3: dunedin
  z4: tauranga  
  z5: taupo
  z6: rotorua
  z7: gisborne
  z8: napier
  z9: palmerston north
  z10: queenstown
  z11: invercargill
  z12: new plymouth
  z13: whanganui
  z14: nelson ## 173.16,-41.36,173.30,-41.26   

======
4.4 to view
4.4.1 http://hutl14681.gns.cri.nz/hazard/osm-leaflet.html
4.4.2 Issue: Chathem Ialands outlines missing, resulted from the key violation during osm2pgsql
solution: use tiles created in 2013 for zoom levels 0~8

5. redo chathem islands with separate database

5.1. create gis1 db
use geonet_haz_db docker image (haz database)
-- steps

    psql --host=127.0.0.1 --username=postgres       

    CREATE DATABASE gis1 WITH OWNER postgres TEMPLATE template0 ENCODING 'UTF8' ;
    ALTER DATABASE gis1 SET timezone TO UTC; 
    \connect gis1;
    create extension postgis;

    create role apache WITH LOGIN PASSWORD 'test'; 

    GRANT ALL ON SCHEMA PUBLIC TO apache;
    grant all on spatial_ref_sys to apache;
    grant all on geography_columns to apache;
    grant all on geometry_columns to apache;

5.2. Load osm data to pgsql

5.2.1 use carto css

cd /home/postgres/osm
git clone https://github.com/gravitystorm/openstreetmap-carto                                  

5.2.2 osm2pgsql

osm2pgsql -c -s -C 2000 -H 127.0.0.1 -d gis1 -U apache -W -p chathem --style openstreetmap-carto/openstreetmap-carto.style data/chatham_islands.osm.bz2 
osm2pgsql -a -s -C 2000 -H 127.0.0.1 -d gis1 -U apache -W -p chathem --style openstreetmap-carto/openstreetmap-carto.style data/chatham_islands.administrative.osm.bz2  
osm2pgsql -a -s -C 2000 -H 127.0.0.1 -d gis1 -U apache -W -p chathem --style openstreetmap-carto/openstreetmap-carto.style data/chatham_islands.coastline.osm.bz2  
osm2pgsql -a -s -C 2000 -H 127.0.0.1 -d gis1 -U apache -W -p chathem --style openstreetmap-carto/openstreetmap-carto.style data/chatham_islands.highway.osm.bz2 

still got key violations
Reading in file: data/chatham_islands.administrative.osm.bz2
Processing: Node(0k 0.0k/s) Way(0k 0.00k/s) Relation(93 93.00/s)  parse time: 1s
Node stats: total(0), max(0) in 0s
Way stats: total(0), max(0) in 0s
Relation stats: total(93), max(911376) in 1s
COPY_END for COPY chathem_rels FROM STDIN;
 failed: ERROR:  duplicate key value violates unique constraint "chathem_rels_pkey"
DETAIL:  Key (id)=(899077) already exists.
CONTEXT:  COPY chathem_rels, line 1

alter table chathem_rels drop constraint chathem_rels_pkey;

5.3 render tiles

 cp generate_tiles.py generate_tiles_chatham_large_area_0_8.py
  vim generate_tiles_chatham_large_area_0_8 ##change zoom level 0-8, bbox

  ./generate_xml.py osm.xml chathem_osm.xml --host 127.0.0.1 --port 5432 --user 'apache' --dbname gis1 --symbols ./symbols/ --world_boundaries ../data/world_boundaries/  --password 'test'  --prefix='chathem'
  export MAPNIK_MAP_FILE="chathem_osm.xml" 
  export MAPNIK_TILE_DIR="tiles/" 
  ./generate_tiles_chatham_large_area_0_8.py

  ./generate_tiles_chatham.py

result:
/home/postgres/osm/tiles_2016_chatham
still missing the coastlines

6. re render zoom level 0-8 for australia-oceania using carto-css

6.1 re create database gis;

6.2

osm2pgsql -c -s -C 2000 -H 127.0.0.1 -d gis -U apache -W -p anz --style openstreetmap-carto/openstreetmap-carto.style data/australia-oceania-latest.osm.pbf

6.3

 ./generate_xml.py osm.xml anz.xml --host 127.0.0.1 --port 5432 --user 'apache' --dbname gis --symbols ./symbols/ --world_boundaries ../data/world_boundaries/  --password 'test'  --prefix='anz'

cp generate_tiles_world.py generate_tiles_anz_0_8.py
export MAPNIK_MAP_FILE="anz.xml" 
export MAPNIK_TILE_DIR="tiles/"
./generate_tiles_anz_0_8.py

mv mapnik/tiles tiles_2016_anz_0_8

cp -r tiles_2016_anz_0_8/* /var/www/html/static/tiles/

  1. copy past according tiles for chatham from that redered in 2013
    7.1 find according tiles:
cd /home/postgres/osm/
find tiles_2016_chatham_0_8 |grep png
cp -r tiles_2016_chatham_0_8  tiles_2013_chatham_0_8

cp mapnik_2013/tiles/0/0/0.png tiles_2013_chatham_0_8/0/0/
cp mapnik_2013/tiles/1/0/1.png tiles_2013_chatham_0_8/1/0/
cp mapnik_2013/tiles/2/0/2.png tiles_2013_chatham_0_8/2/0/
cp mapnik_2013/tiles/3/0/5.png tiles_2013_chatham_0_8/3/0/
cp mapnik_2013/tiles/4/0/10.png tiles_2013_chatham_0_8/4/0/
cp mapnik_2013/tiles/5/0/20.png tiles_2013_chatham_0_8/5/0/
cp mapnik_2013/tiles/6/0/40.png tiles_2013_chatham_0_8/6/0/
cp mapnik_2013/tiles/7/0/81.png tiles_2013_chatham_0_8/7/0/
cp mapnik_2013/tiles/7/1/81.png tiles_2013_chatham_0_8/7/1/
cp mapnik_2013/tiles/8/1/163.png tiles_2013_chatham_0_8/8/1/
cp mapnik_2013/tiles/8/1/162.png tiles_2013_chatham_0_8/8/1/
cp mapnik_2013/tiles/8/2/163.png tiles_2013_chatham_0_8/8/2/
cp mapnik_2013/tiles/8/2/162.png tiles_2013_chatham_0_8/8/2/
cp mapnik_2013/tiles/8/3/163.png tiles_2013_chatham_0_8/8/3/
cp mapnik_2013/tiles/8/3/162.png tiles_2013_chatham_0_8/8/3/

7.2 copy 2013 tiles to final directory:

cp -r tiles_2013_chatham_0_8/* /var/www/html/static/tiles/

FINAL RESULT

  1. ZOOM LEVELS 9-18 NZ:
    OSM data downloaded 2016 new-zealand-latest.osm.pbf
    zoom levels 16-18 for cities and towns
    redered 5/2016

in /home/postgres/osm/tiles_2016_nz_9_18/

  1. ZOOM LEVEL 9-15 CHATHAM ISLANDS
    osm data downloaded in 2013
    rendered in 5/2016
    IN /home/postgres/osm/tiles_2016_chatham_9_15

3 .ZOOM LEVELS (world and NZ) 0-8
OSM data downloaded 2016 australia-oceania-latest.osm.pbf
redered 5/2016
IN /home/postgres/osm/tiles_2016_anz_0_8

4 . ZOOM LEVELS 0-8 FOR CHATHAM ISLANDS
use tiles rendered in 2013 as there is a missing coastline issue
IN /home/postgres/osm/tiles_2013_chatham_0_8

  1. cmd:
mkdir -p /var/www/html/tiles/
cp -r /home/postgres/osm/tiles_2016_nz_9_18/*  /var/www/html/tiles/
cp -r /home/postgres/osm/tiles_2016_chatham_9_15/*  /var/www/html/tiles/
cp -r /home/postgres/osm/tiles_2016_anz_0_8/*  /var/www/html/tiles/
cp -r /home/postgres/osm/tiles_2013_chatham_0_8/*  /var/www/html/tiles/

cd /var/www/html/static/
tar cjf /home/postgres/osm/osm_tiles_2016.tar.bz2 tiles/

Swift

resource:

https://developer.apple.com/library/content/documentation/Swift/Conceptual/Swift_Programming_Language/GuidedTour.html#//apple_ref/doc/uid/TP40014097-CH2-ID1

https://github.com/alexcomu/swift3-tutorial

https://www.youtube.com/watch?v=AzesJrOcFDU

https://www.hackingwithswift.com/read/0/1/how-to-install-xcode-and-create-a-playground


https://www.ralfebert.de/tutorials/ios-swift-uitableviewcontroller/custom-cells/

share social media
https://stackoverflow.com/questions/31792506/how-to-exclude-notes-and-reminders-apps-from-the-uiactivityviewcontroller

http://stefansdevplayground.blogspot.co.nz/2015/03/how-to-add-social-media-integration-to.html

https://www.appcoda.com/social-framework-introduction/
https://developers.facebook.com/docs/swift/sharing/content-types
https://dev.twitter.com/twitterkit/ios/installation


https://developer.apple.com/library/content/referencelibrary/GettingStarted/DevelopiOSAppsSwift/index.html#//apple_ref/doc/uid/TP40015214

Delta

This is the meta data part of the work that will replace the Oracle delta DB https://github.com/GeoNet/delta

It's CSV files of where things like seismic stations are https://github.com/GeoNet/delta/blob/master/network/stations.csv

The idea is that this repo will be updated as the network changes

So could you take a look at this and think about what we should do to be able to make web services for GeoJSON, KML, and maybe protobuf?

Service for searching, listing, and Editing (Put query)?

I think as should end up serving this info from somewhere below api.geonet.org.nz eventually but maybe just work in devx for now?

I'm not sure if we need to get the csv into a DB or if we should just sync it to s3 and then parse and reformat in code.

  • S3 is a good choice, as this is not frequently updated, but have to download and edit the whole file, and is error prone
  • Database is good for data integrity and allows editing per record,
  • github repo is easy to edit, but the update is not sync immediately.

it's useful to notice that the networks is an "internal code" and there is an "external" code so most of the seismic stations end up in the "NZ" network.

this has an example of reading CSV in Go https://github.com/GeoNet/fits-loader/blob/master/observation.go using encoding/csv

protobuf

Overview

Protocol Buffers (a.k.a., protobuf) are Google's language-neutral,
platform-neutral, extensible mechanism for serializing structured data. You
can find protobuf's documentation on the Google Developers site.

This README file contains protobuf installation instructions. To install
protobuf, you need to install the protocol compiler (used to compile .proto
files) and the protobuf runtime for your chosen programming language.

Protocol Compiler Installation

The protocol compiler is written in C++. If you are using C++, please follow
the C++ Installation Instructions to install protoc along
with the C++ runtime.

For non-C++ users, the simplest way to install the protocol compiler is to
download a pre-built binary from our release page:

https://github.com/google/protobuf/releases

In the downloads section of each release, you can find pre-built binaries in
zip packages: protoc-$VERSION-$PLATFORM.zip. It contains the protoc binary
as well as a set of standard .proto files distributed along with protobuf.

If you are looking for an old version that is not available in the release
page, check out the maven repo here:

http://repo1.maven.org/maven2/com/google/protobuf/protoc/

These pre-built binaries are only provided for released versions. If you want
to use the github master version at HEAD, or you need to modify protobuf code,
or you are using C++, it's recommended to build your own protoc binary from
source.

If you would like to build protoc binary from source, see the C++ Installation
Instructions
.

Protobuf Runtime Installation

Protobuf supports several different programming languages. For each programming
language, you can find instructions in the corresponding source directory about
how to install protobuf runtime for that specific language:

Language Source
C++ (include C++ runtime and protoc) src
Java java
Python python
Objective-C objectivec
C# csharp
JavaNano javanano
JavaScript js
Ruby ruby
Go golang/protobuf
PHP TBD

Usage

The complete documentation for Protocol Buffers is available via the
web at:

https://developers.google.com/protocol-buffers/

MAP

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.