=== modified file 'src/docbkx/en/dhis2_user_man_creating_gis.xml' --- src/docbkx/en/dhis2_user_man_creating_gis.xml 2011-06-24 06:20:05 +0000 +++ src/docbkx/en/dhis2_user_man_creating_gis.xml 2011-06-27 09:20:19 +0000 @@ -24,25 +24,20 @@ Step 3 - Prepare the GML file - Unfortunately, the GML file is not likely to be ready for importation yet. Open it in a robust text editor like Geany (Linux) or Notepad++ (Windows). The DHIS 2 importer will look for a property called "ogr:Name" in this file when it matches the GML file to the organisation units in the database. Figure out what property that is holding the name of the organisation unit (could be "ogr:DISTRICT_NAME" or whatever, this differs from shapefile to shapefile) and rename it to "ogr:Name". Ensure that both the start tag and the end tag is renamed properly, they are supposed to look like this: <ogr:Name>Moyamba District</ogr:Name> - - - Note that the name of the organisation units in the GML file must be spelled exactly the same as the organisation units in the database. Otherwise the importer will not recognize it and thus not transfer any coordinates. E.g. "Moyamba" in the GML file migth be called "Moyamba District" in the database. Creative use of the "rename all" function in the text editor is usually of great help in these situations. - - - Now, go to Services -> Import-Export, upload the file, select "Preview" and click "Import". Look for new/updated organisation units. If the intention is to add coordinates to already existing organisation units in the database, you want as many as updates as possible and 0 new. Those listed as new will be created as root units and mess up the organisation unit trees in DHIS 2. In the GML file, remove the organisation units that were listed as new and run preview again. When there are 0 new, switch the import type from "Preview" to "Import" and click the "Import" button. If it completes successfully, skip step 4. - - - Step 4 - Fix possible error causes - - Common error causes are: - - Name duplicates in the GML file. The name column in the database is unique and does not accept two organisation units with the same name. - - The "shortname" database column has a too small varchar definition. Increase it to 100. - - Special name characters in the GML file. Rename or remove. - - - Finally, retry the GML file importation. - + Unfortunately, the GML file is not ready for importation yet. Open it in a robust text editor like Geany (Linux) or Notepad++ (Windows). GML is an XML based format which means that you will recognize the regular XML tag hierarchy. In the GML file an organisation unit is represented as a <gml:featureMember>. Inside the feature members we usually find a lot of attributes, but we are just going to import their coordinates. In order to do this DHIS 2 will match the name of the feature members to the organisation unit names in the database. To get the name of the feature memebers in the GML file the importer will look for a property called "ogr:Name". Figure out what property that is holding the name of the feature members (could be "ogr:DISTRICT_NAME", "ogr:NAME_1" or whatever, this differs from shapefile to shapefile) and rename it to "ogr:Name". Ensure that both the start and the end tags are renamed properly. They are supposed to look like e.g.: <ogr:Name>Moyamba District</ogr:Name> + + + Note that the name of the feature members in the GML file must be spelled exactly the same as the organisation units in the database. Otherwise the importer will not recognize it and thus not transfer any coordinates. E.g. "Moyamba" in the GML file migth be called "Moyamba District" in the database. Creative use of the "rename all" function in the text editor is usually of great help in these situations, as you do not want to edit numerous feature members manually. Have a brief look at the names and compare them to the names in the database. If they seem to match fairly good, it is about time to do a preview in the import-export module. + + + Go to Services -> Import-Export, select "Preview", select the GML file and click "Import". Look for new/updated organisation units. Our intention is to add coordinates to already existing organisation units in the database, so we want as many updates as possible and 0 new. Those listed as new will be created as root units and mess up the organisation unit trees in DHIS 2. If any listed as new, click the number and the organisation units in question will appear in the list below. If there are any slight misspellings compared to the organisation unit names in the database - fix them and do the preview again. Otherwise, click the "discard all" button below the list and then the "Import all" button above the list. + + + If the import process completes successfully, you are good to go. If not, check the log for hints and look for common errors such as: + + - Name duplicates in the GML file. The name column in the database is unique and does not accept two organisation units with the same name. + - The "shortname" column in the organisationunit table in your database has a too small varchar definition. Increase it to 100. + - Special name characters in the GML file. Rename or remove.
Administering the GIS module