A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://developers.arcgis.com/cesiumjs/data-enrichment/ below:

How to get enrichment data | CesiumJS

To find local or global data for an area, you use the GeoEnrichment service. GeoEnrichment is the process of enhancing (enriching) existing data with additional location-based information about the people and places in a specific area. The enriched data can drive better understanding, analysis, and decision making.

You can build applications that use the service to:

Mapping and location services guide

To learn more about the GeoEnrichment service, go to Data enrichment.

How to access the GeoEnrichment service

There is no direct integration with CesiumJS to access the GeoEnrichment service. To access the service in your application, you use the demographics and request modules from ArcGIS REST JS.

To access the service with ArcGIS REST JS, you typically perform the following steps:

  1. Reference the appropriate package.
  2. Set the API key to authenticate the request.
  3. Define parameters to pass to the service.
  4. Call the service and handle the results.
Tip

If a library is not available to access a service, you can use the request library to define parameters and make requests to the service directly. This will require visiting the ArcGIS services reference to determine the required parameters.

Example Find demographic data

This example shows how to query demographic data from the GeoEnrichment service using ArcGIS REST JS. The default study area is a one mile buffer around a point. It returns facts from the default data collection, Key global facts.

Use dark colors for code blocks Copy

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
<head>
    <meta charset="utf-8">
    <title>CesiumJS: Get global data</title>

    <script src="https://cesium.com/downloads/cesiumjs/releases/1.132/Build/Cesium/Cesium.js"></script>
    <link href="https://cesium.com/downloads/cesiumjs/releases/1.132/Build/Cesium/Widgets/widgets.css" rel="stylesheet">

    <script src="https://unpkg.com/@esri/arcgis-rest-request@4/dist/bundled/request.umd.js"></script>
    <script src="https://unpkg.com/@esri/arcgis-rest-demographics@4/dist/bundled/demographics.umd.js"></script>

</head>
<body>
  <div id="cesiumContainer"></div>
  <script>

    /* Use for API key authentication */
    const accessToken = "YOUR_ACCESS_TOKEN";

    // or

    /* Use for user authentication */
    // const session = await arcgisRest.ArcGISIdentityManager.beginOAuth2({
    //   clientId: "YOUR_CLIENT_ID", // Your client ID from OAuth credentials
    //   redirectUri: "YOUR_REDIRECT_URI", // The redirect URL registered in your OAuth credentials
    //   portal: "YOUR_PORTAL_URL" // Your portal URL
    // })

    // const accessToken = session.token;

    Cesium.ArcGisMapService.defaultAccessToken = accessToken;

    const authentication = arcgisRest.ApiKeyManager.fromKey(accessToken);

    const arcGisImagery = Cesium.ArcGisMapServerImageryProvider.fromBasemapType(Cesium.ArcGisBaseMapType.SATELLITE, {
    enablePickFeatures:false
    });

    const viewer = new Cesium.Viewer("cesiumContainer", {

        baseLayer: Cesium.ImageryLayer.fromProviderAsync(arcGisImagery),

        terrain: Cesium.Terrain.fromWorldTerrain(),
        timeline: false,
        animation: false,
        geocoder:false

    });

    viewer.camera.setView({

        destination : Cesium.Cartesian3.fromDegrees(15.347,41.361, 3000000),

    });

    // Add Esri attribution
    // Learn more in https://esriurl.com/attribution
    const poweredByEsri = new Cesium.Credit("Powered by <a href='https://www.esri.com/en-us/home' target='_blank'>Esri</a>", true)
    viewer.creditDisplay.addStaticCredit(poweredByEsri);

    function getDemographics(longitude,latitude) {

        arcgisRest.queryDemographicData({
            studyAreas: [{geometry: {x:longitude, y:latitude}}],
            dataCollections: ["KeyGlobalFacts"],
            authentication:authentication
        })

        .then((response) => {
             const featureSet = response.results[0].value.FeatureSet;

         })

    }

    getDemographics(12.3276,45.4388)

    </script>
</body>
Tutorial

Go to Get global data.

Tutorials

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4