Import/Export Attribute Set 14


Possibility to import/export an attribute set together with it’s values has been requested by number of users and now it’s possible with MapIt 3.2.2.

JSON structure has been chosen as the exchange format as in fact it’s a simple text file and can be edited using any text editor, however it’s allowing to keep things organised and well structured.

If you are unfamiliar with the JSON format, you can export existing attribute set to see how it looks like.

Export Attribute Set

Export Attribute Set

 

Below you can see basic Attribute Set JSON file ready to import by MapIt app:

Sample JSON file structure:

{
 "name": "Imported Attribute Set 5",
 "description": "This attribute set is imported from file...",
 "fields": [
 {
 "name": "Height",
 "order": 0,
 "values": [
 "0-5",
 "5-10",
 "10-15",
 ">20"
 ]
 },
 {
 "name": "Type",
 "order": 1,
 "values": [
 "1",
 "2",
 "3",
 "4"
 ]
 },
 {
 "name": "High Risk",
 "order": 2,
 "fieldType": "boolean",
 "defaultValue": "Yes"
 },
 {
 "name": "Need action",
 "order": 3,
 "fieldType": "boolean",
 "defaultValue": "No"
 },
 {
 "name": "Note",
 "order": 4,
 "fieldType": "text",
 "isTextBox": "yes",
 "defaultValue": "Good quality"
 },
 {
 "name": "Estimated Cost",
 "order": 5,
 "fieldType": "number",
 "isTextBox": "yes",
 "defaultValue": "250"
 }
 ]
}

Before you import the data into MapIt, it’s recommended to check the file structure using online JSON validator:

Validate JSON before import

Validate JSON before import

You can also analyse your Attribute set using the JSON renderer e.g. http://jsonviewer.stack.hu :

Attribute Set Structure - JSON viewer

Attribute Set Structure – JSON viewer

 

  1. To import Attribute Set just copy and paste your ready JSON files into your device memory MapIt->Import->Attributes Folder:
Import Attribute Set folder location

Import Attribute Set folder location

 

2. When you place your files in the proper folder please go to ‘Attributes Management’ and press the button ‘Import’ as shown on the picture below:

Import Attribute Set

Import Attribute Set

 

3. Select the file from the list of available json files and press ‘Import’ button in the bottom-right corner.

Import Attribute Set - List of files

Import Attribute Set – List of files

 

4. When the import is successful the new Attribute Set will be added to your collection and it can be used for new layers.

Imported Attribute Set

Imported Attribute Set

 

 


Leave a comment

Your email address will not be published. Required fields are marked *

14 thoughts on “Import/Export Attribute Set

  • steve

    I using a lot the import tool, specially with kml, I dont have problems with polygons, but when I want to import lines have problems. commonly I create or I have lines or tracks lines in google Earth (KML) and when I try to import to Map it just a part of these lines are imported, per example I have a Kml with 50 lines and just 2 lines were imported without problems….What is the problem?, how I can fix it?…is a bug?

  • steve

    Export Problems.
    until now Im using the NAD83 UTM, when I export to CVS the UTM coordinates are in the same column of the spreedsheet, and is very complicated separate it in individual columns to be worked as a spreedsheet. What is the problem?, how I can fix it?…is a bug?……with the lat long coordinates dont have problems, are perfect, but the UTM are more used and could be good idea fix this issue in the CVS export to be easy the manipulation of the data in excel or any GIS software….

        • osedok Post author

          Hi Steve, I am sorry I have missed that. Can you please email me directly at mapitgis@gmail.com. I would appreciate if you can share your data or even subtract of the line data (kml format) you have problems with and I will be happy to investigate it.

          Regards,
          Andrzej

  • Inge Buecker

    The sample attribute set json file above is no more working. The variable “order” is missing. After adding “order” per field I were able to import the file. Order is used to define the sequence of the fields.

  • Inge Bücker

    Hi Andrzej,
    thanks for fast response on my “order” comment. MapIt is really great and easy to use.
    I have another question. Is it poossible to set the encoding for a to be imported attribute set json file?
    I would like to import values with German “Umlaute” like “ü” in Inge Bücker. When I import it now an unknown character is shown instead the “ü”. If I edit the attribute set directly on my mobile an “ü” is working.
    Thanks, Inge

    • osedok Post author

      Hi Inge, I have tested the Attributes Import from json file containing German special characters, as long as you encode your file in UTF-8 all the values are being imported properly.
      If you are editing the file using e.g. Notepad++ there is a tab Encoding. Please use it to encode your file properly before importing into MapIt.

      • Inge Bücker

        Hi Andrzej,
        super, your recommendation solved the encoding issue. When I save my attributes set file with UTF-8 encoding all „Umlaute“ are shown fine in MapIt after import. Many thanks!
        Inge