PHPackages                             elliotsawyer/nzstreets - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Database &amp; ORM](/categories/database)
4. /
5. elliotsawyer/nzstreets

ActiveSilverstripe-vendormodule[Database &amp; ORM](/categories/database)

elliotsawyer/nzstreets
======================

Database of New Zealand street addresses using LINZ address data

1.0.0(6y ago)1161[2 issues](https://github.com/elliot-sawyer/silverstripe-nzstreets/issues)BSD-3-ClausePHP

Since Nov 10Pushed 11mo ago2 watchersCompare

[ Source](https://github.com/elliot-sawyer/silverstripe-nzstreets)[ Packagist](https://packagist.org/packages/elliotsawyer/nzstreets)[ Docs](http://silverstripe.org)[ RSS](/packages/elliotsawyer-nzstreets/feed)WikiDiscussions master Synced 2d ago

READMEChangelogDependencies (1)Versions (10)Used By (0)

NZ Street Address module for SilverStripe
=========================================

[](#nz-street-address-module-for-silverstripe)

Address lookup using LINZ Address Data.

Use the 0.0.x tags for SilverStripe 3 installations. SilverStripe 4 support will be handled from versions 0.1.x.

Installation
------------

[](#installation)

Add the repository to your composer.json file

```
    "repositories": [
        {
            "type": "vcs",
            "url": "git@github.com:elliot-sawyer/silverstripe-nzstreets.git"
        }
    ]

```

Add the project to the require section of composer.json

```
    "require": {
    ...
        "elliot-sawyer/nzstreets": "^0.1"
    ...

```

Setup
-----

[](#setup)

Composer should place the repository in your webroot.

Create a new route in routes.yml. You can change `address` to any url\_segment that meets your needs

```
SilverStripe\Control\Director:
  rules:
    'address//$Action/$ID/$Name': 'ElliotSawyer\NZStreets\NZStreetAddressController'

```

Download the CSV data source from

This is a massive file (500+ MB once extracted) and contains over 1.9 million records. The supplied importer will work but it's very slow: you should only use it for a smaller subset of files, or as a last resort for the entire set. For the fastest results, sideload it using mysqladmin or a similar database tool.

Usage
-----

[](#usage)

This module was created to feed into an autosuggest address lookup and is suitable for that purpose.

You can now search for addresses that start with your query. For example:

-
-
-

The default limit is 10 results. You can override this in your config.yml:

```
ElliotSawyer\NZStreets\NZStreetAddressController:
  search_limit: 5

```

Each search result contains an AddressID. For more details about an address, you can query by that ID:

-

Sideloading
-----------

[](#sideloading)

Build the table using the dev/build command. You can sideload the CSV file into MySQL with the following query:

```
LOAD DATA LOCAL INFILE '/path/to/your/nz-street-address.csv'
INTO TABLE NZStreetAddress
FIELDS TERMINATED BY ','
ENCLOSED BY '"'
LINES TERMINATED BY '\r\n'
IGNORE 1 LINES
(WKT,AddressID,ChangeID,AddressType,UnitValue,AddressNumber,AddressNumberSuffix,AddressNumberHigh,WaterRouteName,WaterName,SuburbLocality,TownCity,FullAddressNumber,FullRoadName,FullAddress,RoadSectionID,Longitude,Latitude,@dummy,@dummy,@dummy,@dummy,@dummy,@dummy,ShapeX,ShapeY)
SET ClassName="ElliotSawyer\\NZStreets\\NZStreetAddress", LastEdited=NOW(), Created=NOW();
```

Newer versions of MySQL treat this process as a security risk, so you might need to enable a few things on the server and the client to make it happen. Consider reverting these changes after the sideloading process is completed;

Within MySQL at the database level (must be root) `SET GLOBAL local_infile=1;`

Exit out of MySQL and reconnect with a flag on your client: `mysql -u root -p --local-infile=1`

Contributing
------------

[](#contributing)

Contributions are more than welcome! Please raise some issues or create pull requests on the Github repo.

Support
-------

[](#support)

Need some extra help or just love my work? Consider shouting me a coffee or a small donation if this module helped you solve a problem. I accept cryptocurrency at the following addresses:

- Bitcoin: 12gSxkqVNr9QMLQMMJdWemBaRRNPghmS3p
- Bitcoin Cash: 1QETPtssFRM981TGjVg74uUX8kShcA44ni
- Litecoin: LbyhaTESx3uQvwwd9So4sGSpi4tTJLKBdz
- Ethereum: 0x0694E0704c70D8d178dd2e9522FC59EBBEe86748

###  Health Score

30

—

LowBetter than 62% of packages

Maintenance18

Infrequent updates — may be unmaintained

Popularity12

Limited adoption so far

Community10

Small or concentrated contributor base

Maturity69

Established project with proven stability

 Bus Factor1

Top contributor holds 80% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~346 days

Recently: every ~603 days

Total

8

Last Release

731d ago

Major Versions

0.3.0 → 1.0.02019-08-27

1.0.0 → 2.x-dev2023-04-30

2.x-dev → 3.x-dev2024-06-29

### Community

Maintainers

![](https://www.gravatar.com/avatar/ad627a2d8fe16725eb7c9cdde9f4e92e26bf3fbf4c5baf3b9eebca58c8168941?d=identicon)[0x0000](/maintainers/0x0000)

---

Top Contributors

[![elliot-sawyer](https://avatars.githubusercontent.com/u/354793?v=4)](https://github.com/elliot-sawyer "elliot-sawyer (12 commits)")[![silverstripe-elliot](https://avatars.githubusercontent.com/u/5863816?v=4)](https://github.com/silverstripe-elliot "silverstripe-elliot (3 commits)")

---

Tags

geospatialgisnew-zealand-addresssilverstripeaddresssilverstripenznew zealandlookupgeocode

### Embed Badge

![Health badge](/badges/elliotsawyer-nzstreets/health.svg)

```
[![Health](https://phpackages.com/badges/elliotsawyer-nzstreets/health.svg)](https://phpackages.com/packages/elliotsawyer-nzstreets)
```

###  Alternatives

[symbiote/silverstripe-multivaluefield

A DB field + form fields for storing multiple values in a single property (serialized).

47445.2k61](/packages/symbiote-silverstripe-multivaluefield)[silverstripe/postgresql

SilverStripe now has tentative support for PostgreSQL ('Postgres')

16258.4k2](/packages/silverstripe-postgresql)[brettt89/silverstripe-garbage-collector

SilverStripe Garbage Collector module

1010.3k](/packages/brettt89-silverstripe-garbage-collector)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
