-
BDGeomet: Obtaining geometries from a database (local or remote)
Direct access to online help: BDGeomet
Access the application from the menu:
"File | Import | Vector and/or databases | DBF, Access, etc -> MMM (PNT, ARC/NOD, POL)"
"File | Export | PNT -> DBF (x,y,z)"
"Tools | File maintenance | Obtain points from DBF table, Access, etc"
Presentation
This application generates vector files from a geographic locations field of point type (X,Y) or from a WKT geometries field in a table of any database (local or remote). In the case of a geographic locations field of point type, the output file is generated topologically structured in MiraMon's PNT format.
This is particularly useful when the user has a table in which each record consists of the (X,Y) location of a single point or the vertices of its geometry in WKT format (whether point, line, or polygon) and one or more attributes (for example, pollution levels in wells). In such cases the program converts the table into a graphical information layer (PNT) with associated alphanumeric information (either maintaining the link to the original database or by exporting the data to a DBF table associated with the point file).
The table may be stored in any of a number of databases, e.g. DBF, ACCESS, ORACLE, DB2, EXCEL... For all these databases, except DBF, the access is performed via ODBC (Open DataBase Connectivity). For those databases stored in a file (e.g. MDB files for ACCESS, XLS files for EXCEL, etc.) the file can be accessed directly. For those databases stored on a server (eg ORACLE, INFORMIX, DB2, etc.) it is necessary to use a special DSN (Data Source Name) file, which can be generated using the "Orígenes de Datos (ODBC)" WINDOWS tool (search for ODBC in WINDOWS for more information). In the cases where a databases is accessed via ODBC it is possible to select either any existing table or view (predefined query) in the database, or to choose to use a SQL statement to dynamically generate the desired table.
The libraries used for the interpretation and manipulation of geometries in WKT (Well-Known Text) format have been developed within the GEOS (Geometry Engine - Open Source) project, mainly maintained by OSGeo members and several independent contributors. These libraries are distributed under an LGPL license; we thank the authors and contributors of the GEOS project for their generosity and effort in making them available to the community.
A special case for the use of this program is for recovering the labels that were used to assign attributes to a polygon layer as the polygon database (P.dbf) often contains, in the MAPX and MAPY fields, the coordinates of the labels. It must be remembered, however, that it is always possible to recover the labels of a polygon layer through Etiqueta.
Thus, the input table may be a DBF format table, a DBF table associated with a polygon database (P.dbf), or a table from any of a number of databases (ACCESS, EXCEL, ORACLE, DB2, SQL-Server, etc). Whatever the case, the input table must have two fields that contain the X and the Y coordinates of the point respectively. When the points are extracted from a DBF file or table in a generic database, these fields may have any name; however they must be called MAPX and MAPY when dealing with a DBF file associated with a polygon database (the default option in the MiraMon topology structuring process).
When the points are extracted from a DBF file or table in a generic database, all the fields are exported to the points database (T.dbf) only in those cases where the user has chosen not to maintain the link with the original database. On the other hand, when the labels are extracted from a structured polygon file (P.dbf) the only fields that are incorporated to the T.dbf are those fields that do NOT refer to the geometric and topological characteristics of the polygons (fields like AREA, PERIMETRE, N_VERTEXS, etc, are not exported). If it is necessary to select just a few fields, then use a SQL sentence via ODBC.
In case of a geographic locations field of point type, the fields containing the X and Y coordinates can be numeric (N) (e.g. 4500120.0 for UTMY or 12.01 degrees) or character (C) fields. In the latter case, the format of degrees, minutes and seconds is supported: Dº M' S".
Also in case of a geographic locations field of point type, by default, the program structures topologically the layer of points created, that is, it ensures spatial uniqueness so that two points located at a distance less than or equal to a given tolerance are considered the same point. From the "Advanced" button it is possible to indicate the value of this tolerance (which will have a zero value if no other is indicated). Also from this "Advanced" button the user can indicate that do not want to structure topologically, and in this case two or more points located in the same place will be kept as independent points.
As just explained, the tolerance value, which only applies when it is structured topologically, must be expressed in the same units as the XY coordinates and serves to consider two points located as equal at a Euclidean distance less than or equal to this value. When this happens, if the attributes of the two or more points located within a radius less than or equal to the tolerance are different (in any of the subject fields in the database), the point becomes, in the T.dbf table, as many records as original points had different attributes (a situation described as "multiple record"). Instead, if the attributes are the same (very close points but with repeated information) a single record is generated, in the T.dbf table, for the point. In the case of maintaining the link to the original database via ODBC and having to generate multiple records due to topological structuring and tolerance, this multiple record is created naturally.
Through the "Advanced" button it is also possible to indicate the reference system. If not specified, the default reference system (saved in MiraMon.par) is applied.
If in the last run a non-zero tolerance was defined, or a different reference system than the default system indicated in MiraMon.par, the symbol '!' next to the "Advanced..." button will warn that it is very convenient to press the button and check if the user still wants to apply these special parameters.

Dialog box of the application

Syntax
Syntax:
- BDGeomet InputFile OutputFile [/CAMPX] [/CAMPY] [/CAMPID] [/ODBC] [/TAULA] [/SQL] [/LLIGAM] [/NO_ESTRUCTURAR] [/TOLERANCIA] [/GMS] [/PROJECCIO] [/DEBUG] [/CONSULTA_LENTA] [/PUNTS] [/CAMPWKT] [/ARCS] [/CAMPZ] [/POLS]
Parameters:
- InputFile
(Input file -
Input parameter): A polygon file (POL), a DBF or any database via ODBC (MDB, XLS, DBF or DSN). If the input file is POL, it is not necessary to define any of the optional parameters. If the input file is a database, you must specify: /CAMPX, /CAMPY, and /CAMPID (in the case of a point coordinates field) or /CAMPWKT (in the case of a WKT geometry field).
- OutputFile
(Output file -
Output parameter): Name of the output points file, when importing a point coordinates field, or name of the output map file, when importing a WKT geometries field.
Modifiers:
/CAMPX=
(X coordinate field)
The field containing the X coordinate (physical field or the result of a SQL query). (Input parameter) /CAMPY=
(Y coordinate field)
The field containing the Y coordinate (physical field or the result of a SQL query). (Input parameter) /CAMPID=
(Entity identifier field)
The field containing an Entity identifier (physical field or the result of a SQL query) See the parameter /LLIGAM. (Input parameter) /ODBC
(ODBC)
If the input file is DBF and the user wishes to access it via ODBC, this parameter should be set. (Input parameter) /TAULA=
(Table)
The table in which the previous fields are found. (Input parameter) /SQL=
(SQL Sentence)
SQL sentence, which must necessarily contain the fields CAMPX, CAMPY and CAMPID (see the parameter /LLIGAM). Field aliases may be used. (Input parameter) /LLIGAM
(Link should be maintained between the points file and the original)
If this is set it indicates that the link should be maintained between the points file and the original database. In this case only the CAMPID field is imported into the associated points database (T.DBF) and the connection with the original database is established automatically in the REL. It is essential to indicate which is the CAMPID field (whether physical or the result of a SQL query). If this parameter is not set then all the fields or views in the original table or all the fields in the SQL query are imported into the associated points database (T.DBF). (Input parameter) /NO_ESTRUCTURAR
(Not necessary to check the points overlap)
Indicates that it is not necessary to check if two points are overlapped to generate the PNT file. If the user sets this parameter then /TOLERANCIA= can not be used. (Input parameter) /TOLERANCIA=
(Tolerance value between points)
Value of the distance between two points below which the points will be merged into a single point. If not set the tolerance is assumed to be 0. (Input parameter) /GMS
(Coordinates conversion)
For DBF and ODBC inputs, if the projection is LAT/LONG and the coordinates are in Dº M' S" format, then this parameter should be set to ensure that the conversion is carried out correctly. If the coordinates are in decimal degrees then there is no need to set this parameter. The coordinates should be given with spaces between Dº M' and S" (ie. [15º 3' 12"], but not with other punctuation marks[15º,3',12"]); it is also permissible that only degrees and minutes are given. (Input parameter) /PROJECCIO=
(Data spatial reference system)
In the cases of DBF and ODBC the spatial reference system of the data should be set in order to correctly document the metadata file. If it is not set the default value from the MiraMon.par file is used. For POL files, the spatial reference system will be the same as the input polygon file. To change the spatial reference system use CanviPrj. (Input parameter) /DEBUG
(Debug)
MiraMon internal information. (Input parameter) /CONSULTA_LENTA
(ODBC connection)
Special option for results recovery through ODBC connection. Useful when ODBC problems are present only. It is slower! (Input parameter) /PUNTS
(WKT geometry points import)
When importing a WKT geometry field, if this modifier is specified, the points from that field will be imported. If /PUNTS, /ARCS, or /POLS are not specified, all object types supported by MiraMon that are found in the WKT geometry will be imported. (Input parameter) /CAMPWKT=
(WKT geometry field)
The field containing the WKT geometry (physical field or the result of a SQL query). (Input parameter) /ARCS
(WKT geometry arc import)
When importing a WKT geometry field, if this modifier is specified, the arcs from that field will be imported. If /PUNTS, /ARCS, or /POLS are not specified, all object types supported by MiraMon that are found in the WKT geometry will be imported. (Input parameter) /CAMPZ=
(Z field)
The field containing the Z coordinate (physical field or the result of a SQL query). When importing a WKT geometries field, you can choose either to specify a field for the Z coordinate (/CAMP=...) or to import the Z coordinates from the WKT geometries by specifying only the modifier (/CAMP). (Input parameter) /POLS
(WKT geometry polygons import)
When importing a WKT geometry field, if this modifier is specified, the polygons from that field will be imported. If /PUNTS, /ARCS, or /POLS are not specified, all object types supported by MiraMon that are found in the WKT geometry will be imported. (Input parameter)
NOTES:
For DBF files:
The field names CAMPX, CAMPY, CAMPID must follow the DBF specifications.
+ Valid characters are: upper case letters [A-Z], figures [0-9] and the character '_', but not in the initial position.
+ Blank spaces are not permitted.
+ The maximum number of characters is 10.
For databases accessed via ODBC:
+ If the CAMPX, CAMPY, CAMPID field names do not satisfy the dBase standards they are modified and the original name is left as a field descriptor in the REL.
+ In cases using a SQL sentence, it is possible to use aliases for the fields.
For example:
/CAMPX=X
/CAMPY=Y
/SQL="SELECT Coordenada_X as X, Coordenada_Y as Y, IdentificadorEntitat AS IDE FROM DataFile.txt"
