Dear Esri community
Server job has failed. ERROR 000811: The value is not a feature class.
ERROR 000732: Input Line Features: Dataset [...] does not exist or is not supported.
{
"features": [
{
"attributes": {
"ObjectID": 1
},
"geometry": {
"paths": [
[
[
912464.4710000008,
5948732.0405
],
[
935803.3581999987,
5958361.371600002
]
]
],
"spatialReference": {
"latestWkid": 3857,
"wkid": 102100
}
}
}
],
"fields": [
{
"editable": false,
"length": 0,
"name": "ObjectID",
"nullable": false,
"type": "esriFieldTypeOID"
}
],
"geometryType": "esriGeometryPolyline",
"hasM": false,
"hasZ": false,
"spatialReference": {
"latestWkid": 3857,
"wkid": 102100
}
}
FeatureCollectionTable* inputFeatures =
new FeatureCollectionTable(QList<Field>(), GeometryType::Polyline, SpatialReference::webMercator(), this);
Feature* lineFeature = inputFeatures->createFeature(this);
auto observerPoint = static_cast<Point>(m_observerGraphic->geometry());
auto targetPoint = static_cast<Point>(m_targetGraphic->geometry());
auto polylineBuilder = new PolylineBuilder(SpatialReference::webMercator(), this);
polylineBuilder->addPoint(observerPoint);
polylineBuilder->addPoint(targetPoint);
auto polyLine = polylineBuilder->toPolyline();
lineFeature->setGeometry(polyLine);
inputFeatures->addFeatureAsync(lineFeature).then(this, [this, inputFeatures]() {
onAddFeatureCompleted_(inputFeatures);
});
GeoprocessingParameters geoprocessParams = GeoprocessingParameters(GeoprocessingExecutionType::AsynchronousSubmit);
geoprocessParams.setOutputSpatialReference(SpatialReference::webMercator());
QMap<QString, GeoprocessingParameter*> inputs;
inputs["in_line_feature_class"] =
new GeoprocessingFeatures(inputFeatures, this);
QString dataPath = QDir::homePath() + "/ArcGIS/Runtime/Data";
inputs["in_surface"] =
new GeoprocessingRaster(QUrl(dataPath + "/raster/SwissElevation/Elevation.tif"), ".tif", this);
geoprocessParams.setInputs(inputs);
GeoprocessingJob* geoprocessJob = m_gpTask->createJob(geoprocessParams);
geoprocessJob->start();
Thank you for the reply
I'm afraid I'm not sure I understand. Creating a FeatureLayer from a FeatureCollectionTable is not possible, as the documentation states. I tried to create a FeatureCollectionLayer, but I'm not sure what to do with it. I can not pass it to any GeoprocessingParameter as input since none are compatible.
Interestingly enough, when navigating to the task on the local server it says it expects a GPString, I assume the GeoprocessingFeature that I use as input is converted to a GPString automatically. But I'm not sure how I could do the same with a FeatureLayer.
Yes, you are right I have checked inheritance of FeatureCollectionTable, but didn't read until the end.
FeatureCollectionLayer may not help you too.
What do you think about changing your package and send coordinates of the path as json or geojson string?
You will need to add additional geoprocessing step to package content for converting json/geojson string to features.
Thank you for the reply. I haven't tried your idea with the json conversion tool yet, but thanks to your reply I looked a bit more into how to create your own model in ArcGIS Pro since I've never done that before.
What I came up with is using two tools in sequence. First `Construct Sight Lines`, its output is of type ` Feature Class`, so that should be a match. The resulting sight line is the input for the Line Of Sight tool.
Now all I have to provide from the runtime are 1 target point, 1 observer point, and the input elevation raster.
Not sure if this is the optimal solution, or if this is really necessary just to use the Line Of Sight tool. Maybe it would be simpler with the json conversion tool, I'll try that later.