@loaders.gl/arcgis 5.0.0-alpha.10
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/LICENSE +52 -0
- package/README.md +28 -0
- package/dist/arcgis/arcgis-capability-graph.d.ts +50 -0
- package/dist/arcgis/arcgis-capability-graph.d.ts.map +1 -0
- package/dist/arcgis/arcgis-capability-graph.js +221 -0
- package/dist/arcgis/arcgis-capability-graph.js.map +1 -0
- package/dist/arcgis/arcgis-feature-query.d.ts +53 -0
- package/dist/arcgis/arcgis-feature-query.d.ts.map +1 -0
- package/dist/arcgis/arcgis-feature-query.js +381 -0
- package/dist/arcgis/arcgis-feature-query.js.map +1 -0
- package/dist/arcgis/arcgis-feature-server-source-loader-types.d.ts +33 -0
- package/dist/arcgis/arcgis-feature-server-source-loader-types.d.ts.map +1 -0
- package/dist/arcgis/arcgis-feature-server-source-loader-types.js +21 -0
- package/dist/arcgis/arcgis-feature-server-source-loader-types.js.map +1 -0
- package/dist/arcgis/arcgis-feature-server-source-loader.d.ts +84 -0
- package/dist/arcgis/arcgis-feature-server-source-loader.d.ts.map +1 -0
- package/dist/arcgis/arcgis-feature-server-source-loader.js +280 -0
- package/dist/arcgis/arcgis-feature-server-source-loader.js.map +1 -0
- package/dist/arcgis/arcgis-image-server-source-loader-types.d.ts +31 -0
- package/dist/arcgis/arcgis-image-server-source-loader-types.d.ts.map +1 -0
- package/dist/arcgis/arcgis-image-server-source-loader-types.js +21 -0
- package/dist/arcgis/arcgis-image-server-source-loader-types.js.map +1 -0
- package/dist/arcgis/arcgis-image-server-source-loader.d.ts +60 -0
- package/dist/arcgis/arcgis-image-server-source-loader.d.ts.map +1 -0
- package/dist/arcgis/arcgis-image-server-source-loader.js +130 -0
- package/dist/arcgis/arcgis-image-server-source-loader.js.map +1 -0
- package/dist/arcgis/arcgis-image-tile-source-loader-types.d.ts +31 -0
- package/dist/arcgis/arcgis-image-tile-source-loader-types.d.ts.map +1 -0
- package/dist/arcgis/arcgis-image-tile-source-loader-types.js +21 -0
- package/dist/arcgis/arcgis-image-tile-source-loader-types.js.map +1 -0
- package/dist/arcgis/arcgis-image-tile-source-loader.d.ts +63 -0
- package/dist/arcgis/arcgis-image-tile-source-loader.d.ts.map +1 -0
- package/dist/arcgis/arcgis-image-tile-source-loader.js +147 -0
- package/dist/arcgis/arcgis-image-tile-source-loader.js.map +1 -0
- package/dist/arcgis/arcgis-map-tile-source-loader-types.d.ts +31 -0
- package/dist/arcgis/arcgis-map-tile-source-loader-types.d.ts.map +1 -0
- package/dist/arcgis/arcgis-map-tile-source-loader-types.js +21 -0
- package/dist/arcgis/arcgis-map-tile-source-loader-types.js.map +1 -0
- package/dist/arcgis/arcgis-map-tile-source-loader.d.ts +62 -0
- package/dist/arcgis/arcgis-map-tile-source-loader.d.ts.map +1 -0
- package/dist/arcgis/arcgis-map-tile-source-loader.js +196 -0
- package/dist/arcgis/arcgis-map-tile-source-loader.js.map +1 -0
- package/dist/arcgis/arcgis-scene-aggregation.d.ts +34 -0
- package/dist/arcgis/arcgis-scene-aggregation.d.ts.map +1 -0
- package/dist/arcgis/arcgis-scene-aggregation.js +57 -0
- package/dist/arcgis/arcgis-scene-aggregation.js.map +1 -0
- package/dist/arcgis/arcgis-scene-server-source-loader-types.d.ts +31 -0
- package/dist/arcgis/arcgis-scene-server-source-loader-types.d.ts.map +1 -0
- package/dist/arcgis/arcgis-scene-server-source-loader-types.js +21 -0
- package/dist/arcgis/arcgis-scene-server-source-loader-types.js.map +1 -0
- package/dist/arcgis/arcgis-scene-server-source-loader.d.ts +64 -0
- package/dist/arcgis/arcgis-scene-server-source-loader.d.ts.map +1 -0
- package/dist/arcgis/arcgis-scene-server-source-loader.js +159 -0
- package/dist/arcgis/arcgis-scene-server-source-loader.js.map +1 -0
- package/dist/arcgis/arcgis-server.d.ts +15 -0
- package/dist/arcgis/arcgis-server.d.ts.map +1 -0
- package/dist/arcgis/arcgis-server.js +41 -0
- package/dist/arcgis/arcgis-server.js.map +1 -0
- package/dist/arcgis/arcgis-url-utils.d.ts +3 -0
- package/dist/arcgis/arcgis-url-utils.d.ts.map +1 -0
- package/dist/arcgis/arcgis-url-utils.js +23 -0
- package/dist/arcgis/arcgis-url-utils.js.map +1 -0
- package/dist/arcgis/arcgis-vector-tile-server-source-loader-types.d.ts +31 -0
- package/dist/arcgis/arcgis-vector-tile-server-source-loader-types.d.ts.map +1 -0
- package/dist/arcgis/arcgis-vector-tile-server-source-loader-types.js +21 -0
- package/dist/arcgis/arcgis-vector-tile-server-source-loader-types.js.map +1 -0
- package/dist/arcgis/arcgis-vector-tile-server-source-loader.d.ts +66 -0
- package/dist/arcgis/arcgis-vector-tile-server-source-loader.d.ts.map +1 -0
- package/dist/arcgis/arcgis-vector-tile-server-source-loader.js +150 -0
- package/dist/arcgis/arcgis-vector-tile-server-source-loader.js.map +1 -0
- package/dist/arcgis-feature-query-types.d.ts +77 -0
- package/dist/arcgis-feature-query-types.d.ts.map +1 -0
- package/dist/arcgis-feature-query-types.js +5 -0
- package/dist/arcgis-feature-query-types.js.map +1 -0
- package/dist/arcgis-items.d.ts +64 -0
- package/dist/arcgis-items.d.ts.map +1 -0
- package/dist/arcgis-items.js +137 -0
- package/dist/arcgis-items.js.map +1 -0
- package/dist/arcgis-source-types.d.ts +372 -0
- package/dist/arcgis-source-types.d.ts.map +1 -0
- package/dist/arcgis-source-types.js +108 -0
- package/dist/arcgis-source-types.js.map +1 -0
- package/dist/authentication.d.ts +25 -0
- package/dist/authentication.d.ts.map +1 -0
- package/dist/authentication.js +94 -0
- package/dist/authentication.js.map +1 -0
- package/dist/bundled.d.ts +152 -0
- package/dist/bundled.d.ts.map +1 -0
- package/dist/bundled.js +34 -0
- package/dist/bundled.js.map +1 -0
- package/dist/index.cjs +25620 -0
- package/dist/index.cjs.map +6 -0
- package/dist/index.d.ts +24 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +11 -0
- package/dist/index.js.map +1 -0
- package/dist/service-registry.d.ts +18 -0
- package/dist/service-registry.d.ts.map +1 -0
- package/dist/service-registry.js +29 -0
- package/dist/service-registry.js.map +1 -0
- package/package.json +96 -0
- package/src/arcgis/arcgis-capability-graph.ts +297 -0
- package/src/arcgis/arcgis-feature-query.ts +442 -0
- package/src/arcgis/arcgis-feature-server-source-loader-types.ts +34 -0
- package/src/arcgis/arcgis-feature-server-source-loader.ts +373 -0
- package/src/arcgis/arcgis-image-server-source-loader-types.ts +34 -0
- package/src/arcgis/arcgis-image-server-source-loader.ts +186 -0
- package/src/arcgis/arcgis-image-tile-source-loader-types.ts +34 -0
- package/src/arcgis/arcgis-image-tile-source-loader.ts +192 -0
- package/src/arcgis/arcgis-map-tile-source-loader-types.ts +34 -0
- package/src/arcgis/arcgis-map-tile-source-loader.ts +248 -0
- package/src/arcgis/arcgis-scene-aggregation.ts +90 -0
- package/src/arcgis/arcgis-scene-server-source-loader-types.ts +36 -0
- package/src/arcgis/arcgis-scene-server-source-loader.ts +216 -0
- package/src/arcgis/arcgis-server.ts +61 -0
- package/src/arcgis/arcgis-url-utils.ts +26 -0
- package/src/arcgis/arcgis-vector-tile-server-source-loader-types.ts +36 -0
- package/src/arcgis/arcgis-vector-tile-server-source-loader.ts +196 -0
- package/src/arcgis-feature-query-types.ts +89 -0
- package/src/arcgis-items.ts +233 -0
- package/src/arcgis-source-types.ts +372 -0
- package/src/authentication.ts +118 -0
- package/src/bundled.ts +68 -0
- package/src/index.ts +70 -0
- package/src/service-registry.ts +43 -0
|
@@ -0,0 +1,280 @@
|
|
|
1
|
+
// loaders.gl
|
|
2
|
+
// SPDX-License-Identifier: MIT
|
|
3
|
+
// Copyright (c) vis.gl contributors
|
|
4
|
+
import { ArcGISAuthentication } from "../authentication.js";
|
|
5
|
+
import { ARCGIS_FEATURE_SERVER_SOURCE_LOADER_METADATA } from "../arcgis-source-types.js";
|
|
6
|
+
import { convertFeaturesToWKBArrowTable, convertGeojsonToBinaryFeatureCollection } from '@loaders.gl/gis';
|
|
7
|
+
import { DataSource } from '@loaders.gl/loader-utils';
|
|
8
|
+
import { buildArcGISResourceURL } from "./arcgis-url-utils.js";
|
|
9
|
+
import { ArcGISFeatureQueryClient } from "./arcgis-feature-query.js";
|
|
10
|
+
export { ArcGISFeatureQueryError } from "./arcgis-feature-query.js";
|
|
11
|
+
/** Runtime service loader for synchronous construction. */
|
|
12
|
+
export const ArcGISFeatureServerSourceLoaderWithParser = {
|
|
13
|
+
...ARCGIS_FEATURE_SERVER_SOURCE_LOADER_METADATA,
|
|
14
|
+
dataType: null,
|
|
15
|
+
batchType: null,
|
|
16
|
+
preload: undefined,
|
|
17
|
+
/** Supplies ArcGIS credentials after loading the selected implementation. */
|
|
18
|
+
getAuthentications: () => [ArcGISAuthentication],
|
|
19
|
+
createDataSource: (url, options, coreApi) => new ArcGISVectorSource(url, options, coreApi)
|
|
20
|
+
};
|
|
21
|
+
/**
|
|
22
|
+
* ArcGIS FeatureServer
|
|
23
|
+
* Note - exports a big API, that could be exposed here if there is a use case
|
|
24
|
+
* @see https://developers.arcgis.com/rest/services-reference/enterprise/feature-service.htm
|
|
25
|
+
*/
|
|
26
|
+
export class ArcGISVectorSource extends DataSource {
|
|
27
|
+
/** Cached ArcGIS FeatureServer metadata request. */
|
|
28
|
+
formatSpecificMetadata = null;
|
|
29
|
+
/** Creates a query source for a FeatureServer or queryable MapServer layer. */
|
|
30
|
+
constructor(url, options, coreApi) {
|
|
31
|
+
super(url, options, ARCGIS_FEATURE_SERVER_SOURCE_LOADER_METADATA.defaultOptions, coreApi);
|
|
32
|
+
}
|
|
33
|
+
/** Returns a schema inferred from ArcGIS FeatureServer metadata fields. */
|
|
34
|
+
async getSchema() {
|
|
35
|
+
const metadata = await this.getFormatSpecificMetadata();
|
|
36
|
+
return parseArcGISFeatureServerSchema(metadata);
|
|
37
|
+
}
|
|
38
|
+
/** Returns normalized VectorSource metadata. */
|
|
39
|
+
async getMetadata(options = {}) {
|
|
40
|
+
// Wait for raw metadata to load
|
|
41
|
+
const formatSpecificMetadata = await this.getFormatSpecificMetadata();
|
|
42
|
+
const metadata = parseArcGISFeatureServerMetadata(formatSpecificMetadata);
|
|
43
|
+
// Only add the big blob of source metadata if explicitly requested
|
|
44
|
+
if (options.formatSpecificMetadata) {
|
|
45
|
+
metadata.formatSpecificMetadata = formatSpecificMetadata;
|
|
46
|
+
}
|
|
47
|
+
return metadata;
|
|
48
|
+
}
|
|
49
|
+
/** Retrieves the complete filtered query, rejecting partial results before format conversion. */
|
|
50
|
+
async getFeatures(parameters) {
|
|
51
|
+
const result = await this.queryFeatures(parameters);
|
|
52
|
+
if (!result.complete) {
|
|
53
|
+
throw new Error(`Incomplete ArcGIS query (${result.reason}): ${result.loaded}/${result.expectedCount}. Use queryFeatures() to inspect partial results.`);
|
|
54
|
+
}
|
|
55
|
+
const features = result.data.features;
|
|
56
|
+
switch (parameters.format || 'arrow') {
|
|
57
|
+
case 'binary':
|
|
58
|
+
if (features.some(feature => !feature.geometry)) {
|
|
59
|
+
throw new Error('Binary output cannot retain null geometries; use geojson or arrow');
|
|
60
|
+
}
|
|
61
|
+
return convertGeojsonToBinaryFeatureCollection(features);
|
|
62
|
+
case 'geojson':
|
|
63
|
+
return result.data;
|
|
64
|
+
default:
|
|
65
|
+
return convertFeaturesToWKBArrowTable(features, {
|
|
66
|
+
encodingPreference: parameters.geoarrow?.encodingPreference
|
|
67
|
+
});
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
/** Collects a bounded query and returns explicit completeness evidence alongside its data. */
|
|
71
|
+
async queryFeatures(parameters = {}) {
|
|
72
|
+
let result;
|
|
73
|
+
const features = [];
|
|
74
|
+
for await (const page of this.queryFeaturePages(parameters)) {
|
|
75
|
+
for (const feature of page.data.features)
|
|
76
|
+
features.push(feature);
|
|
77
|
+
result = page;
|
|
78
|
+
}
|
|
79
|
+
return { ...result, data: { shape: 'geojson-table', type: 'FeatureCollection', features } };
|
|
80
|
+
}
|
|
81
|
+
/** Streams unique records with cumulative progress; breaking iteration stops subsequent work. */
|
|
82
|
+
queryFeaturePages(parameters = {}) {
|
|
83
|
+
return this.createQueryClient(parameters).getPages(parameters);
|
|
84
|
+
}
|
|
85
|
+
/** Requests one page, explicitly marked incomplete regardless of the server transfer flag. */
|
|
86
|
+
queryFeaturePage(parameters = {}) {
|
|
87
|
+
return this.createQueryClient(parameters).getPage(parameters);
|
|
88
|
+
}
|
|
89
|
+
/** Returns the current count for the selected query filters. */
|
|
90
|
+
queryCount(parameters = {}) {
|
|
91
|
+
return this.createQueryClient(parameters).getCount();
|
|
92
|
+
}
|
|
93
|
+
/** Returns object IDs with truncation information; use queryFeatures() for complete retrieval. */
|
|
94
|
+
queryObjectIds(parameters = {}) {
|
|
95
|
+
return this.createQueryClient(parameters).getObjectIds();
|
|
96
|
+
}
|
|
97
|
+
/** Returns query bounds and their explicit spatial reference. */
|
|
98
|
+
queryExtent(parameters = {}) {
|
|
99
|
+
return this.createQueryClient(parameters).getExtent();
|
|
100
|
+
}
|
|
101
|
+
/** Shares transport and query filters across summary and data operations. */
|
|
102
|
+
createQueryClient(parameters) {
|
|
103
|
+
return new ArcGISFeatureQueryClient(this.getLayerURL(parameters), this.fetch.bind(this), this.getQueryParameters(parameters), parameters.signal);
|
|
104
|
+
}
|
|
105
|
+
/** Requests the raw ArcGIS FeatureServer metadata document. */
|
|
106
|
+
async _getFormatSpecificMetadata() {
|
|
107
|
+
// PJSON is formatted by a bit slower than JSON
|
|
108
|
+
const url = this.metadataURL();
|
|
109
|
+
return await new ArcGISFeatureQueryClient(url, this.fetch.bind(this), {}).request('');
|
|
110
|
+
}
|
|
111
|
+
/** Loads and caches the raw ArcGIS FeatureServer metadata. */
|
|
112
|
+
async getFormatSpecificMetadata() {
|
|
113
|
+
this.formatSpecificMetadata ||= this._getFormatSpecificMetadata().catch(error => {
|
|
114
|
+
this.formatSpecificMetadata = null;
|
|
115
|
+
throw error;
|
|
116
|
+
});
|
|
117
|
+
return await this.formatSpecificMetadata;
|
|
118
|
+
}
|
|
119
|
+
/** Builds a metadata URL for the ArcGIS FeatureServer endpoint. */
|
|
120
|
+
metadataURL(options) {
|
|
121
|
+
return this.getUrl('', { f: 'pjson', ...options?.parameters });
|
|
122
|
+
}
|
|
123
|
+
/** Builds a query URL from generic vector source parameters. */
|
|
124
|
+
getFeaturesURL(parameters) {
|
|
125
|
+
return buildArcGISResourceURL(this.getLayerURL(parameters), 'query', this.getQueryParameters(parameters));
|
|
126
|
+
}
|
|
127
|
+
/** Selects exactly one layer; service roots must not silently query an unspecified layer. */
|
|
128
|
+
getLayerURL(parameters) {
|
|
129
|
+
const url = new URL(this.url);
|
|
130
|
+
const layerIdentifiers = Array.isArray(parameters.layers)
|
|
131
|
+
? parameters.layers
|
|
132
|
+
: parameters.layers === undefined
|
|
133
|
+
? []
|
|
134
|
+
: [parameters.layers];
|
|
135
|
+
if (layerIdentifiers.length > 1)
|
|
136
|
+
throw new Error('ArcGIS feature queries require exactly one layer');
|
|
137
|
+
const match = /\/(?:FeatureServer|MapServer)(?:\/(\d+))?\/?$/i.exec(url.pathname);
|
|
138
|
+
if (!match)
|
|
139
|
+
throw new Error('Expected an ArcGIS FeatureServer or MapServer layer URL');
|
|
140
|
+
const layer = layerIdentifiers[0];
|
|
141
|
+
if (match[1]) {
|
|
142
|
+
if (layer !== undefined && String(layer) !== match[1])
|
|
143
|
+
throw new Error('Layer selection conflicts with the endpoint URL');
|
|
144
|
+
return url.toString();
|
|
145
|
+
}
|
|
146
|
+
if (layer === undefined || !/^\d+$/.test(String(layer)))
|
|
147
|
+
throw new Error('Select a layer ID when querying an ArcGIS service root');
|
|
148
|
+
return buildArcGISResourceURL(this.url, String(layer), {});
|
|
149
|
+
}
|
|
150
|
+
/** Applies source defaults and per-request filters consistently across all query operations. */
|
|
151
|
+
getQueryParameters(parameters) {
|
|
152
|
+
const defaultParameters = this.options['arcgis-feature-server']?.queryParameters || {};
|
|
153
|
+
const outputSpatialReference = normalizeArcGISSpatialReference(parameters.crs) || 4326;
|
|
154
|
+
const requestSpatialReference = normalizeArcGISSpatialReference(parameters.requestCrs) || outputSpatialReference;
|
|
155
|
+
const queryParameters = {
|
|
156
|
+
returnGeometry: true,
|
|
157
|
+
where: '1=1',
|
|
158
|
+
outFields: '*',
|
|
159
|
+
outSR: outputSpatialReference,
|
|
160
|
+
inSR: requestSpatialReference,
|
|
161
|
+
f: 'geojson',
|
|
162
|
+
...defaultParameters,
|
|
163
|
+
...parameters.query
|
|
164
|
+
};
|
|
165
|
+
if (parameters.crs !== undefined)
|
|
166
|
+
queryParameters.outSR = outputSpatialReference;
|
|
167
|
+
if (parameters.requestCrs !== undefined)
|
|
168
|
+
queryParameters.inSR = requestSpatialReference;
|
|
169
|
+
if (parameters.boundingBox) {
|
|
170
|
+
const coordinates = parameters.boundingBox.flat();
|
|
171
|
+
if (!coordinates.every(Number.isFinite) ||
|
|
172
|
+
coordinates[0] > coordinates[2] ||
|
|
173
|
+
coordinates[1] > coordinates[3]) {
|
|
174
|
+
throw new Error('ArcGIS boundingBox must contain finite ordered coordinates; split antimeridian queries');
|
|
175
|
+
}
|
|
176
|
+
queryParameters.geometry = coordinates.join(',');
|
|
177
|
+
queryParameters.geometryType = 'esriGeometryEnvelope';
|
|
178
|
+
queryParameters.spatialRel ||= 'esriSpatialRelIntersects';
|
|
179
|
+
}
|
|
180
|
+
return queryParameters;
|
|
181
|
+
}
|
|
182
|
+
/** Builds an ArcGIS FeatureServer URL. */
|
|
183
|
+
getUrl(path, options, extra) {
|
|
184
|
+
return buildArcGISResourceURL(this.url, path, { ...options, ...extra });
|
|
185
|
+
}
|
|
186
|
+
}
|
|
187
|
+
/** Normalizes layer and nonspatial table metadata. */
|
|
188
|
+
function parseArcGISFeatureServerMetadata(json) {
|
|
189
|
+
const layers = [];
|
|
190
|
+
for (const layer of [...(json.layers || []), ...(json.tables || [])]) {
|
|
191
|
+
const extent = layer.extent;
|
|
192
|
+
const spatialReference = layer.spatialReference || extent?.spatialReference;
|
|
193
|
+
layers.push({
|
|
194
|
+
name: layer.id === undefined ? layer.name : String(layer.id),
|
|
195
|
+
title: layer.name,
|
|
196
|
+
crs: getArcGISCoordinateReferenceSystems(spatialReference),
|
|
197
|
+
boundingBox: normalizeArcGISExtent(extent)
|
|
198
|
+
});
|
|
199
|
+
}
|
|
200
|
+
if (!layers.length && (json.id !== undefined || json.name)) {
|
|
201
|
+
const extent = json.extent;
|
|
202
|
+
layers.push({
|
|
203
|
+
name: json.id === undefined ? json.name : String(json.id),
|
|
204
|
+
title: json.name,
|
|
205
|
+
crs: getArcGISCoordinateReferenceSystems(json.spatialReference || extent?.spatialReference),
|
|
206
|
+
boundingBox: normalizeArcGISExtent(extent)
|
|
207
|
+
});
|
|
208
|
+
}
|
|
209
|
+
return {
|
|
210
|
+
// version: json.currentVersion || '',
|
|
211
|
+
title: json.serviceDescription || '',
|
|
212
|
+
name: json.serviceDescription || '',
|
|
213
|
+
abstract: json.description || '',
|
|
214
|
+
keywords: [],
|
|
215
|
+
// attrribution: json.copyrightText || ''.
|
|
216
|
+
// crs: 'EPSG:4326',
|
|
217
|
+
layers
|
|
218
|
+
};
|
|
219
|
+
}
|
|
220
|
+
/** Normalizes an ArcGIS spatial reference to a one-element CRS list. */
|
|
221
|
+
function getArcGISCoordinateReferenceSystems(spatialReference) {
|
|
222
|
+
const wellKnownIdentifier = spatialReference?.latestWkid || spatialReference?.wkid;
|
|
223
|
+
return wellKnownIdentifier ? [`EPSG:${wellKnownIdentifier}`] : undefined;
|
|
224
|
+
}
|
|
225
|
+
/** Normalizes an ArcGIS extent to the loaders.gl two-corner shape. */
|
|
226
|
+
function normalizeArcGISExtent(extent) {
|
|
227
|
+
return extent && [extent.xmin, extent.ymin, extent.xmax, extent.ymax].every(Number.isFinite)
|
|
228
|
+
? [
|
|
229
|
+
[extent.xmin, extent.ymin],
|
|
230
|
+
[extent.xmax, extent.ymax]
|
|
231
|
+
]
|
|
232
|
+
: undefined;
|
|
233
|
+
}
|
|
234
|
+
/** Normalizes EPSG-prefixed CRS strings to ArcGIS WKID values. */
|
|
235
|
+
function normalizeArcGISSpatialReference(spatialReference) {
|
|
236
|
+
if (typeof spatialReference === 'string') {
|
|
237
|
+
const match = /^EPSG:(\d+)$/i.exec(spatialReference);
|
|
238
|
+
if (match) {
|
|
239
|
+
return match[1];
|
|
240
|
+
}
|
|
241
|
+
}
|
|
242
|
+
if (spatialReference !== undefined && !/^\d+$/.test(String(spatialReference))) {
|
|
243
|
+
throw new Error('ArcGIS query CRS must be a numeric WKID or EPSG identifier');
|
|
244
|
+
}
|
|
245
|
+
return spatialReference;
|
|
246
|
+
}
|
|
247
|
+
/** Builds a schema from ArcGIS FeatureServer metadata fields. */
|
|
248
|
+
function parseArcGISFeatureServerSchema(json) {
|
|
249
|
+
const fields = Array.isArray(json.fields)
|
|
250
|
+
? json.fields.map((field) => ({
|
|
251
|
+
name: field.name,
|
|
252
|
+
type: field.type === 'esriFieldTypeOID' && field.length === 8
|
|
253
|
+
? 'int64'
|
|
254
|
+
: getSchemaTypeFromArcGISFieldType(field.type),
|
|
255
|
+
nullable: field.nullable
|
|
256
|
+
}))
|
|
257
|
+
: [];
|
|
258
|
+
return { metadata: {}, fields };
|
|
259
|
+
}
|
|
260
|
+
/** Maps common ArcGIS field types to loaders.gl schema type strings. */
|
|
261
|
+
function getSchemaTypeFromArcGISFieldType(type) {
|
|
262
|
+
switch (type) {
|
|
263
|
+
case 'esriFieldTypeDouble':
|
|
264
|
+
return 'float64';
|
|
265
|
+
case 'esriFieldTypeSingle':
|
|
266
|
+
return 'float32';
|
|
267
|
+
case 'esriFieldTypeSmallInteger':
|
|
268
|
+
return 'int16';
|
|
269
|
+
case 'esriFieldTypeBigInteger':
|
|
270
|
+
return 'int64';
|
|
271
|
+
case 'esriFieldTypeInteger':
|
|
272
|
+
case 'esriFieldTypeOID':
|
|
273
|
+
return 'int32';
|
|
274
|
+
case 'esriFieldTypeDate':
|
|
275
|
+
return 'timestamp-millisecond';
|
|
276
|
+
default:
|
|
277
|
+
return 'utf8';
|
|
278
|
+
}
|
|
279
|
+
}
|
|
280
|
+
//# sourceMappingURL=arcgis-feature-server-source-loader.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"arcgis-feature-server-source-loader.js","sourceRoot":"","sources":["../../src/arcgis/arcgis-feature-server-source-loader.ts"],"names":[],"mappings":"AAAA,aAAa;AACb,+BAA+B;AAC/B,oCAAoC;AAEpC,OAAO,EAAC,oBAAoB,EAAC,6BAA0B;AACvD,OAAO,EAAC,4CAA4C,EAAC,kCAA+B;AAOpF,OAAO,EACL,8BAA8B,EAC9B,uCAAuC,EACxC,MAAM,iBAAiB,CAAC;AASzB,OAAO,EAAC,UAAU,EAAC,MAAM,0BAA0B,CAAC;AACpD,OAAO,EAAC,sBAAsB,EAAC,8BAA2B;AAC1D,OAAO,EAAC,wBAAwB,EAAC,kCAA+B;AAQhE,OAAO,EAAC,uBAAuB,EAAC,kCAA+B;AAE/D,2DAA2D;AAC3D,MAAM,CAAC,MAAM,yCAAyC,GAAG;IACvD,GAAG,4CAA4C;IAC/C,QAAQ,EAAE,IAAqC;IAC/C,SAAS,EAAE,IAAa;IACxB,OAAO,EAAE,SAAS;IAClB,6EAA6E;IAC7E,kBAAkB,EAAE,GAAG,EAAE,CAAC,CAAC,oBAAoB,CAAC;IAChD,gBAAgB,EAAE,CAChB,GAAW,EACX,OAA+C,EAC/C,OAAiB,EACG,EAAE,CAAC,IAAI,kBAAkB,CAAC,GAAG,EAAE,OAAO,EAAE,OAAO,CAAC;CACnB,CAAC;AAEtD;;;;GAIG;AACH,MAAM,OAAO,kBACX,SAAQ,UAA0D;IAGlE,oDAAoD;IAC1C,sBAAsB,GAAwB,IAAI,CAAC;IAE7D,+EAA+E;IAC/E,YAAY,GAAW,EAAE,OAA+C,EAAE,OAAiB;QACzF,KAAK,CAAC,GAAG,EAAE,OAAO,EAAE,4CAA4C,CAAC,cAAc,EAAE,OAAO,CAAC,CAAC;IAC5F,CAAC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OAAO,CAAC;QACjB,KAAK,sBAAsB,CAAC;QAC5B,KAAK,kBAAkB;YACrB,OAAO,OAAO,CAAC;QACjB,KAAK,mBAAmB;YACtB,OAAO,uBAAuB,CAAC;QACjC;YACE,OAAO,MAAM,CAAC;IAClB,CAAC;AACH,CAAC"}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import type { CoreAPI, SourceLoader } from '@loaders.gl/loader-utils';
|
|
2
|
+
import type { ArcGISImageSource } from "./arcgis-image-server-source-loader.js";
|
|
3
|
+
import type { ArcGISImageSourceLoaderProps } from "../arcgis-source-types.js";
|
|
4
|
+
/** Loads the ArcGISImageServerSourceLoader implementation on first asynchronous use. */
|
|
5
|
+
declare function preloadArcGISImageServerSourceLoader(): Promise<SourceLoader<ArcGISImageSource>>;
|
|
6
|
+
/** Lightweight service descriptor; use load() or the synchronous /bundled entrypoint. */
|
|
7
|
+
export declare const ArcGISImageServerSourceLoader: {
|
|
8
|
+
readonly dataType: ArcGISImageSource;
|
|
9
|
+
readonly batchType: never;
|
|
10
|
+
readonly preload: typeof preloadArcGISImageServerSourceLoader;
|
|
11
|
+
/** Requires the runtime loader when constructing a source synchronously. */
|
|
12
|
+
readonly createDataSource: (_url: string, _options: ArcGISImageSourceLoaderProps, _coreApi?: CoreAPI) => ArcGISImageSource;
|
|
13
|
+
readonly name: "ArcGISImageServer";
|
|
14
|
+
readonly id: "arcgis-image-server";
|
|
15
|
+
readonly module: "arcgis";
|
|
16
|
+
readonly version: "0.0.0";
|
|
17
|
+
readonly extensions: [];
|
|
18
|
+
readonly mimeTypes: [];
|
|
19
|
+
readonly type: "arcgis-image-server";
|
|
20
|
+
readonly fromUrl: true;
|
|
21
|
+
readonly fromBlob: false;
|
|
22
|
+
readonly options: {
|
|
23
|
+
readonly 'arcgis-image-server': {};
|
|
24
|
+
};
|
|
25
|
+
readonly defaultOptions: {
|
|
26
|
+
readonly 'arcgis-image-server': {};
|
|
27
|
+
};
|
|
28
|
+
readonly testURL: (url: string) => boolean;
|
|
29
|
+
};
|
|
30
|
+
export {};
|
|
31
|
+
//# sourceMappingURL=arcgis-image-server-source-loader-types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"arcgis-image-server-source-loader-types.d.ts","sourceRoot":"","sources":["../../src/arcgis/arcgis-image-server-source-loader-types.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAC,OAAO,EAAE,YAAY,EAAC,MAAM,0BAA0B,CAAC;AACpE,OAAO,KAAK,EAAC,iBAAiB,EAAC,+CAA4C;AAC3E,OAAO,KAAK,EAAC,4BAA4B,EAAC,kCAA+B;AAEzE,wFAAwF;AACxF,iBAAe,oCAAoC,IAAI,OAAO,CAAC,YAAY,CAAC,iBAAiB,CAAC,CAAC,CAK9F;AAED,yFAAyF;AACzF,eAAO,MAAM,6BAA6B;uBAEX,iBAAiB;wBAC3B,KAAK;;IAExB,4EAA4E;sCAEpE,MAAM,YACF,4BAA4B,aAC3B,OAAO,KACjB,iBAAiB;;;;;;;;;;;;;;;;;CAK8B,CAAC"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
// loaders.gl
|
|
2
|
+
// SPDX-License-Identifier: MIT
|
|
3
|
+
// Copyright (c) vis.gl contributors
|
|
4
|
+
import { ARCGIS_IMAGE_SERVER_SOURCE_LOADER_METADATA } from "../arcgis-source-types.js";
|
|
5
|
+
/** Loads the ArcGISImageServerSourceLoader implementation on first asynchronous use. */
|
|
6
|
+
async function preloadArcGISImageServerSourceLoader() {
|
|
7
|
+
const { ArcGISImageServerSourceLoaderWithParser } = await import('@loaders.gl/arcgis/arcgis-image-server-source-loader');
|
|
8
|
+
return ArcGISImageServerSourceLoaderWithParser;
|
|
9
|
+
}
|
|
10
|
+
/** Lightweight service descriptor; use load() or the synchronous /bundled entrypoint. */
|
|
11
|
+
export const ArcGISImageServerSourceLoader = {
|
|
12
|
+
...ARCGIS_IMAGE_SERVER_SOURCE_LOADER_METADATA,
|
|
13
|
+
dataType: null,
|
|
14
|
+
batchType: null,
|
|
15
|
+
preload: preloadArcGISImageServerSourceLoader,
|
|
16
|
+
/** Requires the runtime loader when constructing a source synchronously. */
|
|
17
|
+
createDataSource(_url, _options, _coreApi) {
|
|
18
|
+
throw new Error('ArcGISImageServerSourceLoader requires async load() or an @loaders.gl/arcgis/bundled import');
|
|
19
|
+
}
|
|
20
|
+
};
|
|
21
|
+
//# sourceMappingURL=arcgis-image-server-source-loader-types.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"arcgis-image-server-source-loader-types.js","sourceRoot":"","sources":["../../src/arcgis/arcgis-image-server-source-loader-types.ts"],"names":[],"mappings":"AAAA,aAAa;AACb,+BAA+B;AAC/B,oCAAoC;AAEpC,OAAO,EAAC,0CAA0C,EAAC,kCAA+B;AAKlF,wFAAwF;AACxF,KAAK,UAAU,oCAAoC;IACjD,MAAM,EAAC,uCAAuC,EAAC,GAAG,MAAM,MAAM,CAC5D,sDAAsD,CACvD,CAAC;IACF,OAAO,uCAAuC,CAAC;AACjD,CAAC;AAED,yFAAyF;AACzF,MAAM,CAAC,MAAM,6BAA6B,GAAG;IAC3C,GAAG,0CAA0C;IAC7C,QAAQ,EAAE,IAAoC;IAC9C,SAAS,EAAE,IAAa;IACxB,OAAO,EAAE,oCAAoC;IAC7C,4EAA4E;IAC5E,gBAAgB,CACd,IAAY,EACZ,QAAsC,EACtC,QAAkB;QAElB,MAAM,IAAI,KAAK,CACb,6FAA6F,CAC9F,CAAC;IACJ,CAAC;CACiD,CAAC"}
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
import { ArcGISAuthentication } from "../authentication.js";
|
|
2
|
+
import type { ArcGISImageSourceLoaderProps, ArcGISExportImageParameters } from "../arcgis-source-types.js";
|
|
3
|
+
import type { ImageType } from '@loaders.gl/images';
|
|
4
|
+
import type { CoreAPI, ImageSource, ImageSourceMetadata, GetImageParameters } from '@loaders.gl/loader-utils';
|
|
5
|
+
import { DataSource } from '@loaders.gl/loader-utils';
|
|
6
|
+
import type { LERCData } from '@loaders.gl/lerc';
|
|
7
|
+
/** Runtime service loader for synchronous construction. */
|
|
8
|
+
export declare const ArcGISImageServerSourceLoaderWithParser: {
|
|
9
|
+
readonly dataType: ArcGISImageSource;
|
|
10
|
+
readonly batchType: never;
|
|
11
|
+
readonly preload: undefined;
|
|
12
|
+
/** Supplies ArcGIS credentials after loading the selected implementation. */
|
|
13
|
+
readonly getAuthentications: () => (typeof ArcGISAuthentication)[];
|
|
14
|
+
readonly createDataSource: (url: string, props: ArcGISImageSourceLoaderProps, coreApi?: CoreAPI) => ArcGISImageSource;
|
|
15
|
+
readonly name: "ArcGISImageServer";
|
|
16
|
+
readonly id: "arcgis-image-server";
|
|
17
|
+
readonly module: "arcgis";
|
|
18
|
+
readonly version: "0.0.0";
|
|
19
|
+
readonly extensions: [];
|
|
20
|
+
readonly mimeTypes: [];
|
|
21
|
+
readonly type: "arcgis-image-server";
|
|
22
|
+
readonly fromUrl: true;
|
|
23
|
+
readonly fromBlob: false;
|
|
24
|
+
readonly options: {
|
|
25
|
+
readonly 'arcgis-image-server': {};
|
|
26
|
+
};
|
|
27
|
+
readonly defaultOptions: {
|
|
28
|
+
readonly 'arcgis-image-server': {};
|
|
29
|
+
};
|
|
30
|
+
readonly testURL: (url: string) => boolean;
|
|
31
|
+
};
|
|
32
|
+
/**
|
|
33
|
+
* ArcGIS ImageServer
|
|
34
|
+
* Note - exports a big API, that could be exposed here if there is a use case
|
|
35
|
+
* @see https://developers.arcgis.com/rest/services-reference/enterprise/image-service.htm
|
|
36
|
+
*/
|
|
37
|
+
export declare class ArcGISImageSource extends DataSource<string, ArcGISImageSourceLoaderProps> implements ImageSource {
|
|
38
|
+
constructor(url: string, props: ArcGISImageSourceLoaderProps, coreApi?: CoreAPI);
|
|
39
|
+
/** Returns normalized ImageSource metadata. */
|
|
40
|
+
getMetadata(): Promise<ImageSourceMetadata>;
|
|
41
|
+
/** Requests an image from generic ImageSource parameters. */
|
|
42
|
+
getImage(parameters: GetImageParameters): Promise<ImageType>;
|
|
43
|
+
/** Requests the ArcGIS ImageServer metadata document. */
|
|
44
|
+
metadata(): Promise<unknown>;
|
|
45
|
+
/** Requests an exported image from the ArcGIS ImageServer endpoint. */
|
|
46
|
+
exportImage(options: ArcGISExportImageParameters, signal?: AbortSignal): Promise<ImageType>;
|
|
47
|
+
/** Requests an analytical LERC raster from the ArcGIS ImageServer endpoint. */
|
|
48
|
+
exportRaster(options: ArcGISExportImageParameters, signal?: AbortSignal): Promise<LERCData>;
|
|
49
|
+
/** Builds a metadata URL for the ArcGIS ImageServer endpoint. */
|
|
50
|
+
metadataURL(options?: {
|
|
51
|
+
parameters?: Record<string, unknown>;
|
|
52
|
+
}): string;
|
|
53
|
+
/** Builds an exportImage URL for the ArcGIS ImageServer endpoint. */
|
|
54
|
+
exportImageURL(options: ArcGISExportImageParameters): string;
|
|
55
|
+
/** Builds an ArcGIS ImageServer URL. */
|
|
56
|
+
protected getUrl(path: string, options: Record<string, unknown>, extra?: Record<string, unknown>): string;
|
|
57
|
+
/** Checks an ArcGIS ImageServer response. */
|
|
58
|
+
protected checkResponse(response: Response): Promise<void>;
|
|
59
|
+
}
|
|
60
|
+
//# sourceMappingURL=arcgis-image-server-source-loader.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"arcgis-image-server-source-loader.d.ts","sourceRoot":"","sources":["../../src/arcgis/arcgis-image-server-source-loader.ts"],"names":[],"mappings":"AAIA,OAAO,EAAC,oBAAoB,EAAC,6BAA0B;AAEvD,OAAO,KAAK,EACV,4BAA4B,EAC5B,2BAA2B,EAC5B,kCAA+B;AAEhC,OAAO,KAAK,EAAC,SAAS,EAAC,MAAM,oBAAoB,CAAC;AAElD,OAAO,KAAK,EACV,OAAO,EAEP,WAAW,EACX,mBAAmB,EACnB,kBAAkB,EACnB,MAAM,0BAA0B,CAAC;AAClC,OAAO,EAAC,UAAU,EAAC,MAAM,0B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AC9B,MAAM;IAIT,6CAA6C;cAC7B,aAAa,CAAC,QAAQ,EAAE,QAAQ,GAAG,OAAO,CAAC,IAAI,CAAC;CAOjE"}
|
|
@@ -0,0 +1,130 @@
|
|
|
1
|
+
// loaders.gl
|
|
2
|
+
// SPDX-License-Identifier: MIT
|
|
3
|
+
// Copyright (c) vis.gl contributors
|
|
4
|
+
import { ArcGISAuthentication } from "../authentication.js";
|
|
5
|
+
import { ARCGIS_IMAGE_SERVER_SOURCE_LOADER_METADATA } from "../arcgis-source-types.js";
|
|
6
|
+
import { ImageLoader } from '@loaders.gl/images';
|
|
7
|
+
import { DataSource } from '@loaders.gl/loader-utils';
|
|
8
|
+
import { LERCLoader } from '@loaders.gl/lerc';
|
|
9
|
+
import { buildArcGISResourceURL } from "./arcgis-url-utils.js";
|
|
10
|
+
/** Runtime service loader for synchronous construction. */
|
|
11
|
+
export const ArcGISImageServerSourceLoaderWithParser = {
|
|
12
|
+
...ARCGIS_IMAGE_SERVER_SOURCE_LOADER_METADATA,
|
|
13
|
+
dataType: null,
|
|
14
|
+
batchType: null,
|
|
15
|
+
preload: undefined,
|
|
16
|
+
/** Supplies ArcGIS credentials after loading the selected implementation. */
|
|
17
|
+
getAuthentications: () => [ArcGISAuthentication],
|
|
18
|
+
createDataSource: (url, props, coreApi) => new ArcGISImageSource(url, props, coreApi)
|
|
19
|
+
};
|
|
20
|
+
/**
|
|
21
|
+
* ArcGIS ImageServer
|
|
22
|
+
* Note - exports a big API, that could be exposed here if there is a use case
|
|
23
|
+
* @see https://developers.arcgis.com/rest/services-reference/enterprise/image-service.htm
|
|
24
|
+
*/
|
|
25
|
+
export class ArcGISImageSource extends DataSource {
|
|
26
|
+
constructor(url, props, coreApi) {
|
|
27
|
+
super(url, props, ARCGIS_IMAGE_SERVER_SOURCE_LOADER_METADATA.defaultOptions, coreApi);
|
|
28
|
+
}
|
|
29
|
+
/** Returns normalized ImageSource metadata. */
|
|
30
|
+
async getMetadata() {
|
|
31
|
+
return normalizeArcGISImageServerMetadata(await this.metadata());
|
|
32
|
+
}
|
|
33
|
+
/** Requests an image from generic ImageSource parameters. */
|
|
34
|
+
async getImage(parameters) {
|
|
35
|
+
const { boundingBox, width, height, crs, format, signal } = parameters;
|
|
36
|
+
const spatialReference = normalizeArcGISSpatialReference(crs) || '4326';
|
|
37
|
+
const imageParameters = {
|
|
38
|
+
bbox: [...boundingBox[0], ...boundingBox[1]],
|
|
39
|
+
bboxSR: spatialReference,
|
|
40
|
+
imageSR: spatialReference,
|
|
41
|
+
width,
|
|
42
|
+
height,
|
|
43
|
+
format: format === 'image/png' ? 'png' : undefined
|
|
44
|
+
};
|
|
45
|
+
return await this.exportImage(imageParameters, signal);
|
|
46
|
+
}
|
|
47
|
+
/** Requests the ArcGIS ImageServer metadata document. */
|
|
48
|
+
async metadata() {
|
|
49
|
+
const response = await this.fetch(this.metadataURL());
|
|
50
|
+
await this.checkResponse(response);
|
|
51
|
+
return await response.json();
|
|
52
|
+
}
|
|
53
|
+
/** Requests an exported image from the ArcGIS ImageServer endpoint. */
|
|
54
|
+
async exportImage(options, signal) {
|
|
55
|
+
const response = await this.fetch(this.exportImageURL(options), signal ? { signal } : undefined);
|
|
56
|
+
await this.checkResponse(response);
|
|
57
|
+
const arrayBuffer = await response.arrayBuffer();
|
|
58
|
+
return (await this.coreApi.parse(arrayBuffer, ImageLoader, this.loadOptions));
|
|
59
|
+
}
|
|
60
|
+
/** Requests an analytical LERC raster from the ArcGIS ImageServer endpoint. */
|
|
61
|
+
async exportRaster(options, signal) {
|
|
62
|
+
const response = await this.fetch(this.exportImageURL({ ...options, format: 'lerc' }), signal ? { signal } : undefined);
|
|
63
|
+
await this.checkResponse(response);
|
|
64
|
+
return (await this.coreApi.parse(await response.arrayBuffer(), LERCLoader, this.loadOptions));
|
|
65
|
+
}
|
|
66
|
+
/** Builds a metadata URL for the ArcGIS ImageServer endpoint. */
|
|
67
|
+
metadataURL(options) {
|
|
68
|
+
return this.getUrl('', { f: 'pjson', ...options?.parameters });
|
|
69
|
+
}
|
|
70
|
+
/** Builds an exportImage URL for the ArcGIS ImageServer endpoint. */
|
|
71
|
+
exportImageURL(options) {
|
|
72
|
+
const defaultParameters = this.options['arcgis-image-server']?.exportImageParameters || {};
|
|
73
|
+
const { width, height, ...parameters } = { ...defaultParameters, ...options };
|
|
74
|
+
return this.getUrl('exportImage', {
|
|
75
|
+
...parameters,
|
|
76
|
+
bbox: parameters.bbox,
|
|
77
|
+
size: [width, height],
|
|
78
|
+
f: parameters.f || 'image'
|
|
79
|
+
});
|
|
80
|
+
}
|
|
81
|
+
/** Builds an ArcGIS ImageServer URL. */
|
|
82
|
+
getUrl(path, options, extra) {
|
|
83
|
+
return buildArcGISResourceURL(this.url, path, { ...options, ...extra });
|
|
84
|
+
}
|
|
85
|
+
/** Checks an ArcGIS ImageServer response. */
|
|
86
|
+
async checkResponse(response) {
|
|
87
|
+
if (!response.ok) {
|
|
88
|
+
throw new Error(response.statusText || `ArcGIS ImageServer request failed: ${response.status}`);
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
/** Normalizes EPSG-prefixed CRS strings to ArcGIS WKID values. */
|
|
93
|
+
function normalizeArcGISSpatialReference(spatialReference) {
|
|
94
|
+
if (typeof spatialReference === 'string') {
|
|
95
|
+
const match = /^EPSG:(\d+)$/i.exec(spatialReference);
|
|
96
|
+
if (match) {
|
|
97
|
+
return match[1];
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
return spatialReference;
|
|
101
|
+
}
|
|
102
|
+
/** Normalizes ArcGIS ImageServer metadata to the generic ImageSource metadata shape. */
|
|
103
|
+
function normalizeArcGISImageServerMetadata(metadata) {
|
|
104
|
+
const arcgisMetadata = metadata;
|
|
105
|
+
const extent = arcgisMetadata.fullExtent || arcgisMetadata.extent;
|
|
106
|
+
const spatialReference = arcgisMetadata.spatialReference || extent?.spatialReference;
|
|
107
|
+
const wellKnownIdentifier = spatialReference?.latestWkid || spatialReference?.wkid;
|
|
108
|
+
const boundingBox = extent && [extent.xmin, extent.ymin, extent.xmax, extent.ymax].every(Number.isFinite)
|
|
109
|
+
? [
|
|
110
|
+
[extent.xmin, extent.ymin],
|
|
111
|
+
[extent.xmax, extent.ymax]
|
|
112
|
+
]
|
|
113
|
+
: undefined;
|
|
114
|
+
const name = arcgisMetadata.name || arcgisMetadata.serviceDescription || '';
|
|
115
|
+
return {
|
|
116
|
+
name,
|
|
117
|
+
title: name,
|
|
118
|
+
abstract: arcgisMetadata.description || arcgisMetadata.serviceDescription || '',
|
|
119
|
+
keywords: Array.isArray(arcgisMetadata.keywords) ? arcgisMetadata.keywords : [],
|
|
120
|
+
layers: [
|
|
121
|
+
{
|
|
122
|
+
name,
|
|
123
|
+
title: name,
|
|
124
|
+
crs: wellKnownIdentifier ? [`EPSG:${wellKnownIdentifier}`] : undefined,
|
|
125
|
+
boundingBox
|
|
126
|
+
}
|
|
127
|
+
]
|
|
128
|
+
};
|
|
129
|
+
}
|
|
130
|
+
//# sourceMappingURL=arcgis-image-server-source-loader.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"arcgis-image-server-source-loader.js","sourceRoot":"","sources":["../../src/arcgis/arcgis-image-server-source-loader.ts"],"names":[],"mappings":"AAAA,aAAa;AACb,+BAA+B;AAC/B,oCAAoC;AAEpC,OAAO,EAAC,oBAAoB,EAAC,6BAA0B;AACvD,OAAO,EAAC,0CAA0C,EAAC,kCAA+B;AAOlF,OAAO,EAAC,WAAW,EAAC,MAAM,oBAAoB,CAAC;AAQ/C,OAAO,EAAC,UAAU,EAAC,MAAM,0BAA0B,CAAC;AAEpD,OAAO,EAAC,UAAU,EAAC,MAAM,kBAAkB,CAAC;AAC5C,OAAO,EAAC,sBAAsB,EAAC,8BAA2B;AAE1D,2DAA2D;AAC3D,MAAM,CAAC,MAAM,uCAAuC,GAAG;IACrD,GAAG,0CAA0C;IAC7C,QAAQ,EAAE,IAAoC;IAC9C,SAAS,EAA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BAAmB,EAAE,CAAC,CAAC,CAAC,CAAC,SAAS;gBACtE,WAAW;aACZ;SACF;KACF,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import type { CoreAPI, SourceLoader } from '@loaders.gl/loader-utils';
|
|
2
|
+
import type { ArcGISImageTileSource } from "./arcgis-image-tile-source-loader.js";
|
|
3
|
+
import type { ArcGISImageTileSourceLoaderOptions } from "../arcgis-source-types.js";
|
|
4
|
+
/** Loads the ArcGISImageTileSourceLoader implementation on first asynchronous use. */
|
|
5
|
+
declare function preloadArcGISImageTileSourceLoader(): Promise<SourceLoader<ArcGISImageTileSource>>;
|
|
6
|
+
/** Lightweight service descriptor; use load() or the synchronous /bundled entrypoint. */
|
|
7
|
+
export declare const ArcGISImageTileSourceLoader: {
|
|
8
|
+
readonly dataType: ArcGISImageTileSource;
|
|
9
|
+
readonly batchType: never;
|
|
10
|
+
readonly preload: typeof preloadArcGISImageTileSourceLoader;
|
|
11
|
+
/** Requires the runtime loader when constructing a source synchronously. */
|
|
12
|
+
readonly createDataSource: (_url: string, _options: ArcGISImageTileSourceLoaderOptions, _coreApi?: CoreAPI) => ArcGISImageTileSource;
|
|
13
|
+
readonly name: "ArcGIS ImageServer tiles";
|
|
14
|
+
readonly id: "arcgis-image-server-tiles";
|
|
15
|
+
readonly module: "arcgis";
|
|
16
|
+
readonly version: "0.0.0";
|
|
17
|
+
readonly extensions: [];
|
|
18
|
+
readonly mimeTypes: [];
|
|
19
|
+
readonly type: "arcgis-image-server-tiles";
|
|
20
|
+
readonly fromUrl: true;
|
|
21
|
+
readonly fromBlob: false;
|
|
22
|
+
readonly options: {
|
|
23
|
+
readonly 'arcgis-image-server-tiles': {};
|
|
24
|
+
};
|
|
25
|
+
readonly defaultOptions: {
|
|
26
|
+
readonly 'arcgis-image-server-tiles': {};
|
|
27
|
+
};
|
|
28
|
+
readonly testURL: (url: string) => boolean;
|
|
29
|
+
};
|
|
30
|
+
export {};
|
|
31
|
+
//# sourceMappingURL=arcgis-image-tile-source-loader-types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"arcgis-image-tile-source-loader-types.d.ts","sourceRoot":"","sources":["../../src/arcgis/arcgis-image-tile-source-loader-types.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAC,OAAO,EAAE,YAAY,EAAC,MAAM,0BAA0B,CAAC;AACpE,OAAO,KAAK,EAAC,qBAAqB,EAAC,6CAA0C;AAC7E,OAAO,KAAK,EAAC,kCAAkC,EAAC,kCAA+B;AAE/E,sFAAsF;AACtF,iBAAe,kCAAkC,IAAI,OAAO,CAAC,YAAY,CAAC,qBAAqB,CAAC,CAAC,CAKhG;AAED,yFAAyF;AACzF,eAAO,MAAM,2BAA2B;uBAET,qBAAqB;wBAC/B,KAAK;;IAExB,4EAA4E;sCAEpE,MAAM,YACF,kCAAkC,aACjC,OAAO,KACjB,qBAAqB;;;;;;;;;;;;;;;;;CAK8B,CAAC"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
// loaders.gl
|
|
2
|
+
// SPDX-License-Identifier: MIT
|
|
3
|
+
// Copyright (c) vis.gl contributors
|
|
4
|
+
import { ARCGIS_IMAGE_TILE_SOURCE_LOADER_METADATA } from "../arcgis-source-types.js";
|
|
5
|
+
/** Loads the ArcGISImageTileSourceLoader implementation on first asynchronous use. */
|
|
6
|
+
async function preloadArcGISImageTileSourceLoader() {
|
|
7
|
+
const { ArcGISImageTileSourceLoaderWithParser } = await import('@loaders.gl/arcgis/arcgis-image-tile-source-loader');
|
|
8
|
+
return ArcGISImageTileSourceLoaderWithParser;
|
|
9
|
+
}
|
|
10
|
+
/** Lightweight service descriptor; use load() or the synchronous /bundled entrypoint. */
|
|
11
|
+
export const ArcGISImageTileSourceLoader = {
|
|
12
|
+
...ARCGIS_IMAGE_TILE_SOURCE_LOADER_METADATA,
|
|
13
|
+
dataType: null,
|
|
14
|
+
batchType: null,
|
|
15
|
+
preload: preloadArcGISImageTileSourceLoader,
|
|
16
|
+
/** Requires the runtime loader when constructing a source synchronously. */
|
|
17
|
+
createDataSource(_url, _options, _coreApi) {
|
|
18
|
+
throw new Error('ArcGISImageTileSourceLoader requires async load() or an @loaders.gl/arcgis/bundled import');
|
|
19
|
+
}
|
|
20
|
+
};
|
|
21
|
+
//# sourceMappingURL=arcgis-image-tile-source-loader-types.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"arcgis-image-tile-source-loader-types.js","sourceRoot":"","sources":["../../src/arcgis/arcgis-image-tile-source-loader-types.ts"],"names":[],"mappings":"AAAA,aAAa;AACb,+BAA+B;AAC/B,oCAAoC;AAEpC,OAAO,EAAC,wCAAwC,EAAC,kCAA+B;AAKhF,sFAAsF;AACtF,KAAK,UAAU,kCAAkC;IAC/C,MAAM,EAAC,qCAAqC,EAAC,GAAG,MAAM,MAAM,CAC1D,oDAAoD,CACrD,CAAC;IACF,OAAO,qCAAqC,CAAC;AAC/C,CAAC;AAED,yFAAyF;AACzF,MAAM,CAAC,MAAM,2BAA2B,GAAG;IACzC,GAAG,wCAAwC;IAC3C,QAAQ,EAAE,IAAwC;IAClD,SAAS,EAAE,IAAa;IACxB,OAAO,EAAE,kCAAkC;IAC3C,4EAA4E;IAC5E,gBAAgB,CACd,IAAY,EACZ,QAA4C,EAC5C,QAAkB;QAElB,MAAM,IAAI,KAAK,CACb,2FAA2F,CAC5F,CAAC;IACJ,CAAC;CACqD,CAAC"}
|