OBIS: Edit Geodata

From ILMS-Wiki
Revision as of 09:58, 5 March 2013 by Anita (Talk | contribs)
Jump to: navigation, search

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

Import of shape data or images

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. 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".

RBIS Geodata New Import Shape.png

The data were sent to JanusWeb and listed after transferred successfully.

OBIS Geodata New Import Shape2.png

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.

OBIS Geodata DeterminingSRID.png

OBIS Geodata New Import Shape3.png

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

OBIS Geodata New Import Shape4.png

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.

OBIS Geodata New Import Shape5.png

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 the import has to be carried out as described, bun then imported data is added to an existing table. For this purpose you need to give an allocation of the already existing data. If you select a already existing table, a new pull down menu opens and you get the possibility to add, rewrite or update data.

OBIS Geodata New Import Shape6.png

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 atble 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.

OBIS Geodata New Import Shape7.png

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 teh 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.

OBIS CSV import.png

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.

OBIS CSV import2.png

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".

OBIS Geodata View Data.png

Download data

Generate a new 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.

OBIS Geodata New Map.png

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.

OBIS Geodata New Map Projection.png

Add data as layer to an existing map

[Back to tutorial main page]

Personal tools