capetown

package module
v0.1.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 19, 2026 License: MIT Imports: 2 Imported by: 0

README

capetown-opendata

Go Reference Go

Named layer IDs and pre-built queries for the City of Cape Town Open Data Portal, on top of go-arcgis.

import (
    arcgis "github.com/richardwooding/go-arcgis"
    capetown "github.com/richardwooding/capetown-opendata"
)

client := arcgis.NewClient(capetown.BaseURL)

// Pre-built, optionally refined
features, err := client.Layer(capetown.LayerLoadSheddingBlocks).Query().
    From(capetown.LoadSheddingBlocksForStage(4)).
    WithinEnvelope(18.4, -34.0, 18.6, -33.8).
    All(ctx)

Install

go get github.com/richardwooding/capetown-opendata

Requires Go 1.26+. Depends only on go-arcgis.

What's here

  • BaseURL — the CCT Open Data Feature Service endpoint.
  • Named layer constants (LayerLoadSheddingBlocks, LayerWards, LayerLandParcels, LayerTaxiRoutes, LayerWaterQuality, …).
  • Pre-built arcgis.QueryParams constructors with sensible default fields and ordering: LoadSheddingBlocks, LoadSheddingBlocksForStage, ServiceRequests, ServiceRequestsBySuburb, Wards, LandParcels, TaxiRoutes, WaterQualityResults.

Each constructor returns a plain arcgis.QueryParams, so you can run it directly or refine it through the go-arcgis fluent builder via .From(...).

A note on layer IDs

The layer IDs here are best-effort and may drift as the upstream service is republished. Confirm them against the live service with Client.ServiceInfo if accuracy matters:

info, _ := arcgis.NewClient(capetown.BaseURL).ServiceInfo(ctx)
for _, l := range info.Layers {
    fmt.Println(l.ID, l.Name)
}

Changelog

See CHANGELOG.md.

License

MIT

Documentation

Overview

Package capetown provides named layer IDs and pre-built QueryParams for the City of Cape Town Open Data Portal.

Base URL: https://citymaps.capetown.gov.za/agsext/rest/services/Theme_Based/Open_Data_Service/FeatureServer

The layer IDs below are best-effort and may drift as the upstream service is republished. Use a github.com/richardwooding/go-arcgis.Client with ServiceInfo to confirm them against the live service.

Index

Constants

View Source
const (
	LayerLoadSheddingBlocks = 138
	LayerServiceRequests    = 1 // placeholder — verify against live service
	LayerWards              = 78
	LayerLandParcels        = 56
	LayerTaxiRoutes         = 97
	LayerPublicLighting     = 3
	LayerWaterQuality       = 223
	LayerHeritageInventory  = 49
)

Layer IDs for well-known CCT datasets.

View Source
const BaseURL = "https://citymaps.capetown.gov.za/agsext/rest/services/Theme_Based/Open_Data_Service/FeatureServer"

BaseURL is the City of Cape Town Open Data Feature Service endpoint.

Variables

This section is empty.

Functions

func LandParcels

func LandParcels() arcgis.QueryParams

LandParcels returns cadastral land parcel polygons.

func LoadSheddingBlocks

func LoadSheddingBlocks() arcgis.QueryParams

LoadSheddingBlocks returns all load shedding zone polygons.

func LoadSheddingBlocksForStage

func LoadSheddingBlocksForStage(stage int) arcgis.QueryParams

LoadSheddingBlocksForStage returns zones for a specific load shedding stage (1–8).

func ServiceRequests

func ServiceRequests() arcgis.QueryParams

ServiceRequests returns open service requests, most recent first.

func ServiceRequestsBySuburb

func ServiceRequestsBySuburb(suburb string) arcgis.QueryParams

ServiceRequestsBySuburb filters service requests by suburb name.

func TaxiRoutes

func TaxiRoutes() arcgis.QueryParams

TaxiRoutes returns all registered taxi routes.

func Wards

func Wards() arcgis.QueryParams

Wards returns all municipal ward boundaries.

func WaterQualityResults

func WaterQualityResults() arcgis.QueryParams

WaterQualityResults returns inland water quality measurements, most recent first.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL