OBIS: Edit Geodata
(→Generate a new map) |
(→Generate a new map) |
||
Line 103: | Line 103: | ||
− | [[File:OBIS_Tree_diagram.png| | + | [[File:OBIS_Tree_diagram.png|300px|options|]] |
You can generate a new map by clicking on the respective button. Here you can give a title to the map, define the projection and select layers. Further you can define the extent, size, status on or off, transparency and units. You also have to set a cachetime. | You can generate a new map by clicking on the respective button. Here you can give a title to the map, define the projection and select layers. Further you can define the extent, size, status on or off, transparency and units. You also have to set a cachetime. |
Revision as of 12:36, 6 March 2013
For the import of geodata you will be automatically redirected to the JanusWeb. Click "New Import" in the menu on the left side and the following screen appears. If you cannot access this site please make sure that you are logged in and that you have required rights for the import of data.
Contents |
Geodata import
For data import you have to select the format of the geodata with the help of the pull down menu. The formats ESRI Shape file, TIFF and GeoTIFF, CSV and Dbf (dBase format) can be imported. The import process cannot be executed if you try to upload an unidentified format.
Import of shape data or images
You have two possibilities to upload data:
- You need to give the path to each single file. E.g. if you want to import a shape file you need to select the shape file (shp), dbase file (dbf), index file (shx) and optionally the projection file (prj). Because of safety measures filling fields automatically is not allowed.
- Tick the box if you want to upload data from the archive. The archive already contains all associated data. The following archives are supported:
- Zip archives with the extension .zip
- Tape archives with the extension .rar
- Compressed tape archives with the extension .tgz or .tar.gz
Enter the path of the archive or of the single shape files in the corresponding entry fields. The button "search" opens a helpful browser. Then click on the button "import".
The data were sent to JanusWeb and listed after transferred successfully.
For a correct illustration or conversion of the vector data information about the projection need to be given in Spatial Reference Identifier (SRID) form. For shape files such a SRID is either generated automatically from a provided projection file (.prj) - if this file is provided- or needs to be selected from a list. You get a detailed description of the selected SRID when you click on "information". You can enter the projection ID in the menu "determining SRID" with the help of the pull down menu.
The next step is to import data into an import table. This temporal table contains the geometries and attributes of the shape file. On the next page you will get informed about the steps carried out and corresponding results. For bigger datasets it may take a time until the results are shown as the output will be generated after data have been imported. In a next step you need to decide either if you want to create a new table, overwrtite an existing table or attach data to an existing table. If you want to create a new table select the first item of the pull down menu and enter the name of the table into the entry field. In case that a table with this name already exists, an error message appears. If you select an already existing table, another pull down menu opens. In this menu you can determine whether data shall be attached to the table or shall be substituted. If you overwrite an existing table, the existing table from the database and the entry from the PostGIS management table will be deleted. Afterwards the procedure is the same as for a new table. In case you want to add data to an existing table two new columns were added to the existing attributes. The attribute "gid" is a new artificial primary key, which is used to identify objects within the system. The attribute "the_geom" contains the geometry of the object. For a correct application both columns need to be taken over as a geometric table.
Create new table
Next to the attribute columns, geometric data as the column "the_geom" and an object_ID are added. In the entry field "where statement" you can determine a statement, which must be set up in the SQL-syntax without a leading WHERE-key word. Consequently, the import is restricted to the data that fullfill this condition.
If all information are given, the following steps can be accomplished:
- creating a new table
- copying data from the import table to the target table
- updating PostGIS information
- entering authorizations for the target table
- setting up a spatial index for the target table
Use existing table
In case you want to add data to an existing table the import has to be carried out as described, but then imported data were added to an existing table. For this purpose you need to give an allocation of the already existing data. If you select an already existing table, a new pull down menu opens and you get the possibility to add, rewrite or update data.
Adding data means to add rows to existing tables, new columns cannot be added. Contrary the function rewrite overwrites the existing data rows by deleting the old table and setting up a new one. You have to allocate existing columns to the just imported columns. First, select a column of the target table by clicking on the column name. Then, you either select a column from the source table or use the button "enter value" in order to enter a constant into this column. This procedure can be used to combine several datasets, which have been seperated so far, in one table and later classify them on the basis of this column. Another possibility is the automatic allocation of same column names. Click on the button "same names" to generate an automatic allocation, which is displayed on the right side. All allocations are displayed on the right side and can be deleted when you click on the "clear" button. The form assures that each column of the target table occurs only once in the allocations. Note that the gid column is not taken over when you add data. This column is set up as a number in the table and is filled automatically by the database. When you add data, gid always starts with "a"; otherwise, there would be a double primary key.
Bulk import
Via mass import of shape files you can import archives, which contain several shape files. For this pupose, you do not need to give each single shx, dbf and shp file. Enter the path of the archive in the import menu. Then OBIS/ JanusWeb lists all data contained in the archive. You do not need to take over all shape files of the archive. In fact, it is possible to select shape files in the section "data and parameter settings". You need to enter the SRID for each shape file you wish to import. If the SRID is missing, OBIS sets the value to -1, i.e. unknown. Important: SRIDs cannot be changed at a later stage, which is why you need to enter the correct SRID right from the beginning. To name the tables there is an option available to assign a prefix. This prefix is put in front of the table names automatically. Unlike the import of csv or dbase table data you cannot overwrite existing tables. If a table with the same name exists, the import will be cancelled. If necessary, you need to delete the existing table beforehand in order to import a new table of the same name. To finish the import click "next".
Import of CSV files
Apart from vector data and raster data you can also import table data in form of dbase and CSV files. As an example, the import of CSV files is important for the integration of GPS data in the database. Select the CSV format in the pull down menu. You can import a single file or an archive. Variables in CSV files are separated by punctuation, e.g. semicolon or comma - the same separator has to be used within the entire file. If the seperator is part of a data element, it needs to be written in quotes. OBIS/ JanusWeb has to be informed about the type of separators and quotation marks used for the imported file. For this purpose please use the section "data and parameter settings". Apart from separators and quotation marks you need to give the row number for the beginning of the data block and (optionally) the row number for the data type and the column name.
The first row of CSV files contains the column names. Consequentlly, RBIS/JanusWeb takes the columnn name of the file’s first row by default and assigns it to the header of the new table. However, if you wish to change anything here, you can use the fields row number for column name. In any case, the first row of your CSV file is not assigned to your table as data entry. If the file that has to be imported does not show columnn names but data in the first row, you should enter columnn names with the help of the editor before you start the import. Otherwise, these data would not be assigned in the data table by OBIS/JannusWeb. The fields from top to bottom, which can be found under column name, refer to the columns from left to right in the source file, i.e. the left column can be found in first place, the outermmost right column can be found in last place. Note: Column names have to consist of at least three signs, otherwise no import will be carried out. You need to declare the column name as well as the data type. For this purpose, PostgreSQL specification of data types is used. The data type needs to be entered manually. Furthermore, in the matrix you can specify whether the corresponding column contains northings or eastings. If the CSV file does not only contain attributes but also information about the geometry, you need to give the type of geometry (POINT, LINE or LINETONEXT) and SRID.
The uploaded data will be saved in a temporal table by OBIS/ JanusWeb. There you can see whether errors have occurred when the SQL table has been generated, e.g. because of missing information about the data type or because you have entered not enough signs for the column name. If an error occurs, the import process will be cancelled.
OBIS/JanusWeb generates a new data table by means of PostgreSQL. Data from the temporal table will be inserted in the new table. You can also attach data from the imported file to an existing table or overwrite data. When you create a new table you will be led to the source table. If you wish to attach or enter new data, you will be taken to the section "transfer tabular data into new table". Here you can enter data from an imported file into an already existing table. The column names and the data types of the existing table (here: target table) as well as the imported, temporal table (here: source table) are listed. If you chose "same names", data from columns of the same name are overwritten automatically. Columns with different names can be allocated manually. For this purpose, select a column of the target table by clicking on it and then click on the column of the source table. See also transfer tabular data into new table. When you click "submit", the import has been finalized and you are led to the section "transfer data to table" where you can view the set up allocations. Data from the temporal table is copied into a database table. Before this table is fianlly integrated in the database you can correct the information about the data types and select the columns you wish to take over.
Here you can correct data types under the headline "column type" and tick the checkboxes for the columns of the source table that shall be taken over to the target table. Complete the import process by clicking "take over". Finally, the importer will be set up as the owner of the table. The button "next dataset" is only relevant for bulk imports.
Import of dbase data
Select the format dbase in the pull down menu. Attributes in dbf format can be imported individually or as an archive. After clicking on the button "import" the files were uploaded to the server. Then imported data were displayed on the screen. In the next steps you need to create a new table or make use of an existing table.
Menu of features
For getting an overview of the geodata click on the subitem "view data" of the menu item "edit data".
In the pull down menu on the top of the table you can also switch to other data types, e.g. raster data. The first columns gives metadata information such like title of dataset, type and ESPG code. Vector data were distinguished according POINT, LINESTRING or POLYGON geometries. Additionally, all of these versions are available with the prefix MULTI. In the second column you get a preview of the shapefile. In the third column you find four features: "preview" displays a preview of the shapefile in a new window, "download" to export data, "generate new map from this data" and "add data as layer to an existing map".
Download data
Generate a new map
OBIS/JanusWeb uses UMN MapServer to display and create maps. MapServer is an Open Source platform for publishing spatial data and interactive mapping applications to the web. OBIS/JanusWeb creates a mapfile to each map.
You can generate a new map by clicking on the respective button. Here you can give a title to the map, define the projection and select layers. Further you can define the extent, size, status on or off, transparency and units. You also have to set a cachetime.
You need to enter the EPSG number and save the settings. The EPSG Geodetic Parameter Dataset is a structured dataset of Coordinate Reference Systems and Coordinate Transformations, accessible through this data registry.