# openls-geocode-parser

> Utilities for parsing openls geocode repsonses

Latest version **1.0.1** (published 2016-12-13) · MIT license · 0 weekly downloads

> **Deprecated.** This package is deprecated.

## Install

```sh
npm install openls-geocode-parser
pnpm add openls-geocode-parser
yarn add openls-geocode-parser
bun add openls-geocode-parser
```

## Health

**Score 10/100 (F)** — status: deprecated.

Negative: deprecated.

## Facts

| | |
|---|---|
| Version | 1.0.1 |
| Published | 2016-12-13 |
| First published | 2016-12-13 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 1 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | Geoloep |
| Maintainers | geoloep |

## Links

- npm: https://www.npmjs.com/package/openls-geocode-parser
- Repository: https://github.com/geoloep/openls-geocode-parser
- Homepage: https://github.com/geoloep/openls-geocode-parser#readme
- Issues: https://github.com/geoloep/openls-geocode-parser/issues
- npm.io page: https://npm.io/package/openls-geocode-parser

## Dependencies (1)

- [xml2js](https://npm.io/package/xml2js.md) *

## Recent versions

- 1.0.1 (latest) — 2016-12-13
- 1.0.0 — 2016-12-13

## README

OpenLS Geocode request parser
=============================

This utility parses OpenLS geocode request xml files into JavaScript Objects.

Usage
-----
Include the openLSParser in your script and pass a Geocoderesponse to it.

```javascript
var openLSParser = require("openls-geocode-parser");

openLSparser(
    '<xls:GeocodeResponse xmlns:xls="http://www.opengis.net/xls" xmlns:gml="http://www.opengis.net/gml"> ... </xls:GeocodeResponse>',
    function onSuccess(geocodeResponse) {
        console.log(geocodeResponse);
    },
    function onFail() {
        console.log('Something went wrong!');
    }
);
```

The GeocodeResponse is categorized into different 'depths':
* Country
* CountrySubdivision
* Municipality
* MunicipalitySubdivision
* Street
* Building

A fully featured GeocodedAddress has the following structure:

```javascript
geocodeResponse = {
    Building?: [
            {
            Country: string,
            Depth: string (= Building)
            Place: {
                CountrySubdivision?: string,
                Municipality?: string,
                MunicipalitySubdivision?: string
            },
            Point: {
                srsName: string,
                pos: [number, number]
            },
            PostalCode?: string,
            StreetAddress? {
                Building?: {
                    number: number,
                    subdivision?: string
                },
                Street: string
            }
        },
        {
        ...
        },
        ...
    ],
    Street? [
        ...
    ],
    ...
}
```

---
_Source: https://npm.io/package/openls-geocode-parser · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
