https://github.com/gabrielclavero/gc-geo-fields
Example component and project using geographical data from geonames.org
https://github.com/gabrielclavero/gc-geo-fields
angularjs example-code geographic-data
Last synced: about 1 month ago
JSON representation
Example component and project using geographical data from geonames.org
- Host: GitHub
- URL: https://github.com/gabrielclavero/gc-geo-fields
- Owner: gabrielclavero
- License: mit
- Created: 2018-02-11T19:51:27.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2018-02-11T20:14:23.000Z (over 8 years ago)
- Last Synced: 2026-03-25T11:50:03.012Z (3 months ago)
- Topics: angularjs, example-code, geographic-data
- Language: JavaScript
- Homepage:
- Size: 12.5 MB
- Stars: 0
- Watchers: 1
- Forks: 3
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# README
## gc-geo-fields
This project is an angular module you can use to quickly add geographical location fields to your web forms.
It also contains a demo you can check to see the component in action.
## About the JSON data
The geographical data provided in this project in several JSON files was extracted from www.geonames.org.
You can take a look at the script that outputs the json files in the World Geo Parser project [https://github.com/gabrielclavero/world-geo-parser](https://github.com/gabrielclavero/world-geo-parser).
Both the World Geo Parser project and www.geonames.org content are licensed under a Creative Commons Attribution 3.0 License [http://creativecommons.org/licenses/by/3.0/](http://creativecommons.org/licenses/by/3.0/)
## Usage
You can get it from [Bower](http://bower.io/)
```sh
bower install gc-geo-fields
```
Load the script files in your application:
```html
```
Add the specific module to your dependencies:
```javascript
angular.module('myApp', ['gc.geo.fields', ...])
```
Make sure you leave the json data folder and the template.html file in the same location than the geofields.js file.
## IMPORTANT
Keep in mind after running the script on [https://github.com/gabrielclavero/world-geo-parser](https://github.com/gabrielclavero/world-geo-parser), some of the states will have TONS of cities on it (up to 11k maybe) Maybe what you want instead are the second-order administrative divisions of each country. To do that, use the feature class 'A' and feature code 'ADM2' to gather the data on step 3 of the script.