Translations of this page:

How to Import Data into My Database

Click2Map's My Database feature allows you to create and manage your own database: you can create all the categories you need and populate them with as many data fields as you need. For more information on this subject, please see: How to Create Data Categories and Data Fields.

Object of this Tutorial

In this tutorial, we'll create a new map and import a list of homes for sale in the San Diego area with their description. We'll add specific information on their surface area, their number of bedroom, their selling price, the presence of a swimming pool, a comment, the name of a contact person and their phone number. We'll use a marker template to automatically include all this information in each marker's information window.

Step 1: Creating Data Categories and Data Fields

Please follow the tutorial How to Create Data Categories and Data Fields to create:

  • A data category named “RealEstate” that will be used to store all the information about each home: surface area, number of bedrooms, selling price, presence of a swimming pool and our general comments.
  • A data category named “Contact” that will be used to store a contact name and their phone number.

Step 2: Creating a Marker Template Including Data Fields

  1. Use the Tools > Template Set command from Click2Map's main menu to open the Template Set dialog box.
  2. Entering the template nameClick on the Add… button to open the New Template dialog box.
  3. Enter the following information:
    • Template Name: Enter here the name of you new template, for example “Real Estate”.
    • Check the Display marker address option.
    • Click on the Change marker icon button and select, for example, icon number 10 in the Google Earth collection #1.
  4. Additional PropertiesClick on the Additional Properties tab and enter the following information (see: The Template dialog box for more information):
    • URL Address: “www.click2map.com” or the proper web address.
    • Link Text: “Click2Map Website” or the internet hyperlink text you wish to use.
    • E-mail: “contact@click2map.com” or the e-mail address you wish to publish.
    • Link Text: “Contact Us” or any text you wish to use as a hyperlink for the e-mail address.
    • Tags: “California, Real Estate, Click2Map” or the desired tags or keywords, separated by commas.
  5. Extra TabsClick on the Extra Tabs tab.
  6. In the New Tab list, click on the Text button to add an additional text tab then enter the following information:
    • Caption: “Characteristics” or “Info”
    • Content: enter the following text:
    Sqft: #RealEstate.Sqft
    Rooms: #RealEstate.Rooms
    Swimming Pool: #RealEstate.SwimmingPool
    Price: USD #RealEstate.Price
    Comments: #RealEstate.Comments
    Contact: #Contact.Name (phone #Contact.Phone)

Click on the OK button to save the marker template.

Please note how the data fields defined at the beginning of this tutorial have been inserted in the “Info” tab: each data field is in fact a variable composed of the name of the data category it belongs to and the name of the data field itself, separated by a dot. Custom variables always start with a # sign when internal Click2Map variables start with a $ sign (see: Click2Map Variables).

Variables can be used in almost all text fields and Html areas of markers and marker templates.

Important: When using variables, the name of data categories and of data fields must be entered exactly how they were written when you created them. Data categories, data fields and the corresponding variable names are case sensitive.

Step 3: Preparing the Import File

Click2Map's import functionalities not only allow you to import markers (see: How to Import Markers), but also to import data into your database. It is also possible to associate a specific marker template with each marker during the import process.

We'll prepare here a CSV import file that will contain the following columns:

  • Main Information:
    • Name
    • Title
    • Address
    • Description
    • Group
  • Additional Data (My Database):
    • RealEstate.Sqft
    • RealEstate.Rooms
    • RealEstate.SwimmingPool
    • RealEstate.Price
    • RealEstate.Comments
    • Contact.Name
    • Contact.Phone
  • Marker Template Designation:
    • Template

Note: Each “My Database” field is in fact a variable composed of the name of the data category it belongs to and the name of the data field itself, separated by a dot.

Our import file thus contains 13 columns: the first line of the CSV file must contain the name of each column while the subsequent lines contain the actual data corresponding to each marker.

For easier editing of the import file, you can prepare it with a spreadsheet application such as MS Excel, OpenOffice or Google SpreadSheet. When you're done editing your data, simply save a copy of the file in CSV format (remember which separator you select). To download the sample file used in this tutorial, please click here: http://wiki.click2map.com/files/California_Real_Estate_DB.csv (separator: semi-colon)

Step 4: Creating a Map, Importing Markers and Publishing the Map

  1. New MapUse the New > Map command from Click2Map's main menu to open the Map dialog box and enter the following information:
    • Name or ID (internal Click2Map ID): “California Real Estate”.
    • Title (title visible on the the generated map): “California Real Estate”.
    • Map Center Address: “San Diego”.
  2. Click on the Geocode button to center the map on the San Diego area.
  3. Adjust the zoom level using the Zoom Level horizontal slider.
  4. Use the Tools > Import command from Click2Map's main menu and follow the instructions provided by the import wizard.
  5. The Publish dialog boxUse the Publish > As a Web Page command from Click2Map's main menu to open the Publish Map dialog box.
  6. Change the options and parameters as needed and click on the OK button to publish the map.
  7. Copy the provided URL address into your web browser's address bar to visualize the published map.
 
how_to_import_data_into_my_database.txt · Last modified: 2008/03/11 03:11 by admin
 
Recent changes RSS feed