Archive for the 'SL In General' Category

Jul 07 2017

Unity 3D – Camera Build

One of the beauties, and for some of us the terror, of Unity is its nature as a gaming engine.  Basically it is a sort of 4D Integrated Development Environment (IDE) that makes it relatively efficient to design and build prototype or production game applications—including serious games.

The terror is that Unity is basically an extraordinary IDE for what is most likely C#, and the built-in components are very versatile yet very primitive, which can mean starting from very little.  The beauty includes experiences learning how to create just about anything from those primitives and realizing with some wonder that it’s possible not only to develop, but to actually become productive inside of a week of evenings.  Once I attained my basic understanding of the various (sometimes virtual-literally) moving parts, it was not difficult to identify a feature to add and get that added in one evening, over and over again to where things really accumulate.

Along with the beauty was an occasional burst of joy, as certain coding errors produce psychedelic visual experiences.  It has been very satisfying to reconnect with some old friends, the Quaternions.

No responses yet

Apr 25 2017

Terrain: solved; Platform: Unity;

Published by under SL In General

Following a catch-up read last night of Metaverse Ink from 2011 with many thanks to Prof. Crista Lopes of UCI Informatics for writing it.

Why not?  Unity appears to have a San Francisco SOMA presence, FWIW.  A few hours later, a “Duh” moment.  Why wait so long to go this way?  Why be so intent on synchronous state sharing among distributed clients?  No more questions, just an image to show Unity 5.6.0f3 in action.

Terrain is full-res 1-meter digital surface model, although it has been compressed to unsigned short (u16) integer decimeters with a 10-meter bias to cover creek bathymetry.  Believe me, the effect of negative signed integers on an unsigned int terrain is not pleasant, and the creeks looked like they’d been turned into vertical columns of stratospheric steam.  The swath shown below is 1024 m X 6144 m, has terrain values every square meter, and spans terrain elevations from about 1 m up close to 784 m up high.  At first glance this might look like a green cousin of the obelisk from the movie 2001: A Space Odyssey but in fact it is the fully detailed oblique view of a strip of rendered terrain shown without any atmospheric effects, which makes for some disorienting foreshortening.

I’m still patching terrain 1K-meter squares together manually for a demo.  But this is really looking professional-grade!  Strategically, although this slice of terrain is in Marin county, California, the terrain blocks have been positioned at San Francisco coordinate system of 2013 (WKID/EPSG 7131) so I’m actually using Unity 3D to edit in a GIS grid system.  That opens up the possibility of pouring Vast Tracts of Data into the model from sources like MarinMap.

Unity terrain

Unity 5.6.0f3 Marin dsm1m and MarinMap rgb20cm of 2014

No responses yet

Apr 21 2017

Terrain, yes, and flat orthos

Published by under SL In General

Next reach goal: draping the orthos as terrain textures.

To run better on a 1 vCPU, 1 GB machine with 3GB swap on an EBS SSD drive, the extent was pared back from 8K square to 6K square.  Orthophotos were resampled at 20cm and placed on flat 1km square prims.  Everything aligns with San Francisco county grid (EPSG/WKID 7131.)  This shot is Twin Peaks, view easterly, at sunset.  Look close in the pass and you can see Test User Ruth to verify the scale.  The orthophotos have been placed on both top and bottom of the image prim.

OpenSim 6K model of San Francisco with 20cm orthophotos

Open Simulator 0.9.0-rc2, running on CentOS 7, Amazon t2.micro

No responses yet

Apr 16 2017

Darb Returns to OpenSim at 0.9

Published by under SL In General

The reasons for a return are several, but not that important. The thread that led to this started with a frustration over certain household members’ copious use of the Roblox environment—from a consumer side. The next step was to think “My, but Roblox is little more than a hybrid of Lego/Minecraft figures with a bit more of a Second Life creative side.” After that it was a reactivation of the dormant Darb Dabney account on Second Life itself. Spending some accumulated Linden$ led to a parcel on Jessie, and some of the old muscle memory for builds was reconnected.


Next, now that the site can be found again, I realized that there was some new content, a few new faces among the product developers, and a willingness to trade off compatibility with the Linden viewer for an incorporation of larger areas and other useful features—a conscious fork from the Linden path.

So when I finished a load testing project and found myself with 48 more weeks of free-tier Amazon EC2 server, I took a pure CentOS 7 image and went after OpenSim once again. This Easter weekend offered a bit of time to figure out how the tools have all changed, for the better!

I stood back from ArcGIS Pro to avoid distractions and used ArcGIS 10.5 for Desktop to simply design an edit and perform a clip on the stock San Francisco Enterprise GIS Program’s (SFGIS) 50 cm terrain grid, then resampled it to 1 m gridding. The City and County of San Francisco’s new grid system (WKID or EPSG 7131) is ideal as a foundation for OpenSim grids: it’s metric, astronomically aligned,and reasonably small numbers for X and Y coordinates.

I started out getting a 2 km square region going, which was enough to learn what OpenSim needs for local IP ( and Public IP, where I assigned an Amazon Elastic IP address, then set up DNS to give the server its subdomain here on ``. I found that the Linden Second Life Viewer 5.0.3 appears incompatible, but I was able to connect with Singularity Viewer 1.8.7 and see what I needed regarding terrain loads.

Although there are plenty of formats now accepted for terrain maps, many of them are integer-valued and the SFGIS grid is all single precision floating-point so there seems little reason to clobber that precision just to load a grid. Through a variety of tests, I settled on using ArcMap to clip the raster to a square 8192×8192 meter or 6144×6144 meter sample, and saved that in ERDAS .img format. That clip was exported to a GeoTIFF that Adobe Photoshop CC 2017 can read. Mercifully, HDR photography and video has now brought floating-point grayscale into the realm of photographers so I didn’t need to use ERDAS Imagine application. Photoshop made the necessary vertical flip so that OpenSim can read the raster from bottom to top (how backwards!) Then, I opened the flipped no-longer-a-GeoTIFF in a fresh ArcMap document, ignored its lack of georeference, and applied ArcTools > Conversion Tools > From Raster > Raster to Float to produce what Esri calls an .flt file, which is effectively a raw IEEE floating-point array—no header or other information. It is exactly 4xGrid Cells in size. This was renamed to a .r32 for use by OpenSim, and uploaded to the EC2 server using WinSCP.

On the server, I used a binary distribution of opensim- and dropped the .r32 in its ./bin directory. The CentOS 7 server was configured to have MySQL (14.14 Distrib 5.7.18 x86_64) and Mono (4.8.0) in order to run the dot net CIL OpenSim.exe and make the server fly.

It was necessary to configure OpenSim to use MySQL rather than the default SQLite, because the extended regions create huge increases in detail and thoroughly exceed limits of SQLite. The 6144×6144 produces an array of 24×24 or 576 Linden regions’ extent. The 8192×8192 upper limit to OpenSim 0.9 forms an array of 32×32 or 1024 Linden regions’ extent.

MySQL defaults had to be expanded at `/etc/my.cnf` and allow big globs of BLOB data, so I added this line to that file, and ran `systemctl stop mysqld; systemctl start mysqld`

To survive the really large regions, the EC2 server needed to be configured for swap, and to make that a bit safer, I added a 2 GB EBS volume housed on SSD, which is the fastest arrangement allowed on this size server.

Notable for this weekend’s efforts was that real San Francisco terrain, with no vertical exaggeration, and 1:1 real-world scale were all used—a first for me, at least with > 500 regions. Here’s a reflection from Twin Peaks, at 1:1 scale, in OpenSim 0.9 running on an Amazon EC2 server at t2.micro (free-tier elegible, 1 vCPU, 1 GB memory, 8 GB disk, 2 GB swap.)


No responses yet

Mar 27 2015

TileStream behind Apache reverse proxy

Published by under SL In General

If you’ve got the issue, then you know why this could matter. If not, then just enjoy consuming Mapbox tiles from somewhere in the world.

Craft a subdomain-accessed reverse proxy with this sort of phrase in Apache httpd.conf on a web server otherwise known as

   ProxyPass / http://localhost:1111/
   ProxyPassReverse / http://localhost:1111/

Of course, you’ll need to tidy up name resolution for the newly created subnet alias for your server. Once that name resolves, then launch TileStream in some manner like

$ ./index.js --config config.json

With reference to something like this TileStream config.json

   "host":  "",
   "tileHost":  "",
   "tilePort":  11111,
   "uiPort":  11111,
   "tiles":  "/your/local/path"

For an organization that wishes to share good imagery via TileStream without allowing trivial access to bulk downloads, this can present an issue. TileStream appears rather promiscuous with its download button.

No responses yet

Mar 13 2015

FOSS4G North America 2015 – recovery time

Published by under SL In General

I’m filled to the brim with fresh map ideas from the most amazing crowd that I’ve ever conferenced with. So many ideas were shared with me, many of which change how I view the future of mapping. While there’s still plenty of utility and respect, I sincerely believe that the mapping world has already reached, or is months away from Peak Esri use.

That creates a space for FOSS, and an urgent need to update curricula in the US to keep up. The skills needed are not monolithic desktop apps, but rather freely extensible desktop frameworks—not proprietary servers but those without licensing costs that can be scaled out to cover the world with maps.

No responses yet

Jun 30 2014

SGeoS Esri ArcGIS 10.2.2 for Server Standard Java – Module 1 of 9

Published by under SL In General

Esri ArcGIS 10.2.2 for Server Standard – Java

Build steps for configuration Module-stage-1

  1. Start from completed system Module-stage-0
  2. Create an installation directory for ArcGIS Server
    Name the installation directory with only lowercase letters per the Esri instructions.  Let the installation user own the new directory so that they can perform all necessary actions within.  The example here was chosen to convey version ArcGis Server 10.2.2

    mkdir /ags1022
    chown ags_install /ags1022
    chgrp ags_install /ags1022
  3. Enable NFS Export for ArcGIS Server Directory
    Make the installation directory for ArcGIS Server available via NFS.  This will permit Windows 7 Enterprise users (or more likely other ArcGIS Server machines) to connect to it .  Append a line to /etc/exports

    /ags1022  workstationIP(rw,sync,no_root_squash,no_all_squash)

    If you find that the check boxes during install seem not to have included NFS as they should: no worries.  It’s like this:

    sudo yum install nfs* -y

    Then fire up the share:

    service rpcbind start
    chkconfig rpcbind on
    service nfs start
    chkconfig nfs on
  4. Enable SMB for Windows 7 Pro users
    The NFS share is going to be useful among Linux servers, but to develop our services from a Windows desktop, only Windows 7 Enterprise systems have an NFS client built in.  There are open-source NFS clients for Windows, but they are not version-matched with NFS versions most commonly installed on CentOS 6.5.  The main use of NFS is for storage mapping among SGeoS modules on different tiers within a single site, or exchange across SGeoS modules in collaborating environments, such as Dev?Test/QA?Production server transfers.For the Dev machine, we’ll want to enable SMB connections so that any necessary Windows 7 workstation can be configured to connect, particularly Windows 7 Professional machines commonly found deployed through City and County of San Francisco and also at home.SMB can be a less secure means of sharing storage, because it is designed to be compatible with systems that used old and insecure approaches to publishing storage space.  To make this  a clean connection, we’ll configure both iptables as well as mark SELinux to open only the minimum required connection types—but run SELinux in permissive mode to allow SELinux to log but not block actions.Because it is more secure than Workgroup shares, SGeoS modules configure SMB to only work with Active Directory.  Samba Workgroup sharing takes place on other ports that can be left closed.

    It’s easy enough to install the system standard SMB server, but important to configure firewall, give some respect for proper SELinux configuration, and configure the actual SMB shares.
    For Active Directory only we can add these to /etc/sysconfig/iptables

    Then install

    yum install samba samba-client samba-common ntpd

    Verify the installed version; at CentOS 6.5 we get 3.6.9

    smbd --version

    Label the served directory to let SELinux know it’s OK to share

    semanage fcontext -a -t public_content_rw_t ‘/ags1022(/.*)?’

    Set the Samba services to start at boot time.

    chkconfig smb on
    chkconfig nmb on

    With an enterprise install, the standard configuration is found at /etc/samba/smb.conf and should have a section like this to enable a share around ArcGIS Server.  In general, deeper shares with restricted users and allowed client IP are strongly preferred for better server security.

       comment = ArcGIS Server 10.2.2 Java
       path = /ags1022
       browseable = yes
       public = no
       writable = yes
       printable = no

    It might be desirable to configure Samba to use Active Directory, and according to documentation at it is necessary to have precise time within an AD network, including both a running ntpd and ntp-signd daemons.

    service ntpd stop
    service ntpd start
    chkconfig ntpdate on
  5. Create Esri install and user Linux system accounts
    To create a user account, make it and set its password.
    We need to have a normal user for the ArcGIS Server install, and not install it as root.
    So create a new user and set their password.

    useradd ags_install
    passwd ags_install
    useradd ags_user
    passwd ags_user
  6. Fulfill Esri-specified system configuration Dependencies
    Work through the Esri-specified dependencies listed
    yum install Xvfb freetype fontconfig mesa-libGL mesa-libGLUIdentify the hard and soft limits set in the system for file handles and processes

    ulimit -Hn -Hu
    ulimit -Sn -Su

    It’s likely default limits are too small to run ArcGIS Server properly, so sudo to edit the file /etc/security/limits.conf  adding these four lines to change settings for
    the ags_intall user

  7. Enable default httpd
    While it’s possible to install a pre-release Apache 2.4 from RedHat, the default CentOS 6.5 version is 2.2.13—installing more updated versions of web server and OpenSSL are described a couple of sections below.The classic Enterprise approach uses the stock install of httpd 2.2.15 on CentOS 6.5

    yum install httpd

    If there’s reason to attach to network (like always), SELinux can be set to allow this

    setsebool -P httpd_can_network_connect on

    Poise for open server, but enable only secure browsing with these lines in
    file /etc/sysconfig/iptables for workstations at 10.1.15.x to access via https://

    service httpd restart

    If it is desired to have the server always start up the web server, set that to happen

    chkconfig httpd on
  8. Install updated httpdOption A:If there’s a desire for an Apache 2.4 httpd on the server, but not the stomach to build one from source, then make the install this way using a software collection  scl  that can install pre-release postings by Red Hat people.  While not a pure enterprise approach, this technique does offer a minimal-risk method to update important framework elements like httpd.
    curl -s\
       /jkaluza/httpd24/epel-httpd24.repo > /etc/yum.repos.d/epel-httpd24.repo
    yum install httpd24-httpd

    Then to test it:

    service httpd24-httpd start
       Starting httpd:                                            [  OK  ]
    curl -s http://localhost/ | grep 'Test Page for'
        <title>Test Page for the Apache HTTP Server on Red Hat Enterprise Linux</title>

    Option B:
    For security enthusiasts, configure and build from the latest stable Apache source.
    This makes most sense if one also chose to build the very latest OpenSSL from source, in Module-stage0 > Step 7 > Option B. This approach is normal for banking and payment card industries.

    cd /opt/installs
    wget wget http://<some apache mirror site>\
    tar xvf apr-1.5.1.tar.gz
    cd apr-1.5.1
    sudo make install

    This should place the APR configuration file at /usr/local/apr/bin/apr-1-config

    cd /opt/installs
    wget wget http://<some apache mirror site>\
    tar xvf apr-util-1.5.3.tar.gz
    cd apr-util-1.5.3
    ./configure --with-apr=/usr/local/apr/bin/apr-1-config
    sudo make install

    This should place the APR-util library at /usr/local/apr/lib

    And one more dependency was observed for building httpd:

    yum install  pcre  pcre-devel

    Prepare for SSL connections with a self-signed web server certificate

    cd /usr/local
    mkdir pki
    cd pki

    Once there, generate a private key for postgresql

    openssl genrsa -out htca.key 8192

    Generate a Certificate Signing Request

    openssl req -new -key htca.key -text -out htca.csr

    Generate a Self-Signed Key

    openssl x509 -req -days 365 -in htca.csr -signkey htca.key -out htca.crt

    Copy these  files to the following locations (DO NOT move them; copy them–then delete)

    cp htca.crt /etc/pki/tls/certs
    cp htca.key /etc/pki/tls/private
    cp htca.csr /etc/pki/tls/private
    chmod 600 /etc/pki/certs/htca.crt /etc/pki/tls/private/htca.*
    rm htca.*

    Then we should be ready to actually build an optimized httpd; the  ./configure  is long on options and requires a patch listed here to work with ssl, which it must do.

    cd /opt/installs
    wget http://<some apache mirror>\
    tar xvf httpd-2.4.9.tar.bz2
    cd httpd-2.4.9
    export LDFLAGS=”-L/usr/local/lib64”
    ./configure  --prefix=/usr/local/httpd \
      --enable-so \
      --enable-pie \
      --with-apr=/usr/local/apr/bin/apr-1-config \
      --enable-ssl \
      --with-ssl=/usr/local/openssl \
      --enable-allowmethods \
      --enable-info \
      --enable-speling \
      --with-mpm=event \
      LDFLAGS=-L/usr/local/lib64 \
    sudo make install

    Duplicate some of the enterprise httpd service configuration to make it easier to run the new web server

    cp  /etc/sysconfig/httpd  /etc/sysconfig/httpd2
    cp  /etc/init.d/httpd  /etc/init.d/httpd2
    ln -s  /usr/local/httpd/bin/httpd  /usr/sbin/httpd2
    ln -s  /usr/local/httpd/bin/apachectl  /usr/sbin/apachectl2
    mkdir  /usr/lib64/httpd2
    cp -r /usr/local/httpd/modules /usr/lib64/httpd2

    Edit /etc/init.d/httpd2   so that it contains these sort of changes


    Edit /usr/local/httpd/conf/httpd.conf  to redirect all traffic to SSL connections.

    Include conf/extra/httpd-ssl.conf
    Include conf/extra/httpd-mpm.conf
    <IfModule unixd_module>
    User apache
    Group apache
    LoadModule ssl_module modules/
    LoadModule socache_shmcb_module modules/
    Include conf/extra/httpd-ssl.conf
    # Redirect everything to an ssl connection
    # functional Directory is then specified in extra/httpd-ssl.conf
    <VirtualHost *:80>
    ServerName sg11
    Redirect permanent / https://sg11/
    <IfModule dir_module>
    DirectoryIndex  index.html
    <Files “.ht*”>
    Require all denied

    Edit /usr/local/httpd/conf/extra/httpd-ssl.conf  for system content locations and so editors can update content through the SMB share configured at the ArcGIS for Server directory.

    Listen 443
    SSLCipherSuite HIGH:MEDIUM:!aNULL:!MD5
    SSLSessionCache        "shmcb:/usr/local/httpd/logs/ssl_scache(512000)"
    <VirtualHost _default_:443>
    ServerName sg11:443
    DocumentRoot "/ags1022/html"
    ErrorLog "/usr/local/httpd/logs/error_log"
    TransferLog "/usr/local/httpd/logs/access_log"
    <Location />
    SSLRequire %{SSL_CIPHER_USEKEYSIZE} >= 128
    SSLEngine on
    SSLCertificateFile "/etc/your_path_to.crt"
    SSLCertificateKeyFile "/etc/your_path_to_server_private.key"
    <FilesMatch "\.(cgi|shtml|phtml|php)$">
    SSLOptions +StdEnvVars
    <Directory "/usr/local/httpd/cgi-bin">
    SSLOptions +StdEnvVars
    BrowserMatch "MSIE [2-5]" \
    nokeepalive ssl-unclean-shutdown \
    downgrade-1.0 force-response-1.0

    Back up the site configuration  by making a copy of the modified site configuration files in another location.

    cd /usr/local/httpd
    mkdir /root/httpd_local_conf
    cp -r conf /root/httpd_local_conf
  9. Build latest stable Python from source; development server config
    If there’s reason to build PostGIS support framework components with Python support later, it might help to have built the Python locally, so as to appease the linker later.  Reference Python source is from the site. They’ve chosen to compress their archives with a scheme that requires the XZ compression library.  Since Python appears to have a lot of ties to development libraries, it’s been suggested in more than one place to bulk up on some of these tools for smoother builds.
    These may be removed on a production server; they are needed for development.

    yum groupinstall development
    yum install -y zlib-dev openssl-dev sqlite-devel bzip2-devel \
    ncurses-devel readline-devel tk-devel gdbm-devel db4-devel \
    libpcap-devel xz-libs xz-devel

    One possible build location is /opt/installs, where a TARFILES directory could be made.
    Create the directory if it doesn’t already exist

    mkdir /opt/installs
    cd !$

    Once there, get the compressed source similar to below and decode it

    cd /opt/installs
    xz -d Python-2.7.6.tar.xz
    cd ..
    tar xvf TARFILES/Python-2.7.6.tar
    cd Python-2.7.6

    Prepare to create a shared library by appending the path /usr/local/lib to /etc/
    so that it at least looks like:


    Then have the linker read the new configuration with


    Configure the Python build for alternate location, unicode-32, and shared library. Make it

    ./configure --prefix=/usr/local --enable-shared --with-threads

    Let’s not clobber the system’s Python install, and make this the alternate Python install
    This should leave only four minor and/or deprecated bits not found.  Good riddance to them.

    FInally install as an alternate Python so as not to impact any ArcGIS for Server defaults.  Be doubly certain to include the “altinstall” if you’re root.

    make altinstall

    Should the make have problems finding,  it could be necessary to create a file /etc/   hat lists path /usr/local/python27/lib  if that was chosen as the prefix during config.  After changes there, run this to reload the loader’s configurations


    Set up Python build capability by adding Setuptools, then leverage that to install pip and since we’re building the system with Python 2 (and not yet 3), add virtualenv

    mkdir /usr/local/src/Setuptools_py
    cd !$
    easy_install-2.7 pip
    pip2.7 install virtualenv
  10. Mount the Esri ISO and Prepare for Installing AGS
    When attaching an ISO image such as Esri installation DVD in the VMware vSphere Client, verify that the ISO has not been mounted in Windows (like to poke around the download) and thus used and locked by Virtual Clone Drive.  If the ISO has been mounted, and one has already tried attaching ISO in vSphere, consider restarting the Windows machine!Oddly, when mounting the ESRI Install DVD ISO,  it appears necessary to launch (or re-launch) the vSphere Client by right-clicking and explicitly using “Run as Administrator”
    With a fresh Windows boot (if needed), and vSphere launched as Administrator, it appears necessary to mount the ESRI ISO with explicit file system type into an existing empty directory such as /cdromThe finesse here seems to be that the login as root and mounting of device can take place in the vSphere console window, then launch a nice large PuTTY ssh window,  log in as ags_install, with home directory in /ags1022, to complete the installationAs root in the console window, after attaching the local ISO, mount the image

    mount -t iso9660 /dev/cdrom /cdrom

    Then in the PuTTY window have ags_install verify the mount by looking at all mounted devices; noting the presence of read-only storage at /cdrom



    In the PuTTY window, cd into the mounted ISO to see the Setup script.

  11. Install ArcGIS for Server
    Why bother installing a GUI just to run the ArcGIS Server install scripts?  Following the instructions at Esri Resources  the command line interface (CLI) install procedure is most readily described as “Installing ArcGIS for Server silently”  Then, in the cdrom install directory, this wickedly terse statement completely installs all of ArcGIS for Server 10.2.2 into  /ags1022

    su - ags_install
    cd /cdrom/ArcGISServer
    ./Setup -m silent -l Yes /a <path-to-.prvc> /d /ags1022

    Fire off the script in silent mode. That’s it. Really.
    If need be, it may be necessary to use the SMB share to copy over the Esri provisioning file to /ags1022, then run the authorizeSoftware script against the .prvc

    /ags1022/arcgis/server/tools/authorizeSoftware -f \

    Then start the post-installation configuration process.
    If server name resolves and ports are open, it’s time to point a browser  at a destination like this and Create New Site


  12. Complete ArcGIS for Server Post-Installation Steps
    This begins with defining an ArcGIS for Server site administrator (not an OS account).
    It’s wise to consider saving this password now in a runbook for the server.
    ags_07Consider keeping the working directories up a bit higher than default location
    ags_08Click Finish, and that’s all that it took.  Seriously easier than it was, once upon a time.
  13. Go Forth and Create Map Services
    Log in, go forth and make many Map and Image services!
    ags_10The new AGS Server Manager console looks more like ArcGIS Online these days:
  14. Secure AGS Manger connections for https-only access
    This will either generate a new cert or provide an opportunity to install an established one.
    Visit not the Manager site, but the Admin one.At first, ArcGIS for Server will be reached by



    Go to machines

    In the named machine, Resources: click sslcertificates near the bottom

    To create a new self-signed cert, click generate

    Consider using an Alternative name that is the server’s IP address, to help users who may not have the server name properly resolved in DNS.  That way, only https need be accepted.
    The Subject Alternative Name must be formatted in the style  IP:10.x.x.x

    When the certificate is available, move back up to …/arcgis/admin/machines and go to machine name, and click on Supported Operations:  edit

    Enter the name of the cert that you want to use in Web server SSL Certificate field,
    then click Save Edits.

    After it completes, verify that the chosen cert is displayed.

  15. Enable https-only access for Admin connections to ArcGIS Server
    Starting from  http://<server>:6080/arcgis/admin/security/config
    click on  update then modify the Protocol parameter.  If you haven’t yet verified that the certificate was working and you were able to connect via https:, select the HTTP and HTTPS choice.
    If secure admin connections are working and you were able to connect through
    https://<server>:6443/arcgis/admin/security/config   then it’s OK to select the HTTPS Only choice.
    That’s where you want to end up, but don’t lock yourself out while doing it, so try the two-step approach until verified.  When done, click the Update button.
    ags_19After that, only secured connections to the server will be enabled, at :6443, e.g.
  16. Make Publisher or Administrative connection from ArcCatalog In the Catalog tree view, GIS Servers > Add ArcGIS Server > Administer GIS Server  use Server URL in form of

    with Authenication as used in the admin pages above.
    If you’ve used your own self-signed cert, just click through the warning and connect away.

No responses yet

Jun 30 2014

SGeoS Add PostgreSQL 9.2.8 Enterprise Database – Module 2 of 9

Published by under SL In General

PostgreSQL 9.2.8 Enterprise Database Server

Build steps for configuration Module-stage-2

  1. Start from completed system Module-stage-1
    In discussion with Josh Berkus (with Jeff Frost on the line) during PG update meeting of 2014.04.21, our target version is latest in PG 9.2 series, which was 9.2.8 as of that date, with PostGIS 2.0 extension.Per existing EAS data server configurations, data area goes in /data and logs in /pg_xlog
    System prep adapted from instructions in  PostgreSQL Wiki and this posting as well.PostGIS installation with myriad dependencies seemed best documented on this blog post.
  2. Configure YUM repository
    On the CentOS 6.5 system this is /etc/yum.repos.d/CentOS-Base.repo and it’s necessary to add the following lines to avoid having the default RHEL 6.5 version of postgresql installed:
    in [base]


    in [updates]

  3. Install PostgreSQL Global Development Group (PGDG) RPM packages for server
    Add these RPMs to replace with packages more current than the CentOS 6.5 default version.Start with installs of libraries upon which the PGDG package depends:

    yum localinstall\

    This solves a dependency that will otherwise cause the subsequent line to be unhappy.

    then go after the PGDG package itself.

    yum localinstall\


    and then the server package

    yum localinstall\


    and last, the devel package, required by PostGIS

    yum localinstall\


  4. Consider adding PGDG contributed package This is a consideration for the development server; probably not needed for production.
    yum localinstall \


    /* If things just don’t work out right, and a better way forward is found that requires change at an earlier step in the PostgreSQL installation process, it’s OK.  Document what’s going to change next time, and then:

    yum erase postgresql-9.2*


  5. Ensure path to installed PG resources is included
    This was necessary for the postgresql user, and in testing for root.
  6. su - postgres

    There, edit .bash_profile to append these lines:

    And source the edits to make them active

    source .bash_profile
    which pg_ctl
  7. Configure major PG locations
    Before initializing PostgreSQL, configure the file system for desired location of data and logs.
    Since the SGeoS machine will sometimes be primarily a database server, choosing root-level locations for data and logs seems merited.Make sure  /etc/sysconfig/pgsql/postgresql.conf exists,  and edit thusly:
    pg_07If these directories will be the locations, then they’d better exist, be owned by PG, grouped with PG, and one should attempt to label an appropriate SElinux context with semanage.

    cd /
    mkdir /data
    mkdir /pg_xlog
    chown postgres /data /pg_xlog
    chgrp postgres /data /pg_xlog
    semanage fcontext -a -t postgresql_db_t “/data(/.*)?”
    semanage fcontext -a -t postgresql_db_t “/pg_xlog(/.*)?”
    su - postgres
    mkdir /data/9.2
    mkdir /data/9.2/data
    mkdir /pg_xlog/9.2
  8. Initialze PostgreSQL (one time only)
    Carefully verify that your data area is prepared and writeable by postgres user, then initialize. If mistakes are made, consider a cd into /data, then $ rm -Rf 9.2 to try once again.

    initdb -D /data/9.2/data


    Continue to tune the data area.  These locations reflect the SFGIS EAS data server style.
    In the interest of SElinux harmony, do the cp, and do not use mv.

    cd /data/9.2/data
    cp  postgresql.conf  postgresql.conf.orig
    cp  pg_hba.conf  pg_hba.conf.orig
    cp -R  pg_xlog  /pg_xlog/9.2

    Verify the size of the copy of pg_xlog

    du -s pg_xlog


    du -s /pg_xlog/9.2/pg_xlog


    Remove the original pg_xlog, and replace with a symbolic link to the copy

    rm -R pg_xlog
    ln -s /pg_xlog/9.2/pg_xlog pg_xlog

    This should leave the directory looking like this:



  9. Start PostgreSQL and verify it’s running; create test user
    As the postgres user, start the service, from root su – postgres to set environment.(without enviro. variables set)

    pg_ctl start -l /pg_xlog/9.2/pg_xlog/syslog -D /data/9.2/data

    (with enviro. variables set)

    pg_ctl start

    That should work, so next use psql create a test user and schema to validate connections.
    But first set your postgres db user (db super user) password
    Now is the time to record this assignment in the run book

    postgres=# ALTER USER Postgres WITH PASSWORD ‘<newpassword>’;


  10. Open server (firewall) port to PostgreSQL service
    Exit to root, edit /etc/sysconfig/iptables to open postgresql port with a line similar to this:
    pg_13Then restart iptables to read the new configuration

    service iptables restart
  11. Configure PostgreSQL service to accept connections
    As user postgres, edit some postgresql configuration files in /data/9.2/data/

    su - postgres
    cd $PGDATA

    (or try the aliased  ‘gopg’)

    Edit postgresql.conf so that listen_address and port are uncommented and set properly for testing purposes.  For production this can be locked down to  later.

    Edit pg_hba.conf so that it’s simplified to something like this, where the db users are configured to connect locally through loopback (, which can work through an ssh connection, and for testing also the addresses of Windows workstations from which a GUI administration tool could be run (here 10.x.xx.0/24)
    (using md5 requires that the postgres db user password has been set)

    restart postgresql to get these changes applied

    pg_ctl restart


  12. Verify Connections function from Windows workstation
    On the workstation, it’s possible to use a Windows GUI like pgAdmin III to confirm the configuration is working for remote access.  This example describes pgAdmin.
    Launch pgAdmin, and use File > Add Server… to open the New Server Registration dialog.
    Input a reference name for the server in Name, the server’s IP address in Host, and consider testing connection to Maintenance DB postgres with user postgres if you’ve configured things as described above.
    pg_17This should add a line to the Servers object in Server Groups of pgAdmin’s Object Browser.
    pg_18Double-clicking the server object should expand it to show components of the PG instance.
  13. Secure db TCP/IP  Connections  with SSL
    As user postgres, consider testing with a new self-signed cert for use only by PostgreSQL.  The keys can be in an area separated from data.  One approach to do this is to create a directory above the active $PGDATA but still within the installation tree, like /data/9.2/pki

    cd /data/9.2
    mkdir pki
    cd pki

    Once there, generate a private key for postgresql

    openssl genrsa -out pgca.key 4096

    Generate a Certificate Signing Request

    openssl req -new -key pgca.key -text -out pgca.csr

    Generate a Self-Signed Key

    openssl x509 -req -days 365 -in pgca.csr -signkey pgca.key -out pgca.crt

    Copy these  files to the following locations (DO NOT move them; copy them–then delete)

    mkdir certs
    mkdir private
    cp pgca.crt /data/9.2/pki/certs
    cp pgca.key /data/9.2/pki/private
    cp pgca.csr /data/9.2/pki/private
    chmod 600 /data/9.2/pki/certs/pgca.crt /data/9.2/pki/private/pgca.*
    rm pgca.*

    Once the connections have been verified as working, save a copy of postgresql.conf and proceed to edit the section near Security and Authentication, turning

    ssl = on
    ssl_ciphers = ‘ALL:!ADH:!LOW:!EXP:!MD5:@STRENGTH’
    ssl_cert_file = ‘certs/pgca.crt’
    ssl_key_file = ‘private/pgca.key’

    Save edits, then restart PostgreSQL (as postgres user)

    pg_ctl restart
  14. On Windows, add PostgreSQL Client libraries to ArcGIS for Desktop
    An SFGIS installer has been prepared for ArcGIS 10.2.2 for Desktop and PostgreSQL 9.2 useConfusingly, even on Windows 7 Pro x86_64 systems, it is essential to load the 32-bit drivers for ArcGIS 10.2 for Desktop—go figure.  Download from the section DBMS Support Files (Client Libraries and Databases).  Avoid any temptation of downloading the Esri PostgreSQL 9.2.2 distribution if you wish to follow the hybrid build.  Instead, expand the PostgreSQL Client Libraries and download PostgreSQL 9.2.2 Client Libraries (Windows) for your workstations.Unpacking those and drilling down will reveal “32bit” and “64bit” folders.  Ignore the 64bit because it is only intended for Windows Server installs of ArcGIS for Server accessing PostgreSQL 9.2.  Instead, use the 32bit folder that is for all versions of ArcGIS for Desktop, even those on 64-bit Windows 7.  There should be six files (you’re in the 64bit folder if there’s only five!)
    Close all running ArcGIS apps, then
    copy all six into    “C:\Program Files (x86)\ArcGIS\Desktop10.2\bin“

  15. Configure PostgreSQL to be enabled at boot if desired
    For administrative convenience it may be desirable to have PostgreSQL always start up at boot.  Here’s how to set that; if the opposite result is desired, substitute “off” for “on”

    chkconfig postgresql-9.2 on
  16. Create an SDE database if desired
    For Esri Desktop user convenience it may be desirable to store data in Esri ST_GEOMETRY format as well as PostGIS  PG_GEOMETRY format.  While the PG_ is native to PostGIS, it is necessary to edit the single ArcGIS-enabled database’s SDE schema, sde_dbtune table, GEOMETRY_STORAGE row to have the value PG_GEOMETRY rather than the Esri-default ST_GEOMETRY.
    Of course, PostGIS must be installed before trying to load data with this geometry storage method!

No responses yet

Jun 30 2014

SGeoS Build PostGIS 2.1.3 with SFCGAL and GTK+ – Module 3 of 9

Published by under SL In General

PostGIS 2.1.3 with SFCGAL geometry and GTK+ annotation

Build steps for configuration Module-stage-3
PostGIS is a very powerful and highly interdependent Open Source GIS tool.
Despite its light and attractive project page and logo,
numerous PostGIS dependencies, some of which have themselves numerous dependencies,  can turn a source build process into a wrestle with a snarling beast.

The following install procedure began by adapting a particularly insightful and succinct blog post and continued to ensure that all available PostGIS 2.1 extensions, and its most precise geometric capabilities were enabled.

A wise choice might be to use the PGDG package rather than building this all from source.

Open Source is a capable and powerful approach, yet each contributor’s work becomes most efficient when only filling gaps between existing tools.  As a result, a high-level project such as PostGIS is built with many dependencies on the components it has connected; these dependencies may themselves have several levels of dependencies beneath that provide the capabilities used in that project.

Every one of these gets and clones is used in subsequent parts of this most-involved step, where the extended functions of PostGIS 2.1 have been enabled.  Most steps are built from source to incorporate the latest stable build.  As with all unix command lines, each and every character should be viewed as important. Places in this document where that’s the case  have been shown in Courier font.

  1. Start from completed system Module-stage-2
  2. Option A: Install PostGIS from package  To just get it done and move on to the next stage; this is a smart choice for most circumstances, unless one is intent on the very latest PostGIS / CGAL features.
    wget \
    yum install postgis2_92-2.1.3-1.rhel6.x86_64.rpm
  3. Option B (steps 4–31) build PostGIS from source with latest stable versions of dependencies:
  4. Obtain PostGIS and extensions sources used in subsequent steps for the first SGeoS testbed server.  This approach will help clarify the many components upon which PostGIS depends. Consider visiting the site in the leading parts of each URL then making an informed choice about which versions to download and build from source when starting fresh.
    mkdir /opt/installs
    cd !$
    git clone
    wget -O sfcgal-1.0.4.tar.gz
  5. Configure a few dependencies  Using these prepared packages saves system build time
    yum -y install tetex-tex4ht
    yum -y install libxml2-devel
    yum -y install ImageMagick*
    yum -y install gcc-c++  json-c-devel.x86_64
    yum -y install java-1.7.0-openjdk  java-1.7.0-openjdk-devel
    yum -y install java-devel xerces-j2
    yum -y install mesa-libGL mesa-libGL-devel mesa-libGLU-devel

    Notes regarding dependencies for building PostGIS with all extensions and documentation:
    – The teTeX package implemented TeX document typesetting for unix-like systems, the tex4ht package is the TeX for Hypertext, converting typeset technical documents into HTML and XML.
    – The development packages for XML is a C library for eXtensibe Markup Language (XML) that is part of the GNOME (“genome”) project that builds desktop frameworks for Linux.  The libxml2 package is also used outside of the desktop environment to handle XML interchange in C programming.
    – The ImageMagick package provide some file format conversion and image processing functions that can be used within several programming environments
    – The GNU C++ compiler is a vast package to build, and the default version works for most source, and the JavaScript Object Notation development bundle is sought for by PostGIS
    – Open JDK is an Open Source implementation of Java Standard Edition from Sun Microsystems prior to its acquisition by Oracle.  Open JDK is the reference implementation of the Java Development Kit.
    – Java development tools are augmented by the Xerces2 Java Parser to implement XML schema
    – mesa-libGL are OpenGL development packages installed from the MIT mesa implementation.
    The main Mesa package was installed for ArcGIS, so expect only the devel packages to be added.
    – Doxygen is a documentation generator used to build PostGIS documentation

  6. Install proj-4 from source, the -j2 flag allows compilation in two threads for a 1-core machine. The PROJ.4 package performs all manner of geographic projections and transformations and is used by PostGIS.
    cd /opt/installs
    tar xvf proj-4.8.0.tar.gz
    cd proj-4.8.0
    make -j2
    make check
    make install
    ln -s /usr/local/lib/pkgconfig/proj.pc /usr/lib64/pkgconfig/
  7. Install GEOS from source,  this requires the c++ compiler if it’s not already installed. This is the Geometry Engine – Open Source (GEOS), ported from Java Topology Suite to C++, and is the PostGIS default for operations not performed by CGAL.
    cd /opt/installs
    tar xvf geos-3.4.2.tar.bz2
    cd geos-3.4.2
    make -j2
    make install
  8. Install json-c from source,  on CentOS 6.5 this required an updated autogen as of 2014.05.19. The JavaScript Object Notation enables attribute-value pair object communication. JSON-C provides this capability for C language programming purposes and is used by PostGIS.
    cd /opt/installs/
    tar xvf json-c-0.12-nodoc.tar.gz
    cd json-c-0.12
    autoreconf -fvi
    make -j2
    make install
    ln -s /usr/local/lib/pkgconfig/json.pc /ur/lib64/pkgconfig
  9. Install HDF5 from source,  Used by GDAL, takes over eight minutes to make a default config; the make check provides some peace of mind given the vast number of warnings thrown.  This is the Hierarchical Data Format developed by NCSA in the US, and used by Python, Matlab, and Java.
    cd /opt/installs/
    tar xvf hdf5-1.8.13.tar.gz
    cd hdf5-1.8.13
    make check
    make install
  10. Install GDAL from source,  use latest Python 2.7.6 by running in virtualenv for this; be patient. This is the Geospatial Data Abstraction Library (GDAL) to transform vector and raster data formats through a common GDAL abstract raster type and a common OGR abstract vector data type.  With these OGR types merged, GDAL functions like an Open Source version of Safe Software FME.
    cd /opt/installs
    virtualenv venv
    source venv/bin/activate
    tar xvf gdal-1.11.0.tar.gz
    cd gdal-1.11.0
    ./configure --with-python
    make -j2
    make install
  11. Install CUnit from source,  supports unit testing; version 2.1-2 installs with configure, so use that version.  CUnit provides a testing framework that can be used by C programmers.  This module is used in PostGIS to construct standard test suites to verify function of code after it has been built.
    cd /opt/installs
    tar xvf CUnit-2.1-2-src.tar.bz2
    cd CUnit-2.1-2
    make install
    ln -s /usr/local/lib/pkgconfig/cunit.pc /usr/lib64/pkgconfig
  12. Install dblatex from egg,  depends on earlier  easy_install  Python package when building new Python from source (Module-0, Step 8)  and a manual install of DocBook DTD and an initial catalog for PostGIS documentation.  The first computer-based typesetting system TeX was extended with macro tags to become LaTeX, and a specialized set of macros for technical documentation were applied to create DocBook LaTeX, or dblatex.  With it, one writes documentation once in a neutral format, then exports it to many different presentations.
    cd /usr/local/share
    mkdir xml  xml/docbook  xml/docbook/dtd  xml/docbook/dtd/5.0
    cd !$
    wget -O docbook5.dtd
    cd /usr/local/share/xml
    xmlcatalog --noout --create docbcatalog
    xmlcatalog -noout --add ‘public’ ‘-//OASIS//DTD DocBook XML V5.0//EN’ \
    ‘file://usr/local/share/xml/docbook/dtd/5.0/docbook5.dtd’  docbcatalog
    # install DocBook style sheets
    yum install docbook5-style*
    cd /usr/share/sgml/docbook
    ln -s xsl-ns-stylesheets-1.75.2 xsl-stylesheets
    easy_install dblatex
  13. Install CMake from source,  yet another build tool, this one used by CGAL.  The CGAL package is vast and written in C++, so a more powerful make tool was used than the C-oriented system defaults.
    cd /opt/installs
    tar xvf cmake-
    cd cmake-
    make install
  14. Install Boost from source,  a vast collection of C++ extensions used by CGAL; be patient as it can take 12 minutes to compile.  Boost libraries provide standard tools that underlie much of the numerical programming in CGAL, boosting the productivity of the programmers it serves.
    cd /opt/installs
    tar xvf boost_1_55_0.tar.bz2
    cd boost_1_55_0
    ./b2 install --prefix=/usr/local
  15. Install GMP from source,  This is the arithmetic library used by MPFR.  The recursive name GNU’s Not Unix (GNU) brands the original Open Source porting of Unix.  The GNU Multiple Precision  (GMP) arithmetic library overcomes common floating-point limits with extensible precision for calculations.
    cd /opt/installs
    tar xvf gmp-6.0.0a.tar.bz2
    cd gmp-6.0.0
    make check
    make install
  16. Install MPFR from source,  multi-precision floating point library used by CGAL.  This is the GNU Multiple Precision Floating-point Reliably (MPFR) library, where you can divide by zero and not crash.
    cd /opt/installs
    tar xvf mpfr-3.1.2.tar.bz2
    cd mpfr-3.1.2
    make check
    make install
  17. Install Qt4 from source,  C++ programming framework used by CGAL; a huge build that could take 45 minutes or more to compile. The Qt (“cutie”) framework was developed through a company Quasar Technologies and provides a library of interface graphic widgets for designers across many platforms.  When Nokia bought Quasar, the name became Qt.
    NOTE: ArcGIS mobile applications now use ArcGIS Runtime SDK for Qt, so this package can have use for both Esri and CGAL purposes.

    cd /opt/installs
    tar xvf qt-everywhere-opensource-src-4.8.6.tar.gz
    mv  qt-everywhere-opensource-src-4.8.6  qt-4.8.6
    export QTDIR=/opt/installs/qt-4.8.6
    cd qt-4.8.6
    gmake install
  18. Install LEDA object libraries,  graph and network system used by CGAL.  The Library of Efficient Data Types and Algorithms (LEDA) is from Max Planck Institute provides computational geometry and graph theory algorithms.  Its distrubutor Algorithmic Solutions Software GmbH licenses source code for commercial use, and offers the library of binary functions for free.  We use the binaries.
    cd /opt/installs
    tar xvf LEDA-6.3-free-fedora-core-8-64-g++-4.1.2-mt.tar
    mv  LEDA-6.3-free-fedora-core-8.64-g++-4.1.2-mt   LEDA-6.3
    export LEDAROOT=/opt/installs/LEDA-6.3
  19.  Install CGAL from source,  general-purpose spatial math processing from INRIA France wrappered by SFCGAL.  The Computational Geometry Algorithms Library (CGAL) is a C++ library for efficient and reliable geometric algorithms.  It is available for use with Open Source software for free and is licensed for commercial use.  Because it incorporates arbitrary precision and floating-point reliability, it might produce more accurate and reliable spatial queries.  For this, it was considered worth the trouble of its many dependencies to build it into PostGIS.
    cd /opt/installs
    tar xvf CGAL-4.4.tar.bz2
    cd CGAL_4.4
    cmake .

    (Note: in the 4.4 source, it was necessary to patch CGAL-4.4/src/CGAL_Qt4/all_files.cpp line to comment out line 2 with  // #include /opt/installs/CGAL-4.4/src/CGAL_Qt4/DemosMainWindow.cpp   to force not compiling the demos)

    sed -i '2 s/^/\/\//' src/CGAL_Qt4/all_files.cpp
    make install
  20. Install gcc 4.7.2 from developer resource,  the SFCGAL team uses this newer-build C language compiler that provides syntax flexibility with ‘typename’ and they rely on it.  The leading part of environment variable PATH can be trimmed after compilation if desired to return to gcc 4.4.7 that comes with the CentOS 6.5 distribution
    cd /etc/yum.repos.d
    yum --enablerepo=testing-1.1-devtools-6 install devtoolset-1.1-gcc devtoolset-1.1-gcc-c++
    export CC=/
    export PATH=/opt/centos/devtoolset-1.1/root/usr/bin${PATH:+:${PATH}}
  21. Install SFCGAL from source,  the PostGIS wrapper for OGC objects in CGAL.  Simple Features in CGAL (SFCGAL) is an implementation of Open GIS Consortium (OGC) spatial object manipulations that can be accessed through an extended SQL syntax.
    cd /opt/installs
    tar xvf sfcgal-1.0.4.tar.gz
    cd SFCGAL-1.0.4
    cmake .
  22. Install Apache Ant from binaries,  depends on Open JDK and java-devel installed at Step 2.  The Ant installer is a build tool created in Java, and it is used by PostGIS to build some drivers that are written in Java.
    Since it’s also needed for building Tomcat later, share it with a symbolic link in /bin.

    cd /opt/installs
    tar xvf apache-ant-1.9.4-bain.tar.bz2
    export ANT_HOME=/opt/installs/apache-ant-1.9.4
    export PATH
    ln -s /opt/installs/apache-ant-1.9.4/bin/ant /bin/ant
  23. Install pkg-config from source,  pkg-config is used at libffi build time to query the system’s installed libraries.
    cd /opt/installs
    tar xvf pkgconfig-0.18.tar.gz
    cd pkgconfig-0.18
    make install
  24. Install libffi from source,  required for glib-2.0, this is the Foreign Function Interface library for C-language programming.  It allows code to dynamically call compiled functions by pointer rather than compiling the functions into the each module that uses it; elsewhere used in Python and Ruby.
    cd /opt/installs
    tar xvf libffi-3.1.tar.gz
    cd libffi-3.1
    make install
  25. Install glib-2.0 from source,  required for GTK+ graphics, the GLib bundle is five C-language system libraries developed by GNOME project that provides generic memory management and threading and the GLib object system.
    cd /opt/installs
    xz -d glib-2.41.0.tar.xz
    tar xvf glib-2.41.0.tar
    cd glib-2.41.0
    ./configure --enable-man=no
    make install
  26. Install GTK+  from source,  depends on Open JDK and java-devel installed earlier, and on the GLib object system.  The GNU Image Manipulation Program (GIMP) is a raster data editor.  The enhanced GIMP Tool Kit (GTK+) is a set of interface graphic widgets.
    cd /opt/installs
    xz -d gtk+-3.12.2.tar.xz
    tar xvf gtk+-3.12.2.tar
    cd glib-2
  27. Install Graph visualization toolkit, used by Doxygen for the PostGIS documentation generators.
  28. Install Doxygen, used by the PostGIS documentation generators.
    cd /opt/installs
    tar xvf doxygen-1.8.7.src.tar.gz
    cd doxygen-1.8.7
    make install
  29. Install PostGIS from source,  finally this is the actual PostGIS build. Note that as of 2014.05.28 it was necessary to apply a patch according to this OSGeo Trac ticket so that PostGIS can build against the latest json-c 0.12, where the error calls being used were – postgres
    cd /opt/installs
    tar xvf postgis-2.1.3.tar.gz
    cd postgis-2.1.3
    ./configure –with-gnu-ld
    # hopefully yields something like the following:postgis_configureapply the patch per

    make -j2
    make check
    make install

    No fireworks to celebrate, just a shared object for PostgreSQL to use.

  30. Now it’s time to enable PostGIS in a first spatial test database.  This example calls it “sp_uno” and we’ll also verify that PostgreSQL is already running by trying to start it. ‘=#’  means the psql prompt.
    pg_ctl start
    createdb sp_uno
    createlang plpgsql sp_uno
    psql sp_uno
    =# CREATE EXTENSION postgis;
    =# CREATE EXTENSION postgis_topology;
    =# CREATE EXTENSION fuzzystrmatch;
    =# CREATE EXTENSION postgis_tiger_geocoder;
    =# \q

    For full ability to work with rasters, set these environment variables in the system’s global /etc/environment  file if they are always wanted.


    When creating a new ArcGIS enterprise geodatabase, these scripts should be run to enable PostGIS in the database (each separate database needs these initializations and they do not appear to conflict with ArcGIS use of the same database).
    Example: for a freshly created ArcGIS database egdb1, as system user postgres run

    cd /opt/installs/postgis-2.1.3
    psql -d egdb1 -f  doc/postgis_comments.sql
    psql -d egdb1 -f  spatial_ref_sys.sql
    psql -d egdb1 -f  postgis/sfcgal.sql

    that should leave 1068 functions in the PostgreSQL  public schema for db egdb1.

  31. Perform the PostGIS Garden Test to verify the install.  In the documentation directory /opt/installs/postgis-2.1.3/doc there are source files that can be used to generate PostGIS documentation, as well as some testing tools.  Based on instructions posted here, it’s possible to configure global tests.  If this is the first time running these tests, fear no error when dropping a nonexistent testpostgis db.  These commands will create a testing db, enable PostGIS within it, and run the two torture tests.  The geo_torturetest is rather punative:
    cd /opt/installs/postgis-2.1.3/doc
    xsltproc -o geo_torturetest.sql xsl/postgis_gardentest.sql.xsl postgis.xml
    xsltproc -o rast_torturetest.sql xsl/raster_gardentest.sql.xsl postgis.xml
    psql -U postgres -d postgres -c "DROP DATABASE testpostgis;"
    psql -U postgres -d postgres -c "CREATE DATABASE testpostgis;"
    psql -U postgres -d testpostgis -c "CREATE EXTENSION postgis;"
    psql -U postgres -d testpostgis -f ../topology/topology.sql
    psql -U postgres -d testpostgis -f ../postgis/sfcgal.sql
    psql -U postgres -d testpostgis -f geo_torturetest.sql > geo_torturetest_results.txt
    psql -U postgres -d testpostgis -f rast_torturetest.sql > rast_torturetest_results.txt

No responses yet

Jun 30 2014

SGeoS Add Esri Enterprise Geodatabase features – Module 4 of 9

Published by under SL In General

Add Esri Enterprise Geodatabase features


Build steps for configuration Module-stage-4

After PostgreSQL has been installed, the Esri ArcGIS for Server keycode produced when the ArcGIS for Server Standard application server was licensed for the machine can be used to enable an Esri Enterprise Geodatabase (the Application Formerly Known As ArcSDE) on just one of the PostgreSQL databases.

Natively, an Esri Enterprise Geodatabase will store geometry in its own implementation of ST_GEOMETRY type (distinct from Oracle’s implementation).  Esri ST_GEOMETRY is compact and optimized for fast exchange between ArcGIS and the geodatabase.  For spatial analysis with PostGIS, it is necessary to use the PostGIS implementation of OGC standards, PG_GEOMETRY type.  When there are performance concerns with ArcGIS Server, the ST_GEOMETRY type might be preferred as a publication format.  For spatial analysis with access to to CGAL geometry libraries, there are presently 1068 SQL functions in PostGIS, while there are 349 SQL functions in Esri SDE.  PostGIS can operate on features with PG_GEOMETRY, while Esri can operate on features with either PG_GEOMETRY or ST_GEOMETRY.  This creates a bit of complexity, yet also offers a number of ways to approach optimal storage.

When licensing Esri ArcGIS 10.2.2 for Server on the machine, the installation will create and store keycodes in a tiny WINdows Emulator provided by an open source application WINE.   The path to keycodes is like:

/ags1022/arcgis/server/framework/runtime/.wine/drive_c/Program Files (x86)/ESRI/License10.2/sysgen

1) Start from completed system Module-stage-3

2) Locate Esri Server License  As a licensed product, ArcGIS will require the server keycode to enable an Esri Enterprise Geodatabase.

To create a single new Esri Enterprise Geodatabase, use the Create Enterprise Geodabase tool

Choose Database Platform of PostgreSQL, set Instance to resolvable name for the server, define a new geodatbase name that is very short but descriptive, and supply your credentials for the postgres Database Admistrator, for the sde Geodatabase Administrator, and the path to keycodes for Authorization File.

To connect to an existing Esri geodatabase, use ArcCatalog or a Catalog pane in ArcMap, click Database Connections > Add Database Connection.

In the Database Connection dialog, set Database Platform to PostgreSQL, for Instance use a resolvable name for the Geospatial Hybrid Device (GHD) server or its IP address, select Database authentication in the Authentication Type drop-down, and enter User name ‘sde’ and appropriate password, then select the Esri geodatabase from the Database drop-down.

With a working connection such as “sde_to_eg1_on_sg11.sde”, open the connection by double-clicking its tin can icon tin_can_icon  then once open, right-click and follow context menu to Administration > Create and Manage Roles

No responses yet

Next »