quantaroute-geocoding 1.0.0 → 1.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +77 -12
- package/dist/types.d.ts +5 -0
- package/dist/types.d.ts.map +1 -1
- package/dist/types.js.map +1 -1
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
# QuantaRoute Geocoding Node.js SDK
|
|
2
2
|
|
|
3
|
-
A **
|
|
3
|
+
A **unique** Node.js/TypeScript library for geocoding addresses to DigiPin codes or reverse with **groundbreaking Location Lookup API** and offline processing capabilities. This library is designed for India 🇮🇳!
|
|
4
4
|
|
|
5
|
-
## 🚀
|
|
5
|
+
## 🚀 Unique Features
|
|
6
6
|
|
|
7
7
|
### 🎯 **NEW: Location Lookup API** - *Service that even government doesn't provide!*
|
|
8
|
-
- 🗺️ **Administrative Boundary Lookup**: Get state, division, locality, pincode from coordinates
|
|
8
|
+
- 🗺️ **Administrative Boundary Lookup**: Get state, division, locality, pincode, district, delivery status from coordinates
|
|
9
|
+
- 📊 **Population Density Data**: Mean, min, and max population density from Meta's 30-meter gridded data
|
|
9
10
|
- 📍 **36,000+ Postal Boundaries**: Complete coverage across India
|
|
10
11
|
- ⚡ **Sub-100ms Response**: Cached responses with database fallback
|
|
11
12
|
- 🎯 **Government-Level Precision**: Accuracy that official services don't offer
|
|
@@ -34,7 +35,7 @@ npm install digipin
|
|
|
34
35
|
|
|
35
36
|
## Quick Start
|
|
36
37
|
|
|
37
|
-
### 🚀 **NEW:
|
|
38
|
+
### 🚀 **NEW: Unique Location Lookup API**
|
|
38
39
|
|
|
39
40
|
```typescript
|
|
40
41
|
import { QuantaRouteClient } from 'quantaroute-geocoding';
|
|
@@ -44,21 +45,25 @@ const client = new QuantaRouteClient({
|
|
|
44
45
|
apiKey: 'your-api-key'
|
|
45
46
|
});
|
|
46
47
|
|
|
47
|
-
// 🚀
|
|
48
|
+
// 🚀 Unique: Get administrative boundaries from coordinates
|
|
48
49
|
const result = await client.lookupLocationFromCoordinates(28.6139, 77.2090);
|
|
49
50
|
console.log(`Pincode: ${result.administrative_info.pincode}`); // 110001
|
|
50
51
|
console.log(`State: ${result.administrative_info.state}`); // Delhi
|
|
51
52
|
console.log(`Division: ${result.administrative_info.division}`); // New Delhi Central
|
|
52
53
|
console.log(`Locality: ${result.administrative_info.locality}`); // Nirman Bhawan SO
|
|
54
|
+
console.log(`District: ${result.administrative_info.district}`); // New Delhi
|
|
55
|
+
console.log(`Delivery: ${result.administrative_info.delivery}`); // Delivery
|
|
56
|
+
console.log(`Pop Density: ${result.administrative_info.mean_population_density}`); // 11234.56
|
|
53
57
|
console.log(`DigiPin: ${result.digipin}`); // 39J-438-TJC7
|
|
54
58
|
console.log(`Response Time: ${result.response_time_ms}ms`); // <100ms
|
|
55
59
|
|
|
56
|
-
// 🚀
|
|
60
|
+
// 🚀 Unique: Get boundaries from DigiPin
|
|
57
61
|
const digipinResult = await client.lookupLocationFromDigiPin("39J-438-TJC7");
|
|
58
62
|
console.log(`Pincode: ${digipinResult.administrative_info.pincode}`);
|
|
59
63
|
console.log(`State: ${digipinResult.administrative_info.state}`);
|
|
60
64
|
console.log(`Division: ${digipinResult.administrative_info.division}`);
|
|
61
65
|
console.log(`Locality: ${digipinResult.administrative_info.locality}`);
|
|
66
|
+
console.log(`District: ${digipinResult.administrative_info.district}`);
|
|
62
67
|
|
|
63
68
|
// 📊 Get live statistics (36,000+ boundaries)
|
|
64
69
|
const stats = await client.getLocationStatistics();
|
|
@@ -108,7 +113,7 @@ const distance = processor.calculateDistance(28.6139, 77.2090, 28.6150, 77.2100)
|
|
|
108
113
|
console.log(`Distance: ${distance.toFixed(2)} km`);
|
|
109
114
|
```
|
|
110
115
|
|
|
111
|
-
## 🚀
|
|
116
|
+
## 🚀 Unique Location Lookup API
|
|
112
117
|
|
|
113
118
|
### Dedicated Location Lookup Client
|
|
114
119
|
|
|
@@ -160,6 +165,11 @@ interface LocationLookupResult {
|
|
|
160
165
|
division: string; // "New Delhi Central"
|
|
161
166
|
state: string; // "Delhi"
|
|
162
167
|
country: string; // "India"
|
|
168
|
+
delivery?: string; // "Delivery"
|
|
169
|
+
district?: string; // "New Delhi"
|
|
170
|
+
mean_population_density?: number; // 11234.56
|
|
171
|
+
min_population_density?: number; // 5678.90
|
|
172
|
+
max_population_density?: number; // 15234.67
|
|
163
173
|
};
|
|
164
174
|
coordinates: {
|
|
165
175
|
latitude: number; // 28.6139
|
|
@@ -172,7 +182,7 @@ interface LocationLookupResult {
|
|
|
172
182
|
}
|
|
173
183
|
```
|
|
174
184
|
|
|
175
|
-
### Why This is
|
|
185
|
+
### Why This is Unique?
|
|
176
186
|
|
|
177
187
|
🎯 **Government-Level Precision**: Access to administrative boundaries that even government APIs don't provide at this level of detail and accessibility.
|
|
178
188
|
|
|
@@ -231,6 +241,41 @@ try {
|
|
|
231
241
|
}
|
|
232
242
|
```
|
|
233
243
|
|
|
244
|
+
## Browser Usage & CORS
|
|
245
|
+
|
|
246
|
+
### Frontend Applications
|
|
247
|
+
|
|
248
|
+
This package works in both **Node.js** and **browser** environments. For browser usage:
|
|
249
|
+
|
|
250
|
+
```typescript
|
|
251
|
+
// Works in React, Vue, Angular, vanilla JS, etc.
|
|
252
|
+
import { QuantaRouteClient } from 'quantaroute-geocoding';
|
|
253
|
+
|
|
254
|
+
const client = new QuantaRouteClient({
|
|
255
|
+
apiKey: 'your-api-key'
|
|
256
|
+
});
|
|
257
|
+
|
|
258
|
+
// Use in your frontend application
|
|
259
|
+
const handleGeocode = async () => {
|
|
260
|
+
try {
|
|
261
|
+
const result = await client.lookupLocationFromCoordinates(28.6139, 77.2090);
|
|
262
|
+
console.log('Location data:', result);
|
|
263
|
+
} catch (error) {
|
|
264
|
+
console.error('Geocoding error:', error);
|
|
265
|
+
}
|
|
266
|
+
};
|
|
267
|
+
```
|
|
268
|
+
|
|
269
|
+
### CORS Configuration
|
|
270
|
+
|
|
271
|
+
The QuantaRoute API server is configured to allow cross-origin requests. If you encounter CORS issues:
|
|
272
|
+
|
|
273
|
+
1. **Check your API key**: Ensure you're using a valid API key
|
|
274
|
+
2. **Verify the endpoint**: Make sure you're calling the correct API endpoints
|
|
275
|
+
3. **Browser dev tools**: Check the Network tab for detailed error information
|
|
276
|
+
|
|
277
|
+
**Note**: CORS issues are server-side configuration problems, not client-side package issues.
|
|
278
|
+
|
|
234
279
|
## TypeScript Support
|
|
235
280
|
|
|
236
281
|
This package includes full TypeScript definitions:
|
|
@@ -259,7 +304,7 @@ const result: LocationLookupResult = await client.lookupLocationFromCoordinates(
|
|
|
259
304
|
| Paid | 100 | 10,000 | 100 |
|
|
260
305
|
| Enterprise | 1,000 | Unlimited | 100 |
|
|
261
306
|
|
|
262
|
-
### 🚀
|
|
307
|
+
### 🚀 Unique Location Lookup API
|
|
263
308
|
|
|
264
309
|
| Tier | Requests/Minute | Monthly Limit | Batch Size | Boundaries |
|
|
265
310
|
|------|----------------|---------------|------------|------------|
|
|
@@ -278,20 +323,20 @@ const result: LocationLookupResult = await client.lookupLocationFromCoordinates(
|
|
|
278
323
|
Check out the `examples/` directory for more comprehensive examples:
|
|
279
324
|
|
|
280
325
|
- `basic-usage.js` - Basic geocoding operations
|
|
281
|
-
- `location-lookup.js` -
|
|
326
|
+
- `location-lookup.js` - Unique Location Lookup API
|
|
282
327
|
- `batch-processing.js` - Batch operations
|
|
283
328
|
- `offline-processing.js` - Offline DigiPin operations
|
|
284
329
|
- `error-handling.js` - Comprehensive error handling
|
|
285
330
|
|
|
286
331
|
## Support
|
|
287
332
|
|
|
288
|
-
- 📧 Email:
|
|
333
|
+
- 📧 Email: hello@quantaroute.com
|
|
289
334
|
- 🌐 Website: https://quantaroute.com
|
|
290
335
|
- 📖 Traditional API Docs: https://api.quantaroute.com/v1/digipin/docs
|
|
291
336
|
- 🚀 **NEW: Location Lookup API**: https://api.quantaroute.com/v1/location
|
|
292
337
|
- 📊 **Live Statistics**: https://api.quantaroute.com/v1/location/stats
|
|
293
338
|
|
|
294
|
-
### 🚀 What Makes This
|
|
339
|
+
### 🚀 What Makes This Unique?
|
|
295
340
|
|
|
296
341
|
**QuantaRoute's Location Lookup API is the first and only service to provide:**
|
|
297
342
|
|
|
@@ -307,6 +352,26 @@ Check out the `examples/` directory for more comprehensive examples:
|
|
|
307
352
|
|
|
308
353
|
**Ready to revolutionize your location intelligence applications?**
|
|
309
354
|
|
|
355
|
+
## Changelog
|
|
356
|
+
|
|
357
|
+
### [1.0.2] - 2025-11-01
|
|
358
|
+
#### Added
|
|
359
|
+
- 🎉 **Population Density Data**: Added mean, min, and max population density fields from Meta's 30-meter gridded data
|
|
360
|
+
- 📍 **District Information**: Added district field for Indian district division as per official records
|
|
361
|
+
- ✅ **Delivery Status**: Added delivery field for pincode delivery status
|
|
362
|
+
- 🌍 **Complete Geographic Data**: Added state and country fields for comprehensive location information
|
|
363
|
+
|
|
364
|
+
#### Enhanced
|
|
365
|
+
- Improved administrative boundary data with complete coverage (36,000+ postal boundaries)
|
|
366
|
+
- All Location Lookup API responses now include population density and district information
|
|
367
|
+
|
|
368
|
+
### [1.0.1] - Previous Release
|
|
369
|
+
- Initial stable release with Location Lookup API
|
|
370
|
+
|
|
371
|
+
### [1.0.0] - Initial Release
|
|
372
|
+
- Traditional geocoding API with DigiPin support
|
|
373
|
+
- Offline processing capabilities
|
|
374
|
+
|
|
310
375
|
## License
|
|
311
376
|
|
|
312
377
|
MIT License - see LICENSE file for details.
|
package/dist/types.d.ts
CHANGED
|
@@ -11,6 +11,11 @@ export interface AdministrativeInfo {
|
|
|
11
11
|
division: string;
|
|
12
12
|
locality: string;
|
|
13
13
|
pincode: string;
|
|
14
|
+
delivery?: string;
|
|
15
|
+
district?: string;
|
|
16
|
+
mean_population_density?: number;
|
|
17
|
+
min_population_density?: number;
|
|
18
|
+
max_population_density?: number;
|
|
14
19
|
}
|
|
15
20
|
export interface LocationLookupResult {
|
|
16
21
|
coordinates: Coordinates;
|
package/dist/types.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,MAAM,WAAW,WAAW;IAC1B,QAAQ,EAAE,MAAM,CAAC;IACjB,SAAS,EAAE,MAAM,CAAC;CACnB;AAED,MAAM,WAAW,kBAAkB;IACjC,OAAO,EAAE,MAAM,CAAC;IAChB,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,EAAE,MAAM,CAAC;IACjB,QAAQ,EAAE,MAAM,CAAC;IACjB,OAAO,EAAE,MAAM,CAAC;
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,MAAM,WAAW,WAAW;IAC1B,QAAQ,EAAE,MAAM,CAAC;IACjB,SAAS,EAAE,MAAM,CAAC;CACnB;AAED,MAAM,WAAW,kBAAkB;IACjC,OAAO,EAAE,MAAM,CAAC;IAChB,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,EAAE,MAAM,CAAC;IACjB,QAAQ,EAAE,MAAM,CAAC;IACjB,OAAO,EAAE,MAAM,CAAC;IAChB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,uBAAuB,CAAC,EAAE,MAAM,CAAC;IACjC,sBAAsB,CAAC,EAAE,MAAM,CAAC;IAChC,sBAAsB,CAAC,EAAE,MAAM,CAAC;CACjC;AAED,MAAM,WAAW,oBAAoB;IACnC,WAAW,EAAE,WAAW,CAAC;IACzB,OAAO,EAAE,MAAM,CAAC;IAChB,mBAAmB,EAAE,kBAAkB,CAAC;IACxC,UAAU,EAAE,MAAM,CAAC;IACnB,MAAM,EAAE,OAAO,GAAG,UAAU,CAAC;IAC7B,gBAAgB,CAAC,EAAE,MAAM,CAAC;CAC3B;AAED,MAAM,WAAW,aAAa;IAC5B,OAAO,EAAE,MA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AAM,CAAC;CACrB;AAED,MAAM,WAAW,oBAAoB;IACnC,OAAO,EAAE,MAAM,CAAC;IAChB,WAAW,EAAE,WAAW,CAAC;IACzB,MAAM,EAAE,SAAS,CAAC;CACnB;AAED,MAAM,WAAW,gBAAgB;IAC/B,OAAO,EAAE,OAAO,CAAC;IACjB,OAAO,EAAE,MAAM,CAAC;IAChB,MAAM,EAAE,MAAM,EAAE,CAAC;IACjB,MAAM,EAAE,SAAS,CAAC;CACnB;AAED,qBAAa,gBAAiB,SAAQ,KAAK;IACzC,SAAgB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpC,SAAgB,IAAI,CAAC,EAAE,MAAM,CAAC;gBAElB,OAAO,EAAE,MAAM,EAAE,UAAU,CAAC,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,MAAM;CAMhE;AAED,qBAAa,eAAgB,SAAQ,gBAAgB;gBACvC,OAAO,EAAE,MAAM,EAAE,UAAU,CAAC,EAAE,MAAM;CAIjD;AAED,qBAAa,cAAe,SAAQ,gBAAgB;IAClD,SAAgB,UAAU,CAAC,EAAE,MAAM,CAAC;gBAExB,OAAO,EAAE,MAAM,EAAE,UAAU,CAAC,EAAE,MAAM;CAKjD;AAED,qBAAa,mBAAoB,SAAQ,gBAAgB;gBAC3C,OAAO,GAAE,MAA0B;CAIhD;AAED,qBAAa,eAAgB,SAAQ,gBAAgB;gBACvC,OAAO,EAAE,MAAM;CAI5B"}
|
package/dist/types.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.js","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":";AAAA;;GAEG;;;
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":";AAAA;;GAEG;;;AAkGH,MAAa,gBAAiB,SAAQ,KAAK;IAIzC,YAAY,OAAe,EAAE,UAAmB,EAAE,IAAa;QAC7D,KAAK,CAAC,OAAO,CAAC,CAAC;QACf,IAAI,CAAC,IAAI,GAAG,kBAAkB,CAAC;QAC/B,IAAI,CAAC,UAAU,GAAG,UAAU,CAAC;QAC7B,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC;IACnB,CAAC;CACF;AAVD,4CAUC;AAED,MAAa,eAAgB,SAAQ,gBAAgB;IACnD,YAAY,OAAe,EAAE,UAAmB;QAC9C,KAAK,CAAC,OAAO,EAAE,UAAU,EAAE,mBAAmB,CAAC,CAAC;QAChD,IAAI,CAAC,IAAI,GAAG,iBAAiB,CAAC;IAChC,CAAC;CACF;AALD,0CAKC;AAED,MAAa,cAAe,SAAQ,gBAAgB;IAGlD,YAAY,OAAe,EAAE,UAAmB;QAC9C,KAAK,CAAC,OAAO,EAAE,GAAG,EAAE,kBAAkB,CAAC,CAAC;QACxC,IAAI,CAAC,IAAI,GAAG,gBAAgB,CAAC;QAC7B,IAAI,CAAC,UAAU,GAAG,UAAU,CAAC;IAC/B,CAAC;CACF;AARD,wCAQC;AAED,MAAa,mBAAoB,SAAQ,gBAAgB;IACvD,YAAY,UAAkB,iBAAiB;QAC7C,KAAK,CAAC,OAAO,EAAE,GAAG,EAAE,sBAAsB,CAAC,CAAC;QAC5C,IAAI,CAAC,IAAI,GAAG,qBAAqB,CAAC;IACpC,CAAC;CACF;AALD,kDAKC;AAED,MAAa,eAAgB,SAAQ,gBAAgB;IACnD,YAAY,OAAe;QACzB,KAAK,CAAC,OAAO,EAAE,GAAG,EAAE,kBAAkB,CAAC,CAAC;QACxC,IAAI,CAAC,IAAI,GAAG,iBAAiB,CAAC;IAChC,CAAC;CACF;AALD,0CAKC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "quantaroute-geocoding",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.2",
|
|
4
4
|
"description": "Revolutionary Node.js SDK for QuantaRoute Geocoding API with Location Lookup and DigiPin processing",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
@@ -28,7 +28,7 @@
|
|
|
28
28
|
],
|
|
29
29
|
"author": {
|
|
30
30
|
"name": "QuantaRoute",
|
|
31
|
-
"email": "
|
|
31
|
+
"email": "hello@quantaroute.com",
|
|
32
32
|
"url": "https://quantaroute.com"
|
|
33
33
|
},
|
|
34
34
|
"license": "MIT",
|