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, review or edit its content, and save it to add any missing locations to the database.


Page Features

  • JSON Editor\nView and edit the locations data in a user-friendly JSON editor.

    [Insert screenshot of the JSON editor here]

  • Upload Button\nClick the "Upload" button to select and upload a JSON file from your computer. The content of the file will appear in the JSON editor.

    [Insert screenshot showing the upload process here]

  • Save Button\nAfter reviewing or editing the JSON, click "Save" to validate the content and start the insertion. Only new locations will be added—existing entries will not be changed or removed.

    [Insert screenshot of the Save button and confirmation here]


How to Use

  1. Prepare Your JSON File
    • The file should contain a list of counties, each with their 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

The file selected is not a JSON file

The file selected is empty or invalid structure

The file is uploaded successfully