Skip to content

Instantly share code, notes, and snippets.

View dezhin's full-sized avatar

Aleksandr Dezhin dezhin

View GitHub Profile
@dezhin
dezhin / gist:2dc74274a068e2fe3f46282c30b21a8d
Created July 20, 2020 22:20
PostgeSQL + PostGIS installation for NextGIS Web
# apt install postgresql postgresql-contrib postgis
# su postgres
$ cd
$ createuser --pwprompt nextgisweb
Enter password for new role: [type database password here]
Enter it again: [type database password here again]
$ createdb --owner=nextgisweb nextgisweb
$ psql nextgisweb -c "CREATE EXTENSION postgis"
$ psql nextgisweb -c "ALTER TABLE spatial_ref_sys OWNER TO nextgisweb"
$ psql nextgisweb -c "ALTER TABLE geography_columns OWNER TO nextgisweb"
<?php
$rq_bbox = $_REQUEST['bbox'] or $rq_bbox = $_REQUEST['BBOX'];
$bbox = split(',', $rq_bbox);
$rq_w = $_REQUEST['width'] or $rq_w = $_REQUEST['WIDTH'];
$rq_h = $_REQUEST['height'] or $rq_h = $_REQUEST['HEIGHT'];
$url = "http://maps.rosreestr.ru/ArcGIS/rest/services/Cadastre/Cadastre/MapServer/export?dpi=100&transparent=true&format=png8&bbox={xmin:$bbox[0],ymin:$bbox[1],xmax:$bbox[2],ymax:$bbox[3],spatialReference:{wkid:4326}}&bboxSR=4326&imageSR=102113&size=$rq_w,$rq_h&f=image";
header('Location: ' . $url);