POST
|
I'm using feature table queryFeatures() where in my query parameters I set an output spatial reference system. In this case, the source feature layer has an SRS defined which also includes a vertical system. In my layer, the srs is defined like this: "spatialReference" : { "wkid" : 2223, "latestWkid" : 2223, "vcsWkid" : 115809, "latestVcsWkid" : 115809 } 115809 gives me a vertical system where units are in International Feet. For my query parameters, I defined a spatial reference as SpatialReference(3857, 115807). This should get Z values in meters. I examined the wkt strings from both definitions and they looked correct, containing the expected VERTCS definitions. However, my returned geometry does not have the Z values transformed from feet to meters even though the XY coordinates were transformed correctly. Is there something else that I need to do to have the Z values converted from feet to meters? Note that originally I did not have a vertical CS defined in either source or target. I added the vertical CS to both to try to get the unit conversion to work. Currently, I'm using the C++ Qt Runtime 100.3. Additional Notes: I tried this using the Rest API directly with outSR as {"wkid" : 3857, "vcsWkid" : 115807} and applyVCSProjection = true. This had the same issue, no transformation of the Z value. Then I tried using GeometryEngine::Project() directly in some test code. SpatialReference origSR = SpatialReference(2223, 115809); Point orig = Point(4266440.55, 3175667.19, 100.0, origSR); SpatialReference sr4326 = SpatialReference(4326, 115807); SpatialReference sr3857 = SpatialReference(3857, 115807); qDebug() << "Original point =" << orig.toJson(); Geometry pt1 = GeometryEngine::project(orig, sr4326); qDebug() << "Original point to 4326 =" << pt1.toJson(); Geometry pt2 = GeometryEngine::project(orig, sr3857); qDebug() << "Original point to 3857 =" << pt2.toJson(); So, this code actually transformed the Z value from feet to meters. Original point = "{\"x\":4266440.5499999998,\"y\":3175667.1899999999,\"z\":100,\"spatialReference\":{\"wkid\":2223,\"vcsWkid\":115809}}" Original point to 4326 = "{\"x\":-99.379177961421789,\"y\":39.044250712477478,\"z\":30.48,\"spatialReference\":{\"wkid\":4326,\"vcsWkid\":115807}}" Original point to 3857 = "{\"x\":-11062839.486119589,\"y\":4728012.0910140648,\"z\":30.48,\"spatialReference\":{\"wkid\":102100,\"latestWkid\":3857,\"vcsWkid\":115807}}" This leads me to believe that the low level transformation engine should handle this but that for some reason the feature query operation either is not recognizing that there are vertical coordinate systems defined or is not applying them for some reason. Am I missing something in the specification of my online layer or in my query parameters? Regards, Orest. z coordinate spatialreference
... View more
05-29-2019
06:42 PM
|
0
|
0
|
491
|
POST
|
I'm having an issue when I try to set an attribute value to null in the process of adding a new feature to a feature table. I'm using C++ Qt Runtime sdk 100.3. I have a feature layer that is enabled for editing. The feature table has string and int attributes that are defined as Editable = yes and Allows Null Values = yes. What I'm doing is this: Create a new feature using ServiceFeatureTable::createFeature(). Create a QMap<QString, QVariant> of feature attributes. Create a null QVariant value: QVariant qv = QVariant(); I verified that qv.IsNull() is true; Add to the attributes list: featureAttributes.insert("MyAttrName", qv); I used this for both string and int attributes. Create a new feature: featureTable->createFeature(featureAttributes, geom, this); If I go ahead and add that feature to the table and apply edits, then I see that the resulting attribute is not null but has a non-null empty string for string attributes and 0 for int attributes. What I also found was that if right after creating the feature, I get the attributes back via the AttributeListModel, the attributes are no longer null. AttributeListModel* alm = feature->attributes(); QVariant qv2 = alm->attributeValue(QString("MyAttrName")); qDebug() << "qv2 is null =" << qv2.isNull(); This returns false. I expected it to return true. If I leave out the attributes from the attribute list altogether, then I do get null values in the resulting feature in the table. However, that approach will not work if the attributes include default values that will set them to non-null values and that approach will not work for ServiceFeatureTable::updateFeature(); I need a way to set values to null explicitly. Does anyone have suggestions as to what to try? I am probably missed something. Regards.
... View more
03-13-2019
11:49 AM
|
0
|
2
|
3339
|
POST
|
Thanks Lucas. When I tried those steps, I got a map service started but only the simple point layer from the mpk seems to be there. I think I'm missing a step of what to do with the TableSubLayerSource that I created. Here is the code that I'm using. char* path = "E:/WaterNetwork/UtilityNetworkEditingAndAnalysisA4W/MapsandGeodatabase/WaterUtilities.gdb"; pkgPath = QDir::homePath() + "/ArcGIS/Runtime/Data/mpk/mpk_blank.mpk"; FileGeodatabaseWorkspace* fgdbWorkspace = new FileGeodatabaseWorkspace("fgdb_wkspc", path, this); TableSublayerSource* source = new TableSublayerSource(fgdbWorkspace->id(), path, this); LocalMapService* localMapServ = new LocalMapService(pkgPath, this); QList<DynamicWorkspace*> dynamicWorkspaces; dynamicWorkspaces.append(fgdbWorkspace); localMapServ->setDynamicWorkspaces(dynamicWorkspaces); connect(localMapServ, &LocalMapService::statusChanged, this, [&]() { if (localMapServ->status() == LocalServerStatus::Started) { qDebug() << "Local map service started, url =" << localMapServ->url(); // Add code here to create a ServiceFeatureTable by pointing to these REST endpoint URLs emit localMapServLoadDone(); } else if (localMapServ->status() == LocalServerStatus::Failed) { qDebug() << "Local map service failed"; emit localMapServLoadDone(); } }); connect(localMapServ, &LocalMapService::errorOccurred, this, [&](Esri::ArcGISRuntime::Error error) { if (!error.isEmpty()) { qDebug() << "Error on Local Map Service Start:" << error.message(); showArcGISErrorMsg(error); } }); localMapServ->start(); What do I need to do at the point where I have the comment about create ServiceFeatureTable? It seems that somewhere I need to do more with the TableSubLayerSource object. From the above code, the map service url is http://127.0.0.1:50000/qpDB90/arcgis/rest/services/mpk_blank.mpk/MapServer . Thanks, Orest.
... View more
02-06-2019
10:50 AM
|
0
|
0
|
857
|
POST
|
I'm trying to determine how to access a File Geodatabase using the C++ Qt Runtime API. According to the information on this page, https://developers.arcgis.com/qt/latest/cpp/guide/supported-geodatabase-formats.htm, that should be possible if I use a local server. What I need to be able to do is access the feature tables in the FGDB. If I can get to the point where I can instantiate an ArcGISFeatureTable class, then I know from there how to use queryFeatures() to get Feature objects, which is what I'm ultimately trying to do. I also am interested in editing those objects. The ArcGISFeatureTable class allow me to add, update, or delete features. I know how to get the local server started. But, from that point, it's not clear from the documentation how actually to get the feature tables. I looked at the example called DynamicWorkspaceShapefile (https://github.com/Esri/arcgis-runtime-samples-qt/tree/master/ArcGISRuntimeSDKQt_CppSamples/LocalServer/DynamicWorkspaceShapefile) thinking that it would do something similar except with shp files. However, the example does not actually access the feature classes directly. It creates a map service and generates an image. I looked at the pattern of defining a FileGeodatabaseWorkspace (instead of a ShapefileWorkspace) and then a TableSubLayerSource, but it didn't seem to help me get to ArcGISFeatureTables. An immediate issue is that this approach requires a LocalFeatureService to be created which needs a map package (.mpk) file. In my case, I don't have a map and don't need a map. However, to try that approach I did get as far as using ArcMap to create a map package (.mpk) file from a map created from file gdb tables. I figured that from the local feature service, I could get a url that I could use for creating a ServiceFeatureTable. Unfortunately, when I tried to load a local feature service defined from that mpk file, I got a load failed (not sure why yet, the errorOccurred signal wasn't triggered). Even if that had worked, it still would have been a round about way that accessed a packaged copy of the data and not a direct way to access the original fgdb. So, my question is how do I use the local server to access the feature tables in a local fgdb so that I can instantiate Feature objects? Regards.
... View more
02-01-2019
08:25 AM
|
0
|
4
|
1292
|
Online Status |
Offline
|
Date Last Visited |
11-11-2020
02:23 AM
|