XLSX / CSV import

MapHub supports importing data from CSV or XLSX files. We recommend using the XLSX format.

When uploading a table file, MapHub tries to guess the right file format and locate the geometry data for your items.

Specifying Item Geometry

If you only have street addresses, without lat-lon coordinate pairs

If your data only contains street addresses and you need point locations, follow the tutorial which explains how to convert street addresses to lat-lon coordinate pairs: Converting addresses to lat-lon coordinates

If you have lat-lon coordinates / geometry

There are two ways to specify the location and shape of your map items:

1. Latitude and Longitude Columns (for Points)

This is the simplest method for point locations. The only requirement is to have the following 2 columns present:

  • lat or latitude: The latitude as a number (e.g., New York is 40.71).
  • lon, long, lng or longitude: The longitude as a number (e.g., New York is -74.00).

2. GeoJSON Column (for Points, Polylines, and Polygons)

You can now provide geometry directly using inline GeoJSON format within your table. This allows for importing not just points, but also polylines and polygons.

  • Include a column named geojson.
  • The value in this column for each row should be a valid GeoJSON Geometry object string.
    • Example Point: {"type":"Point","coordinates":[-74.00,40.71]}
    • Example Polygon: {"type":"Polygon","coordinates":[[[100.0,0.0],[101.0,0.0],[101.0,1.0],[100.0,1.0],[100.0,0.0]]]}
    • Example LineString (Polyline): {"type":"LineString","coordinates":[[102.0,0.0],[103.0,1.0],[104.0,0.0],[105.0,1.0]]}

This GeoJSON feature provides powerful import capabilities, especially for users working with GIS applications or spatial databases that can export geometric data in this standard format. It allows importing of complex shapes.

Other Columns

These columns provide additional styling and information for your map items (all are optional):

  • title or name - the title of the item
  • description or desc - the description of the item, Markdown supported
  • group - the name of the item's group. To create multi-level groups please read the section below.
  • url - a link URL
  • color - hex code for the item's color, for example #CC1B15
  • visible - true/false - if the item is visible (true) or hidden (false). Also accepts 1/0.
  • media_url - a media URL, for example a YouTube video.
  • icon - a MapHub icon id (for points)
  • maphub_image_url - allows you to set an image for an item. You have to previously upload that image onto a map and export that map as a CSV or XLSX file to get these values.

Sample data

On the following map, you can click Download / Excel XLSX or CSV to get a sample file demonstrating import using Lat/Lon columns:

XLSX / CSV sample

Multi-level groups

You can create multi-level groups by using the following format in the group column.

North America/United States/California/Los Angeles

Note, you have to use exactly this character. Please copy and paste it. It is not the same as the normal / character.

Have a look at the following sample table: Multi-level group sample