by David Crowther
How do I resolve the error message - ‘The Export Has Failed’ – when using the Export to GIS tool in MapThat?
MapThat has the ability (Role and Layer dependent) to export your Layers into a Flat GIS Format e.g. SHP, TAB, DXF, KML, GeoJSON. Simply load the MapThat Layer and in the Data Table choose the Export to GIS button.
However the export may fail if the MapThat Server has not been correctly configured.
Please check these points:
1 – In the MapThat Page Settings (VE_WEB_CONFIG) ensure that the OGR2OGR_PATH is pointing to a valid installation of OSGEOW and point to the Ogr2Ogr folder.
OSGEOW (Ogr2Ogr) is used to run the spatial export from the MapThat Spatial Database to create the Flat GIS File.
2 – Check that the Export.BAT file and its folder are not ReadOnly.
The MapThat > Export to GIS > will edit the Export.BAT file stored in the /BATCHFILES/ folder of your MapThat Instance. The Export.BAT file is updated each time a user does an Export with the new sport details e.g. the MapThat Layer Name and the export file name and GIS File Format.
Ensure that the folder and the file itself are not ticked as Read Only.
Also you may need to ensure in the Security Settings that the MapThat User Profile is Allowed Access to Modify, Write to this File/Folder.
3 – When the Export is ran it will save the resultant GIS File in the MapThat /SpatialExport/ Folder. So again, make sure that the /SpatialExport/ folder is not ticked as ReadOnly and that Users can write into this folder.
4 – Finally, if the Spatial Data is in another Map Projection e.g. 4326, Ogr2Ogr will need to be able to access a Coordinate Projections file which is stored in the OSGEOW folder. If Ogr2Ogr cannot access this file it will fail when the Spatial Export runs. For example if we look in the MapThat Error Log table, a common error message for Failed GIS Exports will be:
Og2Ogr needs access to the GCS.CSV file stored in the SHARE/GDAL/ folder in your OSGEOW install.
The error message in MapThat is stating that Ogr2Ogr cant access the GCS.CSV file, so the export fails. To resolve this you simply need to create a SYSTEM VARIABLE pointing to this folder.
On the MapThat Application Server go into the Computer > Advanced Settings and choose Environment Variables.
And ADD a SYSTEM VARIABLE called GDAL_DATA pointing to your Instance of OSGEOW and in particular the SHARE/GDAL folder. In the example below we are actually referencing the Instance of PostgreSQL ……
….which also has a folder containing the required GCS.CSV file.
Alternately, point your new System Variable to the /SHARE/GDAL/ folder of your OSGEOW install.
For this new Environment (System) Variable to take affect you will need to RESTART the Server!
Now when a User chooses the Export to GIS tool in MapThat the Layer will successfully be exported to the chosen file format.