urbica是莫斯科一家做可视化的公司。
github 地址:https://github.com/urbica/martin
tips: postgis 安装的时候,需要有protobuf支持。参考:https://blog.csdn.net/aganliang/article/details/103171744
下载
martin-Linux-x86_64.tar.gz
解压,只有一个martin文件
建立软连接
ln -s /root/martin /usr/local/bin/martin
启动
martin postgres://username:pwd@ip:port/db
防火墙开通3000端口
firewall-cmd --zone=public --add-port=3000/tcp --permanent
firewall-cmd --reload
endpoint:
http://localhost:3000/index.json
http://localhst:3000/topology.xzqh_wg.json
config.yaml样例
---
# Database connection string
connection_string: ""
# Connection keep alive timeout [default: 75]
keep_alive: 75
# The socket address to bind [default: 0.0.0.0:3000]
listen_addresses: "ip:port"
# Maximum connections pool size [default: 20]
pool_size: 60 # 设置太大的话,启动不了
# Enable watch mode
watch: false
# Trust invalid certificates. This introduces significant vulnerabilities, and should only be used as a last resort.
danger_accept_invalid_certs: false
# Number of web server workers
worker_processes: 8
# associative arrays of table sources
table_sources:
topology.mlp:
# table source id
id: topology.mlp
# table schema
schema: topology
# table name
table: d_mlp_2020
# geometry column name
geometry_column: geom
# geometry srid
srid: 4326
# tile extent in tile coordinate space
extent: 4096
# buffer distance in tile coordinate space to optionally clip geometries
buffer: 64
# boolean to control if geometries should be clipped or encoded as is
clip_geom: true
# geometry type
geometry_type: POINT
# list of columns, that should be encoded as tile properties
properties:
mpwzhm: varchar
mpdzmc: varchar
dzdm: varchar
dzqc: varchar
topology.yw_cameras:
# table source id
id: topology.yw_cameras
# table schema
schema: topology
# table name
table: yw_cameras
# geometry column name
geometry_column: geom
# geometry srid
srid: 4326
# tile extent in tile coordinate space
extent: 4096
# buffer distance in tile coordinate space to optionally clip geometries
buffer: 64
# boolean to control if geometries should be clipped or encoded as is
clip_geom: true
# geometry type
geometry_type: POINT
# list of columns, that should be encoded as tile properties
properties:
sbbm: varchar
sbmc: varchar
sxjlx: varchar
topology.yw_spjks:
# table source id
id: topology.yw_spjks
# table schema
schema: topology
# table name
table: yw_spjks
# geometry column name
geometry_column: geom
# geometry srid
srid: 4326
# tile extent in tile coordinate space
extent: 4096
# buffer distance in tile coordinate space to optionally clip geometries
buffer: 64
# boolean to control if geometries should be clipped or encoded as is
clip_geom: true
# geometry type
geometry_type: POINT
# list of columns, that should be encoded as tile properties
properties:
name: varchar