POST
|
Hello Joshua, Sorry for the late reply (I'm leaving my current position, and have lots of things to wrap up). Thanks for the code snippet. I've implemented your proposal (with a few modifications), and it works OK. Unfortunately I cannot avoid temporary layers. It's quite time consuming (a query for every single point), but I cannot do it with the complete table, because the Intersect tool doesn't keep my features in the same order, and this is something I MUST have. Thanks again.
... View more
06-01-2018
05:29 AM
|
0
|
1
|
974
|
POST
|
I don't clearly understand the difference between ArcPy and ArcGIS API for Python. Aren't they both using Python functions to get things automated which you can do manually in ArcGIS Pro ?
... View more
05-30-2018
07:28 AM
|
0
|
1
|
974
|
POST
|
Hi all, I am writing a Python script in which I build a geodatabase, based on several inputs. At one point, I am looping over a number of points (X,Y) which need to be treated individually using several criteria. One criterium is the polygon in which this point is located. This polygon comes from a feature table with a number of other fields. There are several tools (Intersect, SelectByLocation, SpatialJoin, ....) which might help doing this, but they all are based on input and output tables. How can I extract this one polygon, and linked fields, from that table, without having to make temporary input and output tables ? In an ideal world, it could look like this : for i in range (0, numberOfPoints): inputPoint = arcpy.Point(X, Y) findFeature(tableWithPolygons, inputPoint, outputFeature) myValue = outputFeature.value # based on this value, I can do further processing Thanks for pointing me in the right direction
... View more
05-30-2018
07:11 AM
|
0
|
6
|
1867
|
POST
|
Hi Lucas, I've checked again to be sure : field name and alias are both 'Name'. I've checked both for the layer and the mapView that isLabelsEnabled() return true. I've ran the code without the attached renderer. I've changed the parent for the LabelDefinition to this (was empty) and the parent for the layer also to this (was the map). Nothing. The only difference I can see now is that my FeatureLayer is based on a GeodatabaseFeatureTable, while you use a ServiceFeatureTable in your sample code. Could this be the reason why I don't see labels ? Looking further in the reference I noticed a class LabelingInfo. But I cannot find how to connect this to the layer of the mapView. Could this help ? Thanks for looking into this further. Marc
... View more
01-24-2018
01:05 AM
|
0
|
0
|
355
|
POST
|
I followed the instructions in "Label map Features" for .Net ( Label map features—ArcGIS Runtime SDK for .NET (WPF) | ArcGIS for Developers ) (this topic doesn't seem to exist for Qt ???) the reference for LabelDefinition ( LabelDefinition Class | ArcGIS for Developers ) and LabelDefinitionListModel ( LabelDefinitionListModel Class | ArcGIS for Developers ) But my application fails to show the labels of the features. I have no idea what I'm what I'm doing wrong. My code is FeatureLayer* iconLayer = new FeatureLayer(connectionsTable, _map);
QString labelDefJSON = "{";
labelDefJSON += "\"labelPlacement\" : \"esriServerPointLabelPlacementAboveRight\",";
labelDefJSON += "\"labelExpressionInfo\" :{";
labelDefJSON += "\"expression\" : \"$feature.Name\" },";
labelDefJSON += "\"symbol\" : {";
labelDefJSON += "\"type\": \"esriTS\",";
labelDefJSON += "\"font\" : { \"family\": \"Arial\", \"size\" : 11,\"weight\" : \"bold\"}";
labelDefJSON += "}";
labelDefJSON += "}";
LabelDefinition* labelDef = LabelDefinition::fromJson(labelDefJSON);
iconLayer->labelDefinitions()->append(labelDef);
iconLayer->setLabelsEnabled(true);
_map->operationalLayers()->append(iconLayer); Before appending the layer to the operationalLayers(), I also set a renderer for the features themselves (icons). Could this interfere with showing the labels ? The JSON string seems to be valid (according to VisualStudio's JSON Visualizer). Searching the Internet, I've found some alternatives : start the JSON string with "labelingInfo" use "expression" : "return $feature.Name;" "value: "$feature.Name" Nothing seems to help. Should I maybe do something different with "setLabelsEnabled(true)" ? Any help is welcome. Regards, Marc
... View more
01-22-2018
04:26 AM
|
0
|
2
|
721
|
POST
|
I have looked at the sample code, but there is one (probably important) difference : instead of a ServiceFeatureTable, we are using a GeodatabaseFeatureTable - all operations are done off-line. This also means that there is no applyEdits() method to invoke. Updating attributes works fine, by the way, but updating geometry is causing me headaches....
... View more
12-28-2017
07:08 AM
|
0
|
0
|
349
|
POST
|
Hi, When I update a FeatureTable (using updateFeature(Feature*) ), I was kinda hoping that the FeatureLayer which is used to render the data would automatically refresh, and show the new situation. Which doesn't happen. How can I keep the View (=layer) in sync with the Data (=table) ? Thanks for any suggestions.
... View more
12-28-2017
05:16 AM
|
0
|
2
|
458
|
POST
|
Hi Eric, I am in contact with Belux technical support, they will know how to handle this.
... View more
10-23-2017
11:58 PM
|
0
|
0
|
552
|
POST
|
Eric, I've looked at the sample, but I think this is not relevant for my problem. I don't need to display my data in 3D (but I need them for calculations), therefor I don't use SurfacePlacement. The problem occurs already before I can show them on the MapView : when downloading a copy (to make a runtime .geodatabase) the features with ShapeLength 0 are skipped. Any other suggestions ?
... View more
10-23-2017
12:44 AM
|
0
|
2
|
552
|
POST
|
I have nu idea ! First time to see about this class Where do I need to set this SurfacePlacement ? When creating my features, when sharing my data to the service, when downloading it into a runtime geodatabase ? Is there a default setting ? Please teach me about this.
... View more
10-10-2017
01:58 AM
|
0
|
0
|
552
|
POST
|
I have a feature service which contains some items with a total length of 0, but they have a depth (z-value) : items which are positioned vertically into the ground. The tables are all z-enabled. When I open the service in ArcMap, I can see they are there. But when I download it in my Qt application using GeodatabaseSyncTask and GenerateGeodatabaseJob to create a runtime geodatabase, these features are missing ! Are there some special settings needed to be able to download them ?
... View more
10-09-2017
12:51 AM
|
0
|
6
|
676
|
POST
|
Luke, (First of all : how do you add a code snippet with line numbers, like you did above ? Can't find it) I've modified a code sample I've found somewhere on one of the many ArcGIS webpages From the featureServiceInfo(), I can obtain layerInfos() and tableInfos(), which have ID numbers. Here I can see that lower ID numbers are assigned to the spatial layers, followed by the non-spatial tables. I cannot assign layerOptions here yet, because my parameters are not generated yet. I cannot add an extra parameter in the generate(params) method, because of the lambda syntax (I'm not so familiar with this construct, but it works) => global parameter m_numLayersInService. Like this it works, although I will not win any beauty contest with this Marc void myClass::downloadCopy() { GeodatabaseSyncTask* task = new GeodatabaseSyncTask(QUrl("url_of_service")); connect(task, &GeodatabaseSyncTask::doneLoading, this, [this](Error error) { if (!error.isEmpty()) { qDebug() << "Error loading GeodatabaseSyncTask:" << error.message() } else { ArcGISFeatureServiceInfo featureServiceInfo = task->featureServiceInfo(); QList<IdInfo> layerInfo = featureServiceInfo.layerInfos(); m_numLayersInService = layerInfo.size(); QList<IdInfo> tableInfo = featureServiceInfo.tableInfos(); for (int i = 0; i < layerInfo.size(); ++i) { qDebug() << "Layer" << layerInfo.name() << "ID" << layerInfo.infoId(); } for (int i = 0; i < tabelInfo.size(); ++i) { qDebug() << "Table" << tableInfo.name() << "ID" << tableInfo.infoId(); } Envelope area(-20e6, -7e6, 20e6, 15e6, featureServiceInfo.spatialReference()); task->createDefaultGenerateGeodatabaseParameters(area); } }); // Default parameters generated ? => generate the offline geodatabase connect(task, &GeodatabaseSyncTask::defaultGenerateGeodatabaseParametersCompleted, this, [this](QUuid, GenerateGeodatabaseParameters parameters) { generate(parameters); }); task->load(); } void myClass::generate(GenerateGeodatabaseParameters params) { params.setSyncModel(SyncModel::Layer); QList<GenerateLayerOption> glo = params.layerOptions(); for (int i = m_numLayersInService; i < glo.size(); ++i) { glo.setUseGeometry(false); glo.setWhereClause("1=1"); } params.setLayerOptions(glo); }
... View more
09-21-2017
08:04 AM
|
0
|
0
|
608
|
POST
|
Hi Luke, I am stupid. Of course it works, because you actually set the LayerOptions in the params (line 13 in your code snippet) In my code, I only changed a copy, but didn't assign them back to the actual parameters. Now it works as documented. Just one small thing : is there a way to identify the layers in GenerateLayerOption list by name or so? From the GeodatabaseSyncTask::featureServiceInfo(), I can get the layernames (spatial) and the tablenames (non-spatial). This allows me to calculate the number of the layer in the GenerateLayerOption list with the 1st non-spatial table. There should be an easier way to find this.
... View more
09-21-2017
01:02 AM
|
0
|
2
|
608
|
POST
|
Hi Luke, I've tried that already, without success. Perhaps my whereClause is not valid ? (but I've successfully used this in other queries). params.setSyncModel(SyncModel::Layer); QList<GenerateLayerOption> glo = params.layerOptions(); for (int i = 0; i < glo.size(); ++i) { glo.setQueryOption(GenerateLayerQueryOption::All); if (i > 10) { // the first layers do have geometry glo.setUseGeometry(false); glo.setWhereClause("1=1"); } } Do I need to change something else ?
... View more
09-20-2017
07:58 AM
|
0
|
4
|
608
|
Title | Kudos | Posted |
---|---|---|
1 | 07-28-2017 01:49 AM |
Online Status |
Offline
|
Date Last Visited |
11-11-2020
02:23 AM
|