TopoDelProp

TopoDelProp.Tool for managing geographic data and metadata to support a legal cadastre. Valid for every country.


Empty database creation instructions in Windos and Linux systems


J. Gaspar Mora Navarro
Dep. de Ing. Cartográfica, Geodesia y Fotogrametría
Escuela de Ing. Geodésica, Cartográfica y Topográfica
Universidad Politécnica de Valencia
topodelprop@gmail.com

You can to try a system justification and the program manual in the thesis document

http://riunet.upv.es/handle/10251/321/browse?authority=27239&type=author


In the thesis docuement you'll finde a detailed description from the instalation in Windows from TopoDelProp plugin and from the usuary manage program TopoDelPropUsuarios.py



Probably you want to test the program quickly and see if you are intresting in his studio or not. For that I recomend you that you install the plugin and configure it. That can bring you abbout 5 minutes. Later test it. You can access, as a 'editor1' or 'consultor_autorizado1', to the test database instaled in 158.42.199.31 IP. Passwords are the same then user names. Test the plugin and, if you are interesed in to have your own database, then follow with the next instructions.


The data connection are:


host: 158.42.199.31

port: 5432

database: propiedad

user: consultor_autorizado1

password: consultor_autorizado1


Immediately after connecting, SRC and the municipality to be loaded are requested. The only municipality that has data is Burriana, 25830 Coordinate System. Click on the list of 25830 and, in the text box, type burr, to filter the municipalities, then Click at the list of municipalities on 12032;Borriana/Burriana.


















The Internet access to server is slow. If you wish, you can to install a database with 80 topographic academic works in your computer. For it you have to have instaled PostgreSQL 9.1, 9.2 o 9.3 + PostGIS 2 o 2.1. Download de database file copy and restore it in your computer. It's easy. The data connection are the same I had mentioned.


The instructions and database file are in one entry in http://personales.upv.es/joamona/index.html


You will find a summary http://planosypropiedad.com blog.


I say you that the program isn't easy tool because it try to solve a complex problem: mange the topographic data and metadata in the same database. Automatic process in the database informs you if the geometry of the data are correct or not. Also you can send and retrieve documents like: plans, dwg, imagens, … The manual have abbout 100 pages, in spanish.


Plugin instalation


You need to do two steps:


For the QGIS plugin works, there are to make a archive called dirTrabajos.txt. His position is obliged. In Windos have to be in c:/ directly. In Linux in \home\user. The file content is two lines:


In Windows, the content of the file can be (see in the two - - of the end, they are necessary):


c:/delProp--

C:/Program Files (x86)/Adobe/Reader 9.0/Reader/AcroRd32.exe--


In Linux, the file content can be:


/home/usuario/delProp--

evince--







Other plugin documents


Inside TopoDelProp instalation directory, you will find an other directory named documentos,

Si examina el directorio de instalación del plugin TopoDelProp, encontrará una carpeta, inside that directory there are some other directories of interest:




CREATING A DATABASE EMPTY IN ANY REFERENCE SYSTEM TO WORK WITH TOPODELPROP



These instructions are more current then the thesis document instructions.


The difference for the creation of the database between Windows an Linux system, it's only in the path from code SQL files that necessary to execute. Unafortunately, the paths to files have to be absolutely. For modify the less as possible the paths I propose:




  1. Make the 'propiedad' database (you can use every other name).


Windows: createdb -U usuario -E UTF8 propiedad

Linux: createdb -E UTF8 propiedad


The difference betwin Windows and Linux, using PostgreSQL, is that in Linux you need to use the same user from Linux an PostgreSQL. Is for that you don't need to specific user and password every time in Linux for use psql program.


  1. Inside database, make the PostGIS extension. You need postgis 2, or 2.1

In a console window:


Windows: psql -U usuario -d propiedad -W

Linux: psql propiedad


create extension postgis;


  1. Create the users for start: admin_propiedad1, editor1, consultor1, consultor_autorizado1. The passwords for this users is his own name.


A partir de ahora hay que ejecutar archivos .txt que contienen código SQL en la base de datos


Los archivos se ejecutan desde dentro de la base de datos propiedad con

\i \ruta_absoluta\nombrearchivo.extension


Es por esto que es conveniente copiar la carpeta cbd en \home, de esta forma

las rutas no hay que cambiarlas dentro de los archivos. Para hacerlo tendrá que actuar como

administrador. Luego, también como administrador, tendrá que conceder permisos sobre el directorio a todos los usuarios para que psql tenga acceso a ellos.


























Puede eliminar estos usuarios y crear nuevos, manualmente o con la aplicación

UPVDelPropUsuarios.py. Encontrará la forma de instalación y manual en el documento

de tesis


Los usuarios de partida se crean ejecutando


\i /home/cbd/001_creaUsuarios.txt


  1. Crear las tablas comunes para todos los esquemas espaciales

Antes de ejecutar este script localice los ficheros de texto provincias.txt y municipios.txt, en el directorio /home/cbd/v2/def, y sustituya las provincias y municipios españoles por los de su país.

Guarde el fichero con codificación UTF8.


Ejecute el fichero:

\i /home/cbd/comun/001_creaComun.txt









  1. Conceder permisos a los usuarios sobre las tablas comunes


\i /home/cbd/comun/004_permisosComun.txt


  1. Crear tablas espaciales

En este caso, se proporcionan archivos de texto que generan las tablas espaciales

para el src 25830 (código EPSG para el sistema ETRS89, UTM, huso 30)

Para cambiar el sistema, solo debe acceder a los archivos y sustituir el texto 25830 del archivo por su código EPSG.


El archivo proporcionado, que llama a otros archivos es


/home/cbd/src25830/001_crea25830.txt


Este archivo ejecuta otros tres


/home/cbd/v2/def/3src25830.txt

/home/cbd/v2/edicion/3edSrc25830.txt

/home/cbd/script/fdisparadoras/crea_disparadores_25830.txt


Debe acceder a los cuatro archivos y sustituir el texto 25830 del archivo por su código EPSG


Luego solo debe ejecutar el primero, que a su vez, ejecuta el resto.

\i /home/cbd/src25830/001_crea25830.txt


Ahora se necesita conceder permiso a los usuarios sobre los nuevos objetos de la base de datos, para ello acceda al archivo


/home/cbd/src25830/004_permisos25830.txt


y sustituya el texto 25830 por su nuevo código EPSG y ejecútelo en la base de datos


\i /home/cbd/src25830/004_permisos25830.txt


Este es el proceso para crear un SRC nuevo. Si necesita más SRCs para cubrir más territorio solo debe duplicar los cinco archivos y sustituir el viejo texto SRC por e nuevo, ejecutando después solo dos de ellos: 001_creaXXXXX.txt y 004_permisosXXXXX.txt


Le aconsejo la siguiente estrategia:


Puede repetir el proceso con todos los SRC que necesite. Se crean las tablas espaciales, se conceden los permisos a los usuarios, y se añaden los procedimientos automáticos de la base de datos.


  1. Configuración del plugin TopoDelProp


Para poder utilizar los nuevos SRC creados desde el plugin TopoDelProp, queda un último detalle. Hay que añadir los textos de los nuevos SRC a la lista de SRC del programa. Para ello únicamente hay que añadirlos a la tabla de la base de datos dom.src_trabajo (esquema dom, tabla src_trabajo). Añada solo el número del src en la columna src_trabajo. Si tiene cinco SRCs creados, deberá tener cinco filas en esta tabla.


















Joaquín Gaspar Mora Navarro