{"id":15540953,"url":"https://github.com/thundermiracle/geocoder-free","last_synced_at":"2025-04-23T17:05:57.933Z","repository":{"id":35066362,"uuid":"201056920","full_name":"thundermiracle/geocoder-free","owner":"thundermiracle","description":"get latitude and longitude by address without using google map api","archived":false,"fork":false,"pushed_at":"2022-12-09T21:47:45.000Z","size":2439,"stargazers_count":14,"open_issues_count":26,"forks_count":2,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-04-13T12:39:55.734Z","etag":null,"topics":["geocoder-freegoogle","geocoder-freeutils","geocoder-freeyahoo","geolocation","google","httpclient","jsonp-mode","latitude","latlng","longitude","yahoo"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/thundermiracle.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2019-08-07T13:32:53.000Z","updated_at":"2025-01-10T22:59:01.000Z","dependencies_parsed_at":"2023-01-15T13:15:37.084Z","dependency_job_id":null,"html_url":"https://github.com/thundermiracle/geocoder-free","commit_stats":null,"previous_names":["thundermiracle/address2gps"],"tags_count":22,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thundermiracle%2Fgeocoder-free","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thundermiracle%2Fgeocoder-free/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thundermiracle%2Fgeocoder-free/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thundermiracle%2Fgeocoder-free/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/thundermiracle","download_url":"https://codeload.github.com/thundermiracle/geocoder-free/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":250358761,"owners_count":21417543,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["geocoder-freegoogle","geocoder-freeutils","geocoder-freeyahoo","geolocation","google","httpclient","jsonp-mode","latitude","latlng","longitude","yahoo"],"created_at":"2024-10-02T12:14:53.148Z","updated_at":"2025-04-23T17:05:57.911Z","avatar_url":"https://github.com/thundermiracle.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003ch1 align=\"center\"\u003egeocoder-free\u003c/h1\u003e\n\n[![npm version](https://badge.fury.io/js/%40geocoder-free%2Fgoogle.svg)](https://badge.fury.io/js/%40geocoder-free%2Fgoogle)\n[![dependencies Status](https://david-dm.org/thundermiracle/geocoder-free/status.svg?path=packages/geocoder-free-google)](https://david-dm.org/thundermiracle/geocoder-free?path=geocoder-free-google)\n[![CircleCI](https://img.shields.io/circleci/build/github/thundermiracle/geocoder-free/master)](https://circleci.com/gh/thundermiracle/geocoder-free)\n[![codecov](https://img.shields.io/codecov/c/github/thundermiracle/geocoder-free)](https://codecov.io/gh/thundermiracle/geocoder-free)\n\n# Description\n\nThree packages for geocoding.\n\n## Table of contents\n\n* [@geocoder-free/google](#description-geocoder-freegoogle)\n  * [Install](#install-geocoder-freegoogle)\n  * [Usage](#usage-geocoder-freegoogle)\n* [@geocoder-free/yahoo](#description-geocoder-freeyahoo)\n  * [Install](#install-geocoder-freeyahoo)\n  * [Usage](#usage-geocoder-freeyahoo)\n* [@geocoder-free/utils](#description-geocoder-freeutils)\n  * [Install](#install-geocoder-freeutils)\n  * [Extra Install](#extra-install-geocoder-freeutils)\n  * [Usage](#usage-geocoder-freeutils)\n    * [How to import](#import)\n    * [HttpClient](#httpclient)\n    * [Get](#get): fetch data by url. using jsonp in client and node-fetch in server to avoid CORS errors in client.\n    * [GetUrl](#geturl): get redirected url.\n    * [Post](#get): post and get data by url. using jsonp in client and node-fetch in server to avoid CORS errors in client.\n    * Functions for all\n    * [dms2deg](#dms2deg): convert latitude or longitude from dms to decimal\n    * [getLatLngByDMSStr](#getLatLngByDMSStr): get latitude and longtitude array from dms latlng string\n    * [getLatLngByDecimalStr](#getLatLngByDecimalStr): get latitude and longtitude array from decimal latlng string\n    * [getLatLngObj](#getLatLngObj): split latitude,longitude string and transform it to object { lat: xxx, lng: xxx }\n    * [getLocaleString](#getLocaleString): parse date string and get toLocaleString if parsing is successful\n    * [logFormat](#logFormat): append date string to message\n    * [removeSpace](#removeSpace): remove all spaces from the string\n    * [isCorrectLatLng](#isCorrectLatLng): Check if the latitude longitude array is correct\n    * [getTimeByTimezone](#getTimeByTimezone): getTime with timezone; Analyze string in specified timezone\n    * [formatDate](#formatDate): format date or dateStr\n    * Functions for Japan only\n    * [cutToBlockNumber](#cutToBlockNumber)\n    * [removePostCode](#removePostCode)\n\n\n### Description (@geocoder-free/google)\n\nGet latitude\u0026longitude by google map without using any API.\n\n### Install (@geocoder-free/google)\n\n```shell\n yarn add @geocoder-free/google\n```\n\n### Usage (@geocoder-free/google)\n\n1. Get latlng by address\n\n    ```javascript\n    const { GetLatLngByAddress } = require('@geocoder-free/google');\n\n    GetLatLngByAddress('tokyo tower').then(console.log);\n    // print [35.6585769, 139.7454506]\n    ```\n\n1. Get latlng by goo.gl(google map shorten url)\n\n    ```javascript\n    const { GetLatLngByGooGl } = require('@geocoder-free/google');\n\n    GetLatLngByGooGl('https://goo.gl/maps/TmYFq1DdceHVpsHV6').then(console.log);\n    // print [35.6585769, 139.7454506]\n    ```\n\n### Description (@geocoder-free/yahoo)\n\nGet latitude\u0026longitude by YOLP(Yahoo! Open Local Platform) or by yahoo map.\n\n### Install (@geocoder-free/yahoo)\n\n```shell\n yarn add @geocoder-free/yahoo\n```\n\n### Usage (@geocoder-free/yahoo)\n\n1. Get latlng by yahoo api\n\n    ```javascript\n    const { GetLatLngByAPI } = require('@geocoder-free/yahoo');\n\n    GetLatLngByAPI('YOLP appid', '東京都港区六本木').then(console.log);\n    // print [35.66288632, 139.73359259]\n    ```\n\n### Description (@geocoder-free/utils)\n\nUtils for geocoding.\n\n### Install (@geocoder-free/utils)\n\nInstall the package in your project directory with:\n\n```sh\n// with npm\nnpm install @geocoder-free/utils\n\n// with yarn\nyarn add @geocoder-free/utils\n```\n\n### Extra Install (@geocoder-free/utils)\n\nIf you want to use HttpClient in server, node-fetch is required:\n\n```sh\n// with npm\nnpm install node-fetch\n\n// with yarn\nyarn add node-fetch\n```\n\nIf you want to use HttpClient in client, fetch-jsonp is required:\n\n```sh\n// with npm\nnpm install fetch-jsonp\n\n// with yarn\nyarn add fetch-jsonp\n```\n\n### Usage (@geocoder-free/utils)\n\n\n### Import\n\n```js\nimport { xxx } from '@geocoder-free/utils';\n\neg: import { dms2deg } from '@geocoder-free/utils';\n```\n\n### HttpClient\n\n*Packages node-fetch and fetch-jsonp are required by HttpClient.*\n\n#### Get\n\n**jsonp mode Can be disabled by pasing true to the 3rd parameter.**\n\n| No.   | Parameter | Required | Type | Default | Description |\n|:------|:---------:|:--------:|:----:|:--------|:------------|\n| 1 | url | 〇 | string |  | |\n| 2 | returnType | | string | 'json' | type of response, 'json' or 'text' |\n| 3 | forceNodeFetch | | boolean | false | if true, fetching data by jsonp will be disabled. |\n\n```js\nimport { Get } from '@geocoder-free/utils/HttpClient';\n\nGet(`https://api.google.com/xxxxxx`).then(console.log);\n```\n\n#### GetUrl\n\nGet the redirected url.\n\n| No.   | Parameter | Required | Type | Default | Description |\n|:------|:---------:|:--------:|:----:|:--------|:------------|\n| 1 | url | 〇 | string |  | |\n\n```js\nimport { GetUrl } from '@geocoder-free/utils/HttpClient';\n\nGetUrl(`https://goo.gl/maps/nQjjgsyid7iGa42J8`).then(console.log);\n// get 'https://www.google.com/maps/place/%E7%9A%87%E5%B1%85/@35.6938997,139.7628928,15z/data=!4m5!3m4!1s0x60188c0d02d8064d:0xd11a5f0b379e6db7!8m2!3d35.6851739!4d139.7527993'\n```\n\n#### Post\n\n**jsonp mode Can be disabled by pasing true to the 3rd parameter.**\n\n| No.   | Parameter | Required | Type | Default | Description |\n|:------|:---------:|:--------:|:----:|:--------|:------------|\n| 1 | url | 〇 | string |  | |\n| 2 | data | 〇 | object |  | data for post |\n| 3 | forceNodeFetch | | boolean | false | if true, fetching data by jsonp will be disabled. |\n\n```js\nimport { Post } from '@geocoder-free/utils/HttpClient';\n\nPost(`https://api.google.com/xxxxxx`).then(console.log);\n```\n\n### dms2deg\n\n| No.   | Parameter | Required | Type | Default | Description |\n|:------|:---------:|:--------:|:----:|:--------|:------------|\n| 1 | dmsStr | 〇 | string |  | dms string |\n\n```js\ndms2deg(`35°39'31.3\"N`);\n// get 35.658694\n\ndms2deg(`139°44'40.3\"W`);\n// get -139.744528\n```\n\n### getLatLngByDMSStr\n\n| No.   | Parameter | Required | Type | Default | Description |\n|:------|:---------:|:--------:|:----:|:--------|:------------|\n| 1 | latlngDmsStr | 〇 | string |  | string contains dms latitude \u0026 dms longitude |\n\n```js\ngetLatLngByDMSStr(`35°39'31.3\"N+139°44'40.3\"E`);\n// get [35.658694, 139.744528]\n```\n\n### getLatLngByDecimalStr\n\n| No.   | Parameter | Required | Type | Default | Description |\n|:------|:---------:|:--------:|:----:|:--------|:------------|\n| 1 | latlngDecimalStr | 〇 | string |  | string contains decimal latitude \u0026 decimal longitude(split by comma) |\n\n```js\ngetLatLngByDecimalStr(`35.123, 149.123`);\n// get [35.123, 149.123]\n```\n\n### getLatLngObj\n\n| No.   | Parameter | Required | Type | Default | Description |\n|:------|:---------:|:--------:|:----:|:--------|:------------|\n| 1 | latlngDecimalStr | 〇 | string |  | string contains decimal latitude \u0026 decimal longitude(split by comma) |\n\n```js\ngetLatLngObj(`35.123, 149.123`);\n// get { lat: 35.123, lng: 149.123 }\n```\n\n### getLocaleString\n\n| No.   | Parameter | Required | Type | Default | Description |\n|:------|:---------:|:--------:|:----:|:--------|:------------|\n| 1 | dateStr | 〇 | string |  | output is different in different timezone |\n\n```js\ngetLocaleString(`2019-08-29`);\n// get \"2019/8/29 9:00:00\"\n```\n\n### logFormat\n\n| No.   | Parameter | Required | Type | Default | Description |\n|:------|:---------:|:--------:|:----:|:--------|:------------|\n| 1 | msg | 〇 | string |  | message |\n| 2 | func | | function | null | call func(formatted string) if func is not null |\n\n```js\n// example is in Asia/Tokyo\n\nlogFormat(`hello`);\n// get \"2019/8/29 9:00:00 -- hello\"\n\nlogFormat(`hello`, (str) =\u003e `[info]${str}`);\n// get \"[info]2019/8/29 9:00:00 -- hello\"\n```\n\n### removeSpace\n\n| No.   | Parameter | Required | Type | Default | Description |\n|:------|:---------:|:--------:|:----:|:--------|:------------|\n| 1 | str | 〇 | string |  | |\n\n```js\nremoveSpace('  2 3  4  ');\n// get \"234\"\n```\n\n### isCorrectLatLng\n\n| No.   | Parameter | Required | Type | Default | Description |\n|:------|:---------:|:--------:|:----:|:--------|:------------|\n| 1 | latlngArr | 〇 | array |  | [latitude, longitude] |\n\n```js\nisCorrectLatLng([NaN, 139.1]);\n// get false\n\nisCorrectLatLng([35.123, NaN]);\n// get false\n\nisCorrectLatLng([35.123, 139.1]);\n// get true\n```\n\n### getTimeByTimezone\n\n| No.   | Parameter | Required | Type | Default | Description |\n|:------|:---------:|:--------:|:----:|:--------|:------------|\n| 1 | dateStr | 〇 | string |  | |\n| 2 | timezone | 〇 | number |  | |\n\n```js\n/*\nin UTC system.\n*/\ngetTimeByTimezone('2019-09-01 11:00:00', 9);\n// get 1567303200000\n\nnew Date('2019-09-01 11:00:00').getTime();\n// get 1567335600000\n```\n\n### formatDate\n\n| No.   | Parameter | Required | Type | Default | Description |\n|:------|:---------:|:--------:|:----:|:--------|:------------|\n| 1 | date | 〇 | string / date |  | |\n| 2 | format |  | string | yyyy/MM/dd HH:mm:ss | for '2019-01-09 08:01:01', ```yyyy: 2019; yy: 19; MM: 01; M: 1; dd: 09; d: 9; HH: 08; H: 8; mm: 01; m: 1; ss: 01; s: 1; SSS: 000;``` |\n\n```js\nformatDate('2019-09-01 8:00:00', 'yyyy/M/d H:m:s');\n// get \"2019/9/1 8:0:0\"\n```\n\n### cutToBlockNumber\n\n番地までの住所を取得\n\n| No.   | Parameter | Required | Type | Default | Description |\n|:------|:---------:|:--------:|:----:|:--------|:------------|\n| 1 | address | 〇 | string |  | 番地の後ろにスペースが必要 |\n\n```js\ncutToBlockNumber('新宿区 2-3-1 新宿ビル305');\n// get \"新宿区 2-3-1\"\n```\n\n### removePostCode\n\n郵便マーク（〒）を削除\n\n```js\nremovePostCode('〒123-1234+tokyo');\n// get \"123-1234+tokyo\"\n```\n\n## License\n\nThis project is licensed under the terms of the\n[MIT license](/LICENSE).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fthundermiracle%2Fgeocoder-free","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fthundermiracle%2Fgeocoder-free","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fthundermiracle%2Fgeocoder-free/lists"}