Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

AreaMapper is a tool which can help you prepare your business data for use in the CleverMaps platform. AreaMapper computes geometric intersection between points and polygons (areas) and then adds ID's of polygons to the points table if an intersection exists. Example scenario could be mapping points of your customers to administrative units. Then you can calculate metrics of your customers in context of city districts, cities, counties and so on (e.g. count of customers in each city).

You can map points to your own area data (e.g. delivery zones) or you can use already prepared prepared data dimension from  from us (e.g. administrative units). Both points and areas need to have the same coordinate system (e.g. WGS84).

...

AreaMapper is distributed as a Docker image so you need to have Docker platform installed. You can get Docker Docker here

AreaMapper is publicly available on Docker hub: https://hub.docker.com/r/clevermaps/areamapper 

...

There are few steps you need to do before running AreaMapper:

  • Create an empty directory on your local drive (e.g. /home/user/clevermaps/areamapper).

  • Copy your CSV file with points you would like to map into the folder. Optionally copy also your CSV file with areas.

  • Create a configuration file for AreaMapper and save it as a JSON file into the folder. Please check the examples below in Configuration to get the idea how the configuration file should look.

Use following command to run AreaMapper:

...

Code Block
{
    "input_points": {
        "filename": "/workdir/your_file_with_points.csv",
        "delimiter": ",",
        "geom_fieldname_x": "x",
        "geom_fieldname_y": "y",
        "join_fieldname": ""
    },
    "input_areas": {
        "filetype": "csv",
        "filename": "/workdir/your_file_with_areas.csv",
        "geom_fieldname": "wkt",
        "primary_key_fieldname": "id",
        "delimiter": ",",
        "join_fieldname": ""
    },
    "output": {
        "filename": "/workdir/your_output_file_name.csv",
        "delimiter": ",",
        "not_matched_value": "0"
    },
    "temp_directory": "/workdir"
}


Mapping to already prepared areas from us

In this case you only need one file - your points data. Areas are automatically and temporary downloaded from cloud storage.

...

input_areas.filename: In case of input_areas.filetype = 'csv' set full path to the file with area data. In other case input_areas.filetype = 'candim' set name of CleverMaps data dimension. Available dimensions are:

  • can-dim-zsjd-cz (Neighborhoods of Czech Republic).

  • can-dim-zsj-sk (Neighborhoods of Slovakia)

  • can-dim-zipcodes-us (Zipcode of United States)

  • can-dim-lau-eu (Local Administrative Units of European union)

  • can-dim-settlements-hu (Settlements administrative units of Hungary)

  • can-dim-obwod-pl (Obwod administrative units of Poland)

  • can-dim-grid-uber-9-cz (Hexagonal grid by Uber for Czech Republic)

  • can-dim-postcodes-cz (Postcodes of Czech Republic)

  • more information about data dimensions here Data dimension projects

input_areas.delimiter: Delimiter used in CSV file. Set only in case of input_areas.filetype = 'csv'.

...