Project

General

Profile

Wiki » History » Version 27

Philippe May, 09/08/2018 12:33

1 3 Philippe May
h1. Software
2 1 Philippe May
3 15 Philippe May
Gisaf (for, eg, GIS Auroville Front-end) is a web application that is under development.
4 1 Philippe May
5 27 Philippe May
[[User manual]]
6 2 Philippe May
[[Server]]
7 2 Philippe May
[[Client]]
8 1 Philippe May
[[Stack]]
9 15 Philippe May
[[Mapbox]]
10 3 Philippe May
11 7 Philippe May
h2. Database
12 7 Philippe May
13 7 Philippe May
Gisaf uses a Postgis database.
14 1 Philippe May
15 9 Philippe May
h3. Creation
16 9 Philippe May
17 9 Philippe May
To create an appropriate database, run these commands:
18 9 Philippe May
<pre>
19 9 Philippe May
createuser avgis -P
20 9 Philippe May
createdb avgis -O avgis
21 9 Philippe May
psql avgis -c "CREATE EXTENSION postgis;"
22 9 Philippe May
</pre>
23 9 Philippe May
24 9 Philippe May
h3. Notes
25 9 Philippe May
26 7 Philippe May
The geometry features' metadata MUST be set with the proper SRID, which can be tricky. See below.
27 7 Philippe May
28 3 Philippe May
h3. Import files
29 5 Philippe May
30 8 Philippe May
[[Shapefiles]]
31 21 Pavneet Kaur
[[Rules of Map making - What all Maps should have!]]
32 19 Pavneet Kaur
[[Survey Database]]
33 18 Pavneet Kaur
[[Field to finish]]
34 11 Pavneet Kaur
[[Survey Data Post-Processing]]
35 10 Philippe May
[[Data (measurements, auxiliary tables)]]
36 12 Pavneet Kaur
[[Wells Documentation]]
37 13 Pavneet Kaur
[[Civil 3D useful commands]]
38 17 Pavneet Kaur
[[Online references for Civil 3D]]
39 14 Pavneet Kaur
[[connections in QGIS- using browser panel and Add postGIS]]
40 16 Philippe May
41 8 Philippe May
h2. Development
42 8 Philippe May
43 8 Philippe May
See the README file
44 22 Philippe May
45 22 Philippe May
h2. Configuration
46 22 Philippe May
47 22 Philippe May
TODO: more about parameters of the conf file
48 22 Philippe May
49 22 Philippe May
h3. Map
50 22 Philippe May
51 22 Philippe May
The default view of the map can be configured in the gisaf yaml config, eg:
52 22 Philippe May
53 22 Philippe May
<pre>
54 22 Philippe May
map:
55 22 Philippe May
  openMapTilesKey: cS3lrAfYXoM4MDooT6aS
56 22 Philippe May
  zoom: 14
57 22 Philippe May
  pitch: 45
58 22 Philippe May
  lat: 12.0000
59 22 Philippe May
  lng: 79.8106
60 22 Philippe May
  bearing: 0
61 22 Philippe May
  style: OSM (vector)
62 22 Philippe May
  opacity: 0.3
63 22 Philippe May
  tilesUrl: /tiles/data/india-vector.json
64 22 Philippe May
</pre>
65 22 Philippe May
66 22 Philippe May
h3. Production
67 22 Philippe May
68 22 Philippe May
Gisaf reads the file @/etc/gisaf/prod.yml@ at boot.
69 22 Philippe May
70 22 Philippe May
71 22 Philippe May
h3. Development
72 22 Philippe May
73 22 Philippe May
Gisaf reads the @~/.gisaf/prod.yml@ file at boot.
74 22 Philippe May
75 22 Philippe May
76 22 Philippe May
h2. Third party
77 22 Philippe May
78 22 Philippe May
h3. TileServer
79 22 Philippe May
80 22 Philippe May
"TileServer-gl":https://github.com/klokantech/tileserver-gl is a small node application that can serve vector tiles (mbtiles) for mapbox without the need for an external provider.
81 22 Philippe May
82 22 Philippe May
The maps Gisaf base layers (the definition file being located in @gisaf-app/src/app/map/base_styles.ts@) in can be parametered such that a base layer is hosted locally (see the gisaf config file).
83 22 Philippe May
84 23 Philippe May
h4. Download the mbtiles
85 23 Philippe May
86 25 Philippe May
From: https://openmaptiles.com/downloads/planet/ , and store the relevant one on the server's filesystem (eg. @/usr/local/2017-07-03_asia_india.mbtiles@)
87 22 Philippe May
88 22 Philippe May
h4. Service
89 22 Philippe May
90 22 Philippe May
A systemd service configuration file, in @/etc/systemd/system/tileserver-gl-light.service@:
91 22 Philippe May
92 22 Philippe May
<pre>
93 22 Philippe May
[Service]
94 25 Philippe May
ExecStart=/usr/bin/node /usr/lib/node_modules/tileserver-gl-light/src/main.js --cors true -c /etc/tileserver/conf.json
95 22 Philippe May
Restart=always
96 22 Philippe May
User=www-data
97 22 Philippe May
Group=www-data
98 22 Philippe May
Environment=NODE_ENV=production
99 22 Philippe May
100 22 Philippe May
[Install]
101 22 Philippe May
WantedBy=multi-user.target
102 22 Philippe May
</pre>
103 22 Philippe May
104 22 Philippe May
h4. Configuration
105 22 Philippe May
106 22 Philippe May
Eg, in @/etc/tileserver/conf.json@:
107 22 Philippe May
108 22 Philippe May
<pre>
109 22 Philippe May
{
110 22 Philippe May
  "options": {
111 22 Philippe May
    "paths": {
112 22 Philippe May
      "root": "",
113 26 Philippe May
      "sprites": "/usr/lib/node_modules/tileserver-gl-light/node_modules/tileserver-gl-styles/styles/osm-bright"
114 22 Philippe May
    },
115 22 Philippe May
    "domains": [
116 22 Philippe May
      "gis.auroville.org.in"
117 22 Philippe May
    ],
118 22 Philippe May
    "styles": {}
119 22 Philippe May
  },
120 22 Philippe May
  "data": {
121 22 Philippe May
    "india-vector": {
122 22 Philippe May
      "mbtiles": "/usr/local/2017-07-03_asia_india.mbtiles"
123 22 Philippe May
    }
124 22 Philippe May
  }
125 1 Philippe May
}
126 24 Philippe May
</pre>
127 24 Philippe May
128 24 Philippe May
h4. Run the service
129 24 Philippe May
130 24 Philippe May
<pre>
131 24 Philippe May
systemctl enable --now tileserver-gl-light.service
132 22 Philippe May
</pre>
133 22 Philippe May
134 22 Philippe May
h4. nginx proxy
135 22 Philippe May
136 22 Philippe May
In order the mbtiles to be served by tileserver, add in the nginx conf (adjust eventually):
137 22 Philippe May
138 22 Philippe May
<pre>
139 22 Philippe May
    location /tiles/ {
140 22 Philippe May
        proxy_pass http://127.0.0.1:8080/;
141 22 Philippe May
    }
142 22 Philippe May
</pre>