[OBM Admin] OBM database finalization steps

Bán Miklós banm at vocs.unideb.hu
Sun Nov 6 14:35:47 CET 2016



Hi Robi,

When you "Founding new project" you create a skeleton. This skeleton
has three parts:
- a directory tree in the filesystem: 
  /var/www/html/biomaps/projects/YOUR_NEW_DATABASE
  containing symlinks to the program files and containing local
  setting files (local_vars.php.inc .htaccess)
- 3 tables within the gisdata database (any additional tables can be
  created later): 
  YOUR_NEW_DATABASE
  YOUR_NEW_DATABASE_history
  YOUR_NEW_DATABASE_taxon
- a postgresql user for the new database that has
  authorisation to access all necessary tables (e.g. temporary ones).
  The name of this is "YOUR_NEW_DATABASE_admin"

This is clearly not sufficient to start working with a new database
project. Certain additional settings have to be made in order to connect
the SQL tables to the Mapserver, and let the web application use both
your tables and the Mapserver according to the following steps.

MAPSERVER -> DATABASE -> WEBAPP -> OPENLAYERS -> MAPSERVER

- First, you must "pick-up" your database columns. The OBM does not
  automatically handle the columns in the tables. Therefore chosen
  columns have to be marked for identity and type of use. They have to
  be allocated names (these can be the same as in the database or
  different such as "datum" ->  "str_datum") and must be marked as
  "special column" or "common data". "Special columns" are the unique
  id (this must be set to [obm_id]), the_geometry (there are no map
  services without this) and perhaps a date, the number of individuals
  and citing person columns. 
  These settings can be done in the administrative menu->"column names"
  window. If your databases later extended with additional
  tables, these have to be "picked up" again the same way.

- Second, a number of sql queries are then to be made to the Mapserver
  and web application. I recommend to copy the queries from the
  templates project. These queries can be simple or even very
  complicated. If you have only one data layer and one user access
  level in your new project only one query need to be set up for the map
  visulisation and an other for the query data. "Base type" queries
  will only be used by the Mapserver but "query type" queries will
  be used by both the Mapserver and the web application. These
  queries can be accessed by their names (the defaults are "layer_data"
  and "layer_query" ). Administrative menu->"SQL queries" window.

- In the next step access for Openlayers to Mapserver layers must be
  set up through the names set in the previous step (layer_data,
  layer_query). The example setting on the page may be used here (above
  the form window) and reading through the templates' project settings
  is also recommended. If Openlayers have been successfully connected to
  Mapserver, individual queries will appear in this window in small
  grey letters instead of huge red warnings. See Administrative
  menu-> "WEB Map Layers" window.

- Mapfile (private) then has to be checked and all @@variable@@
  replaced with the corresponding real value. E.g. @@@srid@@ -> 4326. I
  think the EXTENT is a bit more complicated, if you don't know what it
  means see here: http://mapserver.org/mapfile/map.html). E.g.:
  Romania's bbox is: 20.2155838012695 43.5630531311035 29.9736919403076
  48.400691986084

The following are are fine tunning steps and bug trackings:
- Check your settings -> if the map is not pink that is a good sign.
- Create an upload form & upload some data.
- Go to the phppgadmin interface gisdata/YOUR_NEW_DATABASE and
  use the analyse function of postgresql
- Go back the mapserver settings to see your calculated
  bounding box of your data. This can be copied/pasted as
  EXTENT .....
- Query the records & check the results

Any errors made in the steps above will cause pink squares on the map
window.

Reading the syslog and the mapserver log will help resolve these
problems. (tail -f /var/log/syslog 
 tail -f /tmp/YOUR_NEW_DATABASE_private_ms_error.txt)
  
If you would like to see the settings for templates during
the configuration of your new database you must have open the database
project in two separate browsers (e.g. Chrome and Firefox) as 
OBM does not allow two projects to be running in the same browser at
the same time.


I know - it is a bit complicated. :)

I would like to ask you to put some notes down while you are doing it,
so that we can write some pages for the manual using these and your
notes in OBM wiki: http://openbiomaps.org/obwiki

Best wishes, Miki




Magyarul rövidítve:
- Adatbázis oszlopok felvétele. 
- SQL lekérdezések készítése a Mapservernek és a web alkalmazásnak
- OpenLayers beállítások a Mapserver rétegekhez
- Mapserver mapfile beállítások

Minden egyes lépéshez javaslom a template project megfelelő
beállításainak a nézegetését!

üdv, Miki


On Sun, 30 Oct 2016 10:40:41 +0200
Robi <veresrobi18 at gmail.com> wrote:

> Hi,
> 
> Miki, would you please write down the steps i need to take to do my
> map and query's work, after i make a new database.
> 
> Miki, volnál szíves leírni azt a pár lépést amit meg kel tennem, hogy 
> egy új adatbázisban a térkép és a lekérdezések működjenek.
> 
> Robi
> _______________________________________________
> Administrator mailing list
> Administrator at lists.openbiomaps.org
> http://lists.openbiomaps.org/cgi-bin/mailman/listinfo/administrator



-- 
Miklós Bán, PhD
MTA-DE "Lendület" Behavioural Ecology Research Group
Department of Evolutionary Zoology, University of Debrecen
H-4010 Debrecen, Egyetem tér 1.
Phone:  +36 52 512-900 ext. 62356
http://zoology.unideb.hu/?m=Miklos_Ban
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~


More information about the Administrator mailing list