This package has been deprecated

Author message:

Package no longer supported. Contact Support at https://www.npmjs.com/support for more info.

openls-geocode-parser
TypeScript icon, indicating that this package has built-in type declarations

1.0.1 • Public • Published

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.

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:

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? [
        ...
    ],
    ...
}

Versions

Current Tags

  • Version
    Downloads (Last 7 Days)
    • Published

Version History

  • Version
    Downloads (Last 7 Days)
    • Published

Package Sidebar

Install

npm i openls-geocode-parser

Weekly Downloads

1

Version

1.0.1

License

MIT

Last publish

Collaborators

  • geoloep