Question about the boundingPolygonLayer parameter in the InterpolatePoints service

304
0
02-13-2024 07:38 AM
Labels (1)
DimitriosIliadis
New Contributor

Helllo,

I am trying to use the InterpolatePoints service and I have a problem with the boundingPolygonLayer parameter.

I am loading a layer with the border of Germany from ArcGIS Living ATLAS: url

I know that I can pass the url directly and that works fine. For flexibility reasons I want to use the feature set option. My code for preparing the feature set looks like this:

    // Germany test for filtering the interpolated predictions
    var germanyLayer = new FeatureLayer({
      url: "https://services.arcgis.com/P3ePLMYs2RVChkJx/arcgis/rest/services/DEU_Boundaries_2022/FeatureServer"
    });

    var germanyQuery = germanyLayer.createQuery();
    germanyQuery.returnGeometry = true;
    germanyQuery.outFields = ["*"]; // Specify the fields you need
    const germanyResult = await germanyLayer.queryFeatures(germanyQuery);
    console.log('germanyResult: ', germanyResult);

    const germanyDict = {
      layerDefinition: {
          geometryType: "esriGeometryPolygon",
          fields: [
              {
                  name: "Id",
                  type: "esriFieldTypeOID",
                  alias: "Id"
              },
              {
                  name: "Name",
                  type: "esriFieldTypeString",
                  alias: "Name"
              }
              // Add other fields as necessary
          ]
      },
      featureSet: {
          geometryType: "esriGeometryPolygon",
          spatialReference: {
              wkid: 102100
          },
          features: [
              {
                  geometry: germanyResult.features[0].geometry,
                  attributes: {
                      Id: 1,
                      Name: "Germany"
                  }
              },
          ]
      }
    }

Then I construct the parameters in the following way:

    const apiUrl = `https://analysis3.arcgis.com/arcgis/rest/services/tasks/GPServer/InterpolatePoints/submitJob`;
    const parameters = {
      f: "json",
      token: token,
      inputLayer: JSON.stringify(temp_feature_layer),
      field: fieldName,
      //outputName: JSON.stringify({ serviceProperties: { name: outputName } }),
      interpolateOption: interpolateOption,
      classificationType: classificationType,
      numClasses: 32,
      // boundingPolygonLayer: JSON.stringify({ url: 'https://services.arcgis.com/P3ePLMYs2RVChkJx/arcgis/rest/services/DEU_Boundaries_2022/FeatureServer/0' }),
      boundingPolygonLayer: JSON.stringify(germanyDict),
    };
This is part of my implementation. I am skipping the rest because the code runs fine when I either don't specify the boundingPolygonLayer or when I use the url. When I use the germanyDict I get the following error from the submitted job
 
Screenshot 2024-02-13 at 16.36.55.png
 
Any help would be greatly appreciated.
 
Thanks
Dimitris
0 Kudos
0 Replies