catastrogps 1.2.1 → 2.1.0
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 +54 -34
- package/dist/index.d.mts +486 -186
- package/dist/index.d.ts +486 -186
- package/dist/index.js +75 -28
- package/dist/index.mjs +74 -28
- package/package.json +2 -2
package/dist/index.d.ts
CHANGED
|
@@ -2,7 +2,7 @@ declare const COUNTRY_CODES: readonly ["ES", "PV", "NA", "PT", "FR", "IT", "DE",
|
|
|
2
2
|
type CountryCode = (typeof COUNTRY_CODES)[number];
|
|
3
3
|
declare const ENRICHMENT_COUNTRY_CODES: readonly ["ES", "PV", "NA", "PT", "FR", "IT", "DE"];
|
|
4
4
|
type EnrichmentCountryCode = (typeof ENRICHMENT_COUNTRY_CODES)[number];
|
|
5
|
-
type ExportFormat = 'kml' | 'gpx'
|
|
5
|
+
type ExportFormat = 'kml' | 'gpx';
|
|
6
6
|
type FetchLike = (input: string, init?: RequestInit) => Promise<Response>;
|
|
7
7
|
interface CatastroGPSOptions {
|
|
8
8
|
apiKey?: string;
|
|
@@ -42,91 +42,280 @@ interface Quota {
|
|
|
42
42
|
rateLimit?: BurstLimit;
|
|
43
43
|
fincaCap?: FincaCap;
|
|
44
44
|
}
|
|
45
|
+
interface AvailableFields {
|
|
46
|
+
use: boolean;
|
|
47
|
+
landClass: boolean;
|
|
48
|
+
yearBuilt: boolean;
|
|
49
|
+
builtArea: boolean;
|
|
50
|
+
ownershipShare: boolean;
|
|
51
|
+
dwellings: boolean;
|
|
52
|
+
floors: boolean;
|
|
53
|
+
address: boolean;
|
|
54
|
+
addressSearch: boolean;
|
|
55
|
+
}
|
|
56
|
+
declare const CROP_LANGUAGES: readonly ["es", "ca", "en", "pt", "fr", "it", "de", "pl", "nl", "cs"];
|
|
57
|
+
type CropLanguage = (typeof CROP_LANGUAGES)[number];
|
|
58
|
+
interface LanguageOption {
|
|
59
|
+
lang?: CropLanguage;
|
|
60
|
+
}
|
|
61
|
+
type SubparcelKind = 'cadastral' | 'declaredCrop' | 'landCover';
|
|
62
|
+
type UseClass = 'arable' | 'farmland' | 'vegetables' | 'grassland' | 'vineyard' | 'olive' | 'orchard' | 'permanentCrop' | 'forest' | 'shrubland' | 'fallow' | 'garden' | 'leisure' | 'built' | 'transport' | 'water' | 'wetland' | 'bare' | 'other';
|
|
63
|
+
interface Subparcel {
|
|
64
|
+
id: string;
|
|
65
|
+
cropCode?: string;
|
|
66
|
+
crop?: string;
|
|
67
|
+
cropOriginal?: string;
|
|
68
|
+
intensity?: number;
|
|
69
|
+
area: number;
|
|
70
|
+
landType?: string;
|
|
71
|
+
landClass?: string;
|
|
72
|
+
kind: SubparcelKind;
|
|
73
|
+
useClass?: UseClass;
|
|
74
|
+
useClassName?: string;
|
|
75
|
+
source?: string;
|
|
76
|
+
geometry?: unknown;
|
|
77
|
+
}
|
|
78
|
+
interface ParcelSubparcels {
|
|
79
|
+
reference: string;
|
|
80
|
+
country?: string;
|
|
81
|
+
parcelArea?: number;
|
|
82
|
+
count: number;
|
|
83
|
+
subparcels: Subparcel[];
|
|
84
|
+
}
|
|
85
|
+
interface CropShare {
|
|
86
|
+
cropCode?: string;
|
|
87
|
+
crop?: string;
|
|
88
|
+
cropOriginal?: string;
|
|
89
|
+
useClass?: UseClass;
|
|
90
|
+
area: number;
|
|
91
|
+
share: number;
|
|
92
|
+
}
|
|
93
|
+
interface CropReference {
|
|
94
|
+
code: string;
|
|
95
|
+
source: string;
|
|
96
|
+
name: string;
|
|
97
|
+
original: string;
|
|
98
|
+
useClass?: UseClass;
|
|
99
|
+
labels: Partial<Record<CropLanguage, string>>;
|
|
100
|
+
}
|
|
101
|
+
interface UseClassReference {
|
|
102
|
+
code: UseClass;
|
|
103
|
+
name: string;
|
|
104
|
+
labels: Partial<Record<CropLanguage, string>>;
|
|
105
|
+
}
|
|
106
|
+
interface CropCatalog {
|
|
107
|
+
locale: CropLanguage;
|
|
108
|
+
locales: CropLanguage[];
|
|
109
|
+
sources: string[];
|
|
110
|
+
count: number;
|
|
111
|
+
useClasses: UseClassReference[];
|
|
112
|
+
crops: CropReference[];
|
|
113
|
+
}
|
|
114
|
+
interface Neighbor {
|
|
115
|
+
reference: string;
|
|
116
|
+
latitude: number;
|
|
117
|
+
longitude: number;
|
|
118
|
+
}
|
|
119
|
+
interface Neighbors {
|
|
120
|
+
country: string;
|
|
121
|
+
supported: boolean;
|
|
122
|
+
count: number;
|
|
123
|
+
neighbors: Neighbor[];
|
|
124
|
+
}
|
|
125
|
+
interface Province {
|
|
126
|
+
code: string;
|
|
127
|
+
name: string;
|
|
128
|
+
}
|
|
129
|
+
interface Provinces {
|
|
130
|
+
total: number;
|
|
131
|
+
provinces: Province[];
|
|
132
|
+
}
|
|
133
|
+
interface Municipality {
|
|
134
|
+
code: string;
|
|
135
|
+
ineCode?: string;
|
|
136
|
+
name: string;
|
|
137
|
+
}
|
|
138
|
+
interface Municipalities {
|
|
139
|
+
total: number;
|
|
140
|
+
municipalities: Municipality[];
|
|
141
|
+
}
|
|
142
|
+
interface Street {
|
|
143
|
+
code: string;
|
|
144
|
+
type: string;
|
|
145
|
+
name: string;
|
|
146
|
+
fullName: string;
|
|
147
|
+
}
|
|
148
|
+
interface Streets {
|
|
149
|
+
total: number;
|
|
150
|
+
streets: Street[];
|
|
151
|
+
}
|
|
152
|
+
interface StreetsQuery {
|
|
153
|
+
region: string;
|
|
154
|
+
municipality: string;
|
|
155
|
+
name?: string;
|
|
156
|
+
}
|
|
157
|
+
interface PortugalRecord {
|
|
158
|
+
source: string;
|
|
159
|
+
officialCadastre: boolean;
|
|
160
|
+
nic?: string;
|
|
161
|
+
rggProcess?: number;
|
|
162
|
+
articles?: string[];
|
|
163
|
+
section?: string;
|
|
164
|
+
cadastreId?: string;
|
|
165
|
+
dicofre?: string;
|
|
166
|
+
parish?: string;
|
|
167
|
+
municipality?: string;
|
|
168
|
+
}
|
|
45
169
|
interface Parcel {
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
clase?: string;
|
|
57
|
-
superficieConstruida?: number;
|
|
58
|
-
superficieParcela?: number;
|
|
59
|
-
anioConstruccion?: number;
|
|
60
|
-
viviendas?: number;
|
|
61
|
-
plantas?: number;
|
|
62
|
-
fuenteDatos?: string;
|
|
63
|
-
dataSource?: string;
|
|
64
|
-
poligono?: number[][];
|
|
65
|
-
availableFields?: Record<string, boolean>;
|
|
66
|
-
[key: string]: unknown;
|
|
67
|
-
}
|
|
68
|
-
interface PointMatch {
|
|
69
|
-
referenciaCatastral: string;
|
|
70
|
-
refCat14?: string;
|
|
71
|
-
pais?: string;
|
|
72
|
-
direccion?: string;
|
|
73
|
-
codigoPostal?: string;
|
|
74
|
-
municipio?: string;
|
|
75
|
-
provincia?: string;
|
|
76
|
-
tipoInmueble?: string;
|
|
77
|
-
coordenadas: {
|
|
78
|
-
latitud: number;
|
|
79
|
-
longitud: number;
|
|
80
|
-
};
|
|
170
|
+
reference: string;
|
|
171
|
+
parcelReference?: string;
|
|
172
|
+
propertyType?: string;
|
|
173
|
+
country?: string;
|
|
174
|
+
address?: string;
|
|
175
|
+
postalCode?: string;
|
|
176
|
+
municipality?: string;
|
|
177
|
+
region?: string;
|
|
178
|
+
latitude: number;
|
|
179
|
+
longitude: number;
|
|
81
180
|
googleMapsUrl?: string;
|
|
82
|
-
|
|
83
|
-
|
|
181
|
+
use?: string;
|
|
182
|
+
landClass?: string;
|
|
183
|
+
builtArea?: number;
|
|
184
|
+
parcelArea?: number;
|
|
185
|
+
yearBuilt?: number;
|
|
186
|
+
ownershipShare?: number;
|
|
187
|
+
staircase?: string;
|
|
188
|
+
floor?: string;
|
|
189
|
+
door?: string;
|
|
190
|
+
dwellings?: number;
|
|
191
|
+
floors?: number;
|
|
192
|
+
source?: string;
|
|
193
|
+
fromOwnCopy?: boolean;
|
|
194
|
+
ruralPolygon?: string;
|
|
195
|
+
ruralParcel?: string;
|
|
196
|
+
placeName?: string;
|
|
197
|
+
polygon?: number[][];
|
|
198
|
+
subparcelCount?: number;
|
|
199
|
+
cropSummary?: CropShare[];
|
|
200
|
+
portugal?: PortugalRecord;
|
|
201
|
+
availableFields?: AvailableFields;
|
|
202
|
+
}
|
|
203
|
+
type PointMatch = Parcel;
|
|
84
204
|
interface AddressMatch {
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
205
|
+
reference: string;
|
|
206
|
+
parcelReference?: string;
|
|
207
|
+
address?: string;
|
|
208
|
+
region?: string;
|
|
209
|
+
municipality?: string;
|
|
210
|
+
streetType?: string;
|
|
211
|
+
streetName?: string;
|
|
212
|
+
number?: number;
|
|
213
|
+
floor?: string;
|
|
214
|
+
door?: string;
|
|
215
|
+
postalCode?: string;
|
|
216
|
+
}
|
|
217
|
+
interface LatLng {
|
|
218
|
+
latitude: number;
|
|
219
|
+
longitude: number;
|
|
96
220
|
}
|
|
97
221
|
interface ParcelGeometry {
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
geojson?: unknown;
|
|
102
|
-
centroid?: {
|
|
103
|
-
latitude: number;
|
|
104
|
-
longitude: number;
|
|
105
|
-
};
|
|
106
|
-
latitud?: number;
|
|
107
|
-
longitud?: number;
|
|
222
|
+
reference: string;
|
|
223
|
+
country?: string;
|
|
224
|
+
centroid: LatLng;
|
|
108
225
|
area?: number;
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
226
|
+
geojson?: {
|
|
227
|
+
type: 'Feature';
|
|
228
|
+
geometry: {
|
|
229
|
+
type: 'Polygon';
|
|
230
|
+
coordinates: number[][][];
|
|
231
|
+
};
|
|
232
|
+
properties: {
|
|
233
|
+
reference: string;
|
|
234
|
+
area?: number;
|
|
235
|
+
centroid: LatLng;
|
|
236
|
+
};
|
|
237
|
+
};
|
|
238
|
+
officialRecordUrl?: string;
|
|
239
|
+
cadastreUrl?: string;
|
|
240
|
+
googleMapsUrl?: string;
|
|
241
|
+
}
|
|
242
|
+
interface SolarEconomics {
|
|
243
|
+
selfConsumptionKwhYear?: number;
|
|
244
|
+
selfConsumptionSavingsEur?: number;
|
|
245
|
+
surplusKwhYear?: number;
|
|
246
|
+
surplusPriceEurKwh?: number;
|
|
247
|
+
surplusIncomeEur?: number;
|
|
248
|
+
capexEur?: number;
|
|
249
|
+
annualMaintenanceEur?: number;
|
|
250
|
+
netAnnualIncomeEur?: number;
|
|
251
|
+
paybackYears?: number;
|
|
252
|
+
irrPct?: number;
|
|
253
|
+
totalReturn25YearsEur?: number;
|
|
254
|
+
landLeaseAvailable?: boolean;
|
|
255
|
+
landLeaseEurPerHaYear?: number;
|
|
256
|
+
landLeaseTotalEurYear?: number;
|
|
257
|
+
note?: string;
|
|
258
|
+
sources?: string[];
|
|
112
259
|
}
|
|
113
260
|
interface SolarEstimate {
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
}
|
|
129
|
-
type
|
|
261
|
+
available: boolean;
|
|
262
|
+
status: string;
|
|
263
|
+
annualProductionKwh: number;
|
|
264
|
+
installableKw: number;
|
|
265
|
+
annualSavingsEur: number;
|
|
266
|
+
paybackYears: number;
|
|
267
|
+
co2AvoidedKg: number;
|
|
268
|
+
irradiationKwhM2: number;
|
|
269
|
+
solarGrade: number;
|
|
270
|
+
optimalOrientation?: string;
|
|
271
|
+
tiltAngleDeg?: number;
|
|
272
|
+
installationCostEur?: number;
|
|
273
|
+
source?: string;
|
|
274
|
+
economics?: SolarEconomics;
|
|
275
|
+
}
|
|
276
|
+
type Rating = 'excellent' | 'good' | 'moderate' | 'low' | 'very_low' | 'no_data';
|
|
277
|
+
interface AgricultureData {
|
|
278
|
+
landUse: string;
|
|
279
|
+
mainCrop: string;
|
|
280
|
+
areaHa?: number;
|
|
281
|
+
irrigationCoefficient?: number;
|
|
282
|
+
plot?: {
|
|
283
|
+
province?: number;
|
|
284
|
+
municipality?: number;
|
|
285
|
+
polygon?: number;
|
|
286
|
+
parcel?: number;
|
|
287
|
+
enclosure?: number;
|
|
288
|
+
meanSlopePct?: number;
|
|
289
|
+
altitudeM?: number;
|
|
290
|
+
pastureEligibilityPct?: number;
|
|
291
|
+
pastureRegion?: number;
|
|
292
|
+
incidents?: string[];
|
|
293
|
+
};
|
|
294
|
+
parcel?: {
|
|
295
|
+
country: string;
|
|
296
|
+
id: string;
|
|
297
|
+
parts?: Record<string, string>;
|
|
298
|
+
source: string;
|
|
299
|
+
year?: number;
|
|
300
|
+
origin?: DataSource;
|
|
301
|
+
geometry?: unknown;
|
|
302
|
+
organic?: boolean;
|
|
303
|
+
};
|
|
304
|
+
ndvi?: {
|
|
305
|
+
mean: number;
|
|
306
|
+
cropHealth: Rating | string;
|
|
307
|
+
updatedAt: string;
|
|
308
|
+
method?: string;
|
|
309
|
+
};
|
|
310
|
+
cropPrice?: {
|
|
311
|
+
pricePerKgEur: number;
|
|
312
|
+
trend?: string;
|
|
313
|
+
method?: string;
|
|
314
|
+
isEstimate: boolean;
|
|
315
|
+
referenceDate?: string;
|
|
316
|
+
};
|
|
317
|
+
nitrateVulnerableZone?: Record<string, unknown>;
|
|
318
|
+
}
|
|
130
319
|
interface ResolveCandidate {
|
|
131
320
|
country: string;
|
|
132
321
|
kind: 'reference' | 'coordinates' | 'place_name' | string;
|
|
@@ -149,69 +338,69 @@ interface AddressCandidatesQuery {
|
|
|
149
338
|
limit?: number;
|
|
150
339
|
}
|
|
151
340
|
interface AddressCandidate {
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
341
|
+
reference: string;
|
|
342
|
+
country: string;
|
|
343
|
+
address: string;
|
|
344
|
+
number?: number;
|
|
345
|
+
postalCode?: string;
|
|
346
|
+
municipality: string;
|
|
347
|
+
region: string;
|
|
348
|
+
latitude: number;
|
|
349
|
+
longitude: number;
|
|
350
|
+
confidence: number;
|
|
351
|
+
numberMatches: boolean;
|
|
352
|
+
municipalityMatches: boolean;
|
|
353
|
+
inOwnCopy: boolean;
|
|
354
|
+
cadastreAddress?: string;
|
|
355
|
+
use?: string;
|
|
356
|
+
dwellings?: number;
|
|
357
|
+
yearBuilt?: number;
|
|
169
358
|
}
|
|
170
359
|
interface AddressCandidatesResult {
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
360
|
+
query: {
|
|
361
|
+
text: string;
|
|
362
|
+
street?: string;
|
|
363
|
+
number?: number;
|
|
364
|
+
municipality?: string;
|
|
365
|
+
postalCode?: string;
|
|
177
366
|
};
|
|
178
|
-
|
|
367
|
+
candidates: AddressCandidate[];
|
|
179
368
|
attribution: string;
|
|
180
369
|
}
|
|
181
370
|
interface Unit {
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
371
|
+
reference: string;
|
|
372
|
+
staircase: string;
|
|
373
|
+
floor: string;
|
|
374
|
+
door: string;
|
|
375
|
+
use: string;
|
|
376
|
+
area: number;
|
|
377
|
+
description: string;
|
|
378
|
+
ownershipShare?: number;
|
|
379
|
+
yearBuilt?: number;
|
|
380
|
+
address?: string;
|
|
192
381
|
}
|
|
193
382
|
interface Construction {
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
383
|
+
staircase: string;
|
|
384
|
+
floor: string;
|
|
385
|
+
door: string;
|
|
386
|
+
use: string;
|
|
387
|
+
area: number;
|
|
388
|
+
description: string;
|
|
200
389
|
}
|
|
201
390
|
interface UnitsPageData {
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
391
|
+
reference: string;
|
|
392
|
+
address?: string;
|
|
393
|
+
postalCode?: string;
|
|
394
|
+
municipality?: string;
|
|
395
|
+
region?: string;
|
|
396
|
+
mainUse?: string;
|
|
397
|
+
totalArea?: number;
|
|
398
|
+
yearBuilt?: number;
|
|
399
|
+
ownershipShare?: string;
|
|
400
|
+
unitCount: number;
|
|
401
|
+
propertyUnitCount: number;
|
|
402
|
+
units: Unit[];
|
|
403
|
+
constructions?: Construction[];
|
|
215
404
|
truncated: boolean;
|
|
216
405
|
nextCursor?: string;
|
|
217
406
|
dataSource: 'clone' | 'catastro' | string;
|
|
@@ -225,16 +414,16 @@ interface UnitsPage {
|
|
|
225
414
|
data: UnitsPageData;
|
|
226
415
|
}
|
|
227
416
|
interface UnitsResult {
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
417
|
+
reference: string;
|
|
418
|
+
address?: string;
|
|
419
|
+
postalCode?: string;
|
|
420
|
+
municipality?: string;
|
|
421
|
+
region?: string;
|
|
422
|
+
mainUse?: string;
|
|
423
|
+
yearBuilt?: number;
|
|
424
|
+
propertyUnitCount: number;
|
|
425
|
+
units: Unit[];
|
|
426
|
+
constructions: Construction[];
|
|
238
427
|
dataSource: string;
|
|
239
428
|
dataDate: string;
|
|
240
429
|
attribution: string;
|
|
@@ -265,46 +454,46 @@ interface ProtectedSite {
|
|
|
265
454
|
type?: 'SPA' | 'SCI' | 'SPA_SCI' | string;
|
|
266
455
|
designation?: string;
|
|
267
456
|
country?: string;
|
|
268
|
-
|
|
457
|
+
overlapPct?: number | null;
|
|
269
458
|
}
|
|
270
459
|
interface Terrain {
|
|
271
|
-
|
|
460
|
+
reference: string;
|
|
272
461
|
country: string;
|
|
273
462
|
relief: {
|
|
274
463
|
status: BlockStatus;
|
|
275
|
-
|
|
464
|
+
elevationM?: {
|
|
276
465
|
mean: number;
|
|
277
466
|
min: number;
|
|
278
467
|
max: number;
|
|
279
468
|
};
|
|
280
469
|
slope?: {
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
470
|
+
meanPct: number;
|
|
471
|
+
meanDeg: number;
|
|
472
|
+
maxPct: number;
|
|
284
473
|
class: string;
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
474
|
+
maxClass: string;
|
|
475
|
+
shareOver10Pct: number;
|
|
476
|
+
classesPct: Record<string, number>;
|
|
288
477
|
};
|
|
289
478
|
aspect?: {
|
|
290
479
|
dominant: string;
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
480
|
+
dominantSharePct: number;
|
|
481
|
+
meanDeg: number | null;
|
|
482
|
+
flatSharePct: number;
|
|
483
|
+
sectorsPct: Record<string, number>;
|
|
295
484
|
};
|
|
296
485
|
sample?: {
|
|
297
486
|
method: string;
|
|
298
487
|
cells: number;
|
|
299
|
-
|
|
488
|
+
resolutionM: number;
|
|
300
489
|
};
|
|
301
490
|
source?: DataSource;
|
|
302
491
|
};
|
|
303
|
-
|
|
492
|
+
protectedAreas: {
|
|
304
493
|
status: BlockStatus;
|
|
305
494
|
intersects?: boolean;
|
|
306
495
|
inside?: boolean;
|
|
307
|
-
|
|
496
|
+
maxOverlapPct?: number | null;
|
|
308
497
|
natura2000?: ProtectedSite[];
|
|
309
498
|
national?: ProtectedSite[];
|
|
310
499
|
method?: string;
|
|
@@ -316,11 +505,11 @@ interface Terrain {
|
|
|
316
505
|
recent?: Record<string, number>;
|
|
317
506
|
[key: string]: unknown;
|
|
318
507
|
};
|
|
319
|
-
|
|
508
|
+
calculatedAt?: string;
|
|
320
509
|
provenance?: string;
|
|
321
510
|
}
|
|
322
511
|
interface GroundMotion {
|
|
323
|
-
|
|
512
|
+
reference: string;
|
|
324
513
|
country: string;
|
|
325
514
|
status: BlockStatus;
|
|
326
515
|
reason?: 'no_reflectors' | 'outside_coverage' | 'parcel_too_large' | string;
|
|
@@ -329,39 +518,138 @@ interface GroundMotion {
|
|
|
329
518
|
to: string;
|
|
330
519
|
label: string;
|
|
331
520
|
};
|
|
332
|
-
|
|
521
|
+
groundMotion?: {
|
|
333
522
|
class: string;
|
|
334
|
-
|
|
523
|
+
worstClass?: string;
|
|
335
524
|
vertical: {
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
525
|
+
meanMmYear: number;
|
|
526
|
+
maxSubsidenceMmYear?: number;
|
|
527
|
+
maxUpliftMmYear?: number;
|
|
528
|
+
stdMmYear?: number;
|
|
529
|
+
accelerationMmYear2?: number;
|
|
530
|
+
rmseMm?: number;
|
|
342
531
|
};
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
532
|
+
eastWest?: {
|
|
533
|
+
meanMmYear: number;
|
|
534
|
+
stdMmYear?: number;
|
|
346
535
|
};
|
|
347
|
-
|
|
536
|
+
yearlyDisplacement?: Array<{
|
|
348
537
|
year: number;
|
|
349
538
|
mm: number;
|
|
350
539
|
}>;
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
540
|
+
cellsWithData: number;
|
|
541
|
+
cellsConsidered: number;
|
|
542
|
+
coveragePct: number;
|
|
354
543
|
basis?: 'parcel' | 'surroundings' | string;
|
|
355
|
-
|
|
544
|
+
cellSizeM?: number;
|
|
356
545
|
};
|
|
357
546
|
source?: DataSource;
|
|
358
|
-
|
|
547
|
+
calculatedAt?: string;
|
|
359
548
|
provenance?: string;
|
|
360
549
|
}
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
550
|
+
interface MarketSale {
|
|
551
|
+
id?: string;
|
|
552
|
+
parcelId?: string;
|
|
553
|
+
date?: string;
|
|
554
|
+
priceEur?: number;
|
|
555
|
+
builtAreaM2?: number;
|
|
556
|
+
propertyType?: string;
|
|
557
|
+
rooms?: number;
|
|
558
|
+
address?: string;
|
|
559
|
+
municipality?: string;
|
|
560
|
+
latitude?: number;
|
|
561
|
+
longitude?: number;
|
|
562
|
+
}
|
|
563
|
+
interface MarketData {
|
|
564
|
+
available: boolean;
|
|
565
|
+
status: string;
|
|
566
|
+
estimatedPriceEur: number;
|
|
567
|
+
pricePerM2Eur: number;
|
|
568
|
+
salesCount: number;
|
|
569
|
+
lastSaleDate?: string;
|
|
570
|
+
granularity?: string;
|
|
571
|
+
source?: string;
|
|
572
|
+
sales?: MarketSale[];
|
|
573
|
+
message?: string;
|
|
574
|
+
dataQuality?: string;
|
|
575
|
+
updatedAt?: string;
|
|
576
|
+
zonePrices?: ZonePrices;
|
|
577
|
+
}
|
|
578
|
+
interface OfficialZonePrice {
|
|
579
|
+
pricePerM2Eur: number;
|
|
580
|
+
pricePerHaEur?: number;
|
|
581
|
+
statistic: string;
|
|
582
|
+
authority: string;
|
|
583
|
+
period: string;
|
|
584
|
+
}
|
|
585
|
+
interface ZonePrices {
|
|
586
|
+
zone: string;
|
|
587
|
+
zoneLevel: string;
|
|
588
|
+
municipality?: string;
|
|
589
|
+
urban?: OfficialZonePrice;
|
|
590
|
+
rural?: OfficialZonePrice;
|
|
591
|
+
}
|
|
592
|
+
interface ScoreComponents {
|
|
593
|
+
solar: number;
|
|
594
|
+
agriculture: number;
|
|
595
|
+
market: number;
|
|
596
|
+
accessibility: number;
|
|
597
|
+
risk: number;
|
|
598
|
+
}
|
|
599
|
+
interface ScoreData {
|
|
600
|
+
score: number;
|
|
601
|
+
rating: Rating;
|
|
602
|
+
recommendation: string;
|
|
603
|
+
components: ScoreComponents;
|
|
604
|
+
availableComponents: {
|
|
605
|
+
[K in keyof ScoreComponents]: boolean;
|
|
606
|
+
};
|
|
607
|
+
riskFactors: string[];
|
|
608
|
+
opportunityFactors: string[];
|
|
609
|
+
}
|
|
610
|
+
interface ValueHistoryEntry {
|
|
611
|
+
id: string;
|
|
612
|
+
reference: string;
|
|
613
|
+
country: string;
|
|
614
|
+
cadastralValueEur: number;
|
|
615
|
+
area: number;
|
|
616
|
+
use: string;
|
|
617
|
+
capturedOn: string;
|
|
618
|
+
source: string;
|
|
619
|
+
createdAt: string;
|
|
620
|
+
}
|
|
621
|
+
interface ValueHistory {
|
|
622
|
+
reference: string;
|
|
623
|
+
country: string;
|
|
624
|
+
entries: ValueHistoryEntry[];
|
|
625
|
+
totalEntries: number;
|
|
626
|
+
areaChangePct: number | null;
|
|
627
|
+
}
|
|
628
|
+
interface ComparedParcel {
|
|
629
|
+
reference: string;
|
|
630
|
+
country: string;
|
|
631
|
+
parcel?: Parcel;
|
|
632
|
+
solar?: SolarEstimate;
|
|
633
|
+
agriculture?: {
|
|
634
|
+
available: boolean;
|
|
635
|
+
status: string;
|
|
636
|
+
isAgricultural: boolean;
|
|
637
|
+
landUse?: string;
|
|
638
|
+
cropGroup?: string;
|
|
639
|
+
crop?: string;
|
|
640
|
+
areaHa?: number;
|
|
641
|
+
};
|
|
642
|
+
score?: {
|
|
643
|
+
available: boolean;
|
|
644
|
+
score: number;
|
|
645
|
+
rating: Rating;
|
|
646
|
+
};
|
|
647
|
+
error?: string;
|
|
648
|
+
}
|
|
649
|
+
interface Comparison {
|
|
650
|
+
parcels: ComparedParcel[];
|
|
651
|
+
total: number;
|
|
652
|
+
}
|
|
365
653
|
interface CompareItem {
|
|
366
654
|
reference: string;
|
|
367
655
|
country: EnrichmentCountryCode;
|
|
@@ -381,6 +669,14 @@ declare class FincasResource {
|
|
|
381
669
|
units(refcat14: string, options?: GetUnitsOptions): Promise<UnitsResult>;
|
|
382
670
|
}
|
|
383
671
|
|
|
672
|
+
declare class LocationsResource {
|
|
673
|
+
private readonly client;
|
|
674
|
+
constructor(client: CatastroGPS);
|
|
675
|
+
provinces(): Promise<Provinces>;
|
|
676
|
+
municipalities(region: string): Promise<Municipalities>;
|
|
677
|
+
streets(query: StreetsQuery): Promise<Streets>;
|
|
678
|
+
}
|
|
679
|
+
|
|
384
680
|
interface PointQuery extends CountryOption {
|
|
385
681
|
lat: number;
|
|
386
682
|
lng: number;
|
|
@@ -388,7 +684,9 @@ interface PointQuery extends CountryOption {
|
|
|
388
684
|
declare class ParcelsResource {
|
|
389
685
|
private readonly client;
|
|
390
686
|
constructor(client: CatastroGPS);
|
|
391
|
-
get(reference: string, options?: CountryOption): Promise<Parcel>;
|
|
687
|
+
get(reference: string, options?: CountryOption & LanguageOption): Promise<Parcel>;
|
|
688
|
+
subparcels(reference: string, options?: CountryOption & LanguageOption): Promise<ParcelSubparcels>;
|
|
689
|
+
neighbors(reference: string, options?: CountryOption): Promise<Neighbors>;
|
|
392
690
|
atPoint(point: PointQuery): Promise<PointMatch>;
|
|
393
691
|
findByAddress(address: string): Promise<AddressMatch>;
|
|
394
692
|
geometry(reference: string, options?: CountryOption<Exclude<CountryCode, 'UK'>>): Promise<ParcelGeometry>;
|
|
@@ -402,7 +700,7 @@ declare class ParcelsResource {
|
|
|
402
700
|
compare(parcels: CompareItem[]): Promise<Comparison>;
|
|
403
701
|
}
|
|
404
702
|
|
|
405
|
-
declare const DEFAULT_BASE_URL = "https://api.
|
|
703
|
+
declare const DEFAULT_BASE_URL = "https://api.parcelgps.com";
|
|
406
704
|
declare const DEFAULT_TIMEOUT_MS = 30000;
|
|
407
705
|
declare const DEFAULT_MAX_RETRIES = 2;
|
|
408
706
|
type Query = Record<string, string | number | undefined>;
|
|
@@ -422,6 +720,7 @@ declare class CatastroGPS {
|
|
|
422
720
|
readonly parcels: ParcelsResource;
|
|
423
721
|
readonly export: ExportResource;
|
|
424
722
|
readonly fincas: FincasResource;
|
|
723
|
+
readonly locations: LocationsResource;
|
|
425
724
|
lastQuota?: Quota;
|
|
426
725
|
private readonly apiKey;
|
|
427
726
|
private readonly baseUrl;
|
|
@@ -435,6 +734,7 @@ declare class CatastroGPS {
|
|
|
435
734
|
resolve(text: string, options?: {
|
|
436
735
|
hint?: string;
|
|
437
736
|
}): Promise<ResolveResult>;
|
|
737
|
+
cropCatalog(options?: LanguageOption): Promise<CropCatalog>;
|
|
438
738
|
request<T>(method: 'GET' | 'POST', path: string, options?: RequestOptions): Promise<T>;
|
|
439
739
|
conditionalRequest<T>(method: 'GET' | 'POST', path: string, options?: RequestOptions): Promise<ConditionalResponse<T>>;
|
|
440
740
|
private once;
|
|
@@ -445,7 +745,7 @@ declare class CatastroGPS {
|
|
|
445
745
|
}
|
|
446
746
|
declare function readQuota(headers: Headers): Quota | undefined;
|
|
447
747
|
|
|
448
|
-
declare const VERSION = "
|
|
748
|
+
declare const VERSION = "2.1.0";
|
|
449
749
|
|
|
450
750
|
declare class CatastroGPSError extends Error {
|
|
451
751
|
readonly status?: number;
|
|
@@ -474,8 +774,8 @@ declare class ValidationError extends CatastroGPSError {
|
|
|
474
774
|
declare class PlaceNameError extends ValidationError {
|
|
475
775
|
name: string;
|
|
476
776
|
get location(): {
|
|
477
|
-
|
|
478
|
-
|
|
777
|
+
latitude: number;
|
|
778
|
+
longitude: number;
|
|
479
779
|
address?: string;
|
|
480
780
|
label?: string;
|
|
481
781
|
} | undefined;
|
|
@@ -517,4 +817,4 @@ declare class NetworkError extends CatastroGPSError {
|
|
|
517
817
|
name: string;
|
|
518
818
|
}
|
|
519
819
|
|
|
520
|
-
export { ADDRESS_COUNTRY_CODES, type AddressCandidate, type AddressCandidatesQuery, type AddressCandidatesResult, type AddressCountryCode, type AddressMatch, type AgricultureData, AmbiguousReferenceError, AuthenticationError, type BlockStatus, type BurstLimit, COUNTRY_CODES, CatastroGPS, CatastroGPSError, type CatastroGPSOptions, type CompareItem, type Comparison, type ConditionalResponse, type Construction, type CountryCode, type CountryOption, CoverageError, DEFAULT_BASE_URL, DEFAULT_MAX_RETRIES, DEFAULT_TIMEOUT_MS, type DataSource, ENRICHMENT_COUNTRY_CODES, type EnrichmentCountryCode, type ExportFormat, type FetchLike, type FincaCap, ForbiddenError, type GetUnitsOptions, type GroundMotion, type LocatedOptions, type MarketData, NetworkError, NotFoundError, type Parcel, type ParcelGeometry, PlaceNameError, type PointMatch, type PointQuery, type PrepaidOverage, type ProtectedSite, type Quota, QuotaExceededError, RateLimitError, type ResolveCandidate, type ResolveResult, type ScoreData, ServerError, ServiceUnavailableError, type SolarEstimate, type Terrain, TimeoutError, UNITS_COUNTRY_CODES, type Unit, type UnitsCountryCode, type UnitsPage, type UnitsPageData, type UnitsResult, VERSION, ValidationError, type ValueHistory, readQuota };
|
|
820
|
+
export { ADDRESS_COUNTRY_CODES, type AddressCandidate, type AddressCandidatesQuery, type AddressCandidatesResult, type AddressCountryCode, type AddressMatch, type AgricultureData, AmbiguousReferenceError, AuthenticationError, type AvailableFields, type BlockStatus, type BurstLimit, COUNTRY_CODES, CROP_LANGUAGES, CatastroGPS, CatastroGPSError, type CatastroGPSOptions, type CompareItem, type ComparedParcel, type Comparison, type ConditionalResponse, type Construction, type CountryCode, type CountryOption, CoverageError, type CropCatalog, type CropLanguage, type CropReference, type CropShare, DEFAULT_BASE_URL, DEFAULT_MAX_RETRIES, DEFAULT_TIMEOUT_MS, type DataSource, ENRICHMENT_COUNTRY_CODES, type EnrichmentCountryCode, type ExportFormat, type FetchLike, type FincaCap, ForbiddenError, type GetUnitsOptions, type GroundMotion, type LanguageOption, type LatLng, type LocatedOptions, type MarketData, type MarketSale, type Municipalities, type Municipality, type Neighbor, type Neighbors, NetworkError, NotFoundError, type OfficialZonePrice, type Parcel, type ParcelGeometry, type ParcelSubparcels, PlaceNameError, type PointMatch, type PointQuery, type PortugalRecord, type PrepaidOverage, type ProtectedSite, type Province, type Provinces, type Quota, QuotaExceededError, RateLimitError, type Rating, type ResolveCandidate, type ResolveResult, type ScoreComponents, type ScoreData, ServerError, ServiceUnavailableError, type SolarEconomics, type SolarEstimate, type Street, type Streets, type StreetsQuery, type Subparcel, type SubparcelKind, type Terrain, TimeoutError, UNITS_COUNTRY_CODES, type Unit, type UnitsCountryCode, type UnitsPage, type UnitsPageData, type UnitsResult, type UseClass, type UseClassReference, VERSION, ValidationError, type ValueHistory, type ValueHistoryEntry, type ZonePrices, readQuota };
|