Skip to main content

Upload Locations

Welcome to the user guide for the Upload Locations page! This page allows you to easily add new locations to the system using a simple JSON file.


Overview

The Upload Locations page helps you manage counties, municipalities, BliksundWeb places, and locations in a structured way. You can upload a JSON file, preview the changes, and save it to add any missing locations to the database.


Access rights

The new access right was introduced to manage the new feature:

Access RightsDetails
AllLocationAdminRequired to allow access to the Upload Locations component.

Page Features

  • Upload Button

    Click the "Upload" button to select and upload a JSON file from your computer. The changes will be presented in the Preview area.

  • Apply Changes Button

    After reviewing the changes, click "Apply Changes" to validate the content and start the insertion. Only new locations will be added—existing entries will not be changed or removed.

  • Reset Button

    Clicking the Reset button clears all page content, allowing you to start a new upload process.

  • Validation

    The page validates the input file to ensure it is a valid JSON file with the correct location structure.


How to Use

  1. Prepare Your JSON File
    • The file should contain a list of counties, each with its municipalities, BliksundWeb places, and locations.
    • See the example below for the correct format.
  2. Upload the File
    • Click the "Upload" button.
    • Select your JSON file.
    • The content will appear in the editor for you to review.
  3. Review or Edit
    • Make any changes directly in the editor if needed.
  4. Save
    • Click "Save" to validate and save the data.
    • The system will only add new entries; it will not update or delete anything already in the database.

Understanding the JSON Structure

The JSON file is organized in four levels:

  1. County
    • Top-level object.
    • Has a Value property (the county name).
    • Contains a Children array of municipalities.
  2. Municipality
    • Each item in the county's Children array.
    • Has a Value property (the municipality name).
    • Contains a Children array of BliksundWeb places.
  3. BliksundWeb Place
    • Each item in the municipality's Children array.
    • Has a Value property (the place name).
    • Contains a Locations array of locations (or, if missing, a default location will be created).
  4. Location
    • Each item in the Locations array.
    • Every location must have a Name property (the location name).
    • Optionally, a location can also have a Place object with extended information.
    • Example:
      • Simple: { "Name": "Location1" }
      • Detailed: { "Name": "Location2", "Place": { ... } }

Place Object (Extended Location Information)

If you want to provide more details for a location, use the Place property. The Place object can include:

  • Address: The street address of the location.
  • PostalCode: The postal code.
  • City: The city name.
  • Coordinate: The geographic coordinates (see below).
  • Description: A description of the place.
  • Department: The department associated with the place.

Coordinate Object

The Coordinate property inside Place lets you specify the latitude and longitude:

  • Latitude: The latitude value (number).
  • Longitude: The longitude value (number).

Examples:

Simple location:

{
"Name": "Location1"
}

Location with extended place information:

{
"Name": "Location2",
"Place": {
"Address": "Example Street 1",
"PostalCode": "1234",
"City": "Oslo",
"Coordinate": {
"Latitude": 59.9111,
"Longitude": 10.7528
},
"Description": "Main office",
"Department": "Administration"
}
}

Full structure example:

[
{
"Value": "Oslo",
"Children": [
{
"Value": "Oslo Kommune",
"Children": [
{
"Value": "BliksundWebPlace1",
"Locations": [
{ "Name": "Location1" },
{
"Name": "Location2",
"Place": {
"Address": "Example Street 1",
"PostalCode": "1234",
"City": "Oslo",
"Coordinate": {
"Latitude": 59.9111,
"Longitude": 10.7528
},
"Description": "Main office",
"Department": "Administration"
}
}
]
}
]
}
]
}
]
  • You can add as many counties, municipalities, places, and locations as needed.
  • If a municipality or place does not have any children or locations, a default "Annet" (Other) entry will be created automatically.

Notes

  • Only missing locations will be added. Existing data will not be changed or removed.
  • If you upload a file with locations that already exist, those entries will be ignored.

Screenshots

The new menu item