Zum Hauptinhalt gehen

Do you have to output the shape field to get the geometry returned in a query?

Kommentare

10 Kommentare

  • Permanently deleted user

    Hi Ethan,

     

    There's two main requirements for getting geometry returned when using Query Layer:

    • The Shape field has to be published (not hidden) on ArcGIS Server, and the features should have geometry
    • The "Return Geometry" property on Query Layer should be set to true

    In your question, I'm not sure if you're referring to the shape field being output on ArcGIS Server or on the Query layer activity's "Output Fields" property. The former would be "yes", and the latter would be "no".

     

    Hope that helps!

    0
  • Ethan Granger

    does "output on ArcGIS Server" mean that the Shape field needs to be visible in the Geocortex manager (in the field settings)?

    0
  • Permanently deleted user

    No, if you use Query Layer on an ArcGIS Server URL, then the query is sent straight to that ArcGIS Server URL without involving your Essentials setting for the layer.

     

    As an example, on https://aws-dmags2.geocortex.com/arcgis/rest/services/LosAngelesCounty/Dynamic/MapServer/0 , you can see that Shape is the second field in the layer's fields list. That's what I was referring to for "output on ArcGIS Server".

    0
  • Ethan Granger

    ok, my layer is definitely outputting the shape. But I can't get any graphics to display on the map. I've uploaded my workflow. Thanks in advance.

    0
  • Ethan Granger

    Amanda, I think I'm getting frustrated that when i "copy" (because you can't really copy) a working sequence into another workflow nothing seems to work properly and debugging is a challenge. Attached is a simple workflow that should query a single record from a layer and then zoom to it. It won't work, in fact it won't even run "The application is experiencing issues while performing this operation." Everything seems much harder than it should be. Please help!

    0
  • Permanently deleted user

    Hi Ethan,

     

    Sorry to hear that it's giving you trouble. I saw that Stefan answered some of your questions about copy/paste, so hopefully that part is going better now.

     

    I attached a modified version of your sample. Viewers have a spatial reference (like a Data Frame in ArcGIS would). In our HTML5 viewer, the spatial reference is set by your lowest map service, which is usually a basemap. Whenever you ask the viewer to zoom or pan, you have to give it a geometry/extent that matches its own spatial reference. If you try to give it geometry from a different projection it'll get stuck.

     

    For a workflow process, usually the easiest way to do this is to use the "Output Spatial Reference" property on the Query Layer activity. If you don't supply that property, Query Layer will output geometry in the projection of that particular service, which could be different from your viewer. If you know your viewer's spatial reference off hand you can just fill in a wkid number like 102100. But in my example I used an extra activity to determine what the viewer's spatial reference is for us, and use that result. That way if you put the same workflow on two different viewers that use two different spatial references (or if you change the basemap for your site sometime down the road), it would still work each time.

    0
  • Permanently deleted user

    Amanda,

     

    @Amanda Frech? I am struggling with a similar workflow. I am trying to copy feature form one layer to another, and it seems to be failing on the add feature step. I cannot figure out what the issue is. I did add the "spatial preferences" like you have in the sample above, but still no luck.

    Here is a link to my workflow, if you have a moment to look at it I would appreciated it a lot.

     

    https://omaha.maps.arcgis.com/home/item.html?id=62963d8b78294c91930cac75051ef27e

     

    Thank you,

    Nataliya

    0
  • Permanently deleted user

    Nataliya,

     

    Do you have access to the ArcGIS Server Manager for this server? If so, it will usually tell you in the logs what's so wrong with the input that it rejects your features. If not, you should compare the features that you send to the service against that services schema: this almost always reveals the issue for me.

     

    More often than not, my features have the wrong spatial reference but sometimes I have issues like trying to upload illegal values to fields with domains the wrong data type e.g. text instead of an integer.

    0
  • Permanently deleted user

    @Nataliya Lys? It looks like you're trying to add a polygon feature (from parcels) to a point layer (above ground tanks).

     

    You could try using Get Centroid on =$query1.feature.geometry, and then use the output from that to supply the geometry input for the Create Feature activity (instead of =$query1.feature.geometry). That'll convert your polygon to a point that can safely be added to the point layer.

     

    You can also remove the symbol input from Create Feature; in this case we don't need a symbol.

     

    Finally, you won't be able to use =$query1.feature.attribute for the attributes, because that's going to contain the PIN field from your parcel query, and the tanks layer doesn't have a field called PIN. You could either add that field to the layer (republish from ArcMap), write your own Attributes, or just remove the Attributes value from Create Feature.

    0
  • Permanently deleted user

    Amanda,

     

    Thank you. It was such a fail on my part. In the middle the process I republished my service and change order of layers, so I must have not changed the layer ID in the workflow. I was frustrated with workflow 5 so I set it aside. I then went back to an old workflow designer since I already had similar workflow working in the older version. The good think is, now I have both workflows working old and new!!!

     

    Thanks again,

    Nataliya

    0

Bitte melden Sie sich an, um einen Kommentar zu hinterlassen.