Creating a GP service to create lines from points

323
2
03-13-2012 01:18 PM
JarkkoKuoppamäki
New Contributor III
Hi,

I'm trying to accomplish the following:
- the end user should be able to select at least 2 points in the JS web client
- the JS web client would submit the selected points to a geoprocessing service
- the GP service would generate a line feature using PointsToLine tool
- the line feature would be visible to the end user in the JS web client

What I've tried is the following:
[ATTACH=CONFIG]12638[/ATTACH]

It works when it's placed in a file geodatabase and run in ArcMap. Publishing it into ArcGIS for Server 10.1 Prerelease and running it from there finishes succesfully/without errors, but doesn't append the new line feature into the target dataset (ChainCandidates). Instead, it adds a new item into the TOC in ArcMap, called Model [numbers]-> Target. That one doesn't contain the new line feature either, only the older ones.

What am I missing here? I've tried toggling Model Parameters (P), different data types and other settings, but can't get it right. Any suggestions?

Or is my approach flawed - how would you accomplish the things listed above?
0 Kudos
2 Replies
JarkkoKuoppamäki
New Contributor III
The problem above was solved when I replaced the file geodatabase with an enterprise GDB (on postgresql) and left the resulting feature class not being a model parameter. There's a new problem, but I'll start from the beginning:

Environment: ArcGIS for Server 10.1 Prerelease running on Red Hat Linux 6, and ArcGIS for Desktop 10.1 running on Win XP. All data in a geodatabase, Postgresql 9.0.5 running on the same Linux server.

The goal: a GP service that would create a new line feature from selected point features, and append the newly created line feature into an existing line feature class.

What�??s been done:
- I�??ve created a model in Desktop, using Points To Line and Append tools. The point layer is used as a Model parameter, and I�??ve tried datatypes Feature Layer and Feature Set in the Properties window. 

[ATTACH=CONFIG]13550[/ATTACH]

- I�??ve run the model successfully in Desktop �?? a new line feature was created and appended into the feature class.
- I�??ve shared the result as a Geoprocessing Service successfully �?? the service is created

The problem: When the GP service is run, a new line feature is created and appended into the feature class, but at the same time all other features become �??invisible�?�. This is NOT a symbology issue as I can change the symbology of the layer to Single Symbol and still won�??t see the features. Selecting features in the Attribute Table highlights the (invisible) features on the map in cyan, but selecting them on the map with Select Features by Rectangle from the very same area does not select anything. Deleting the newly created feature doesn�??t bring the others visible, but instead I have to copy an old version and overwrite the new one in order to test more.

Sometimes I get an error message "One or more layers failed to draw: Chains: The given coordinate references are incompatible", although everything has been done in WGS_1984_Web_Mercator_Auxiliary_Sphere from the beginning. There's nothing in the ArcGIS Server Manager logs about this.

--Jarkko
0 Kudos
JarkkoKuoppamäki
New Contributor III
Additional information I've gathered:

I copied the Chains feature class from a local copy into the database to revert back to the original situation. I then ran the sdelayer command and found out that the SRID of the Chains layer is 3857 before running the GP service again, but 300002 after running it. It seems that somewhere in the process the spatial reference changes, and this causes the problem. I assume that 3857 is correct (WGS_1984_Web_Mercator_Auxiliary_Sphere) but what is 300002, why is it changed, and how should I approach to fix this in the model/service/somewhere else?

The sdelayer output files are attached below.

Furthermore,
- I�??ve replaced an in_memory feature class with one in the database �?? no effect on the problem (it remains)
- I�??ve added a Project tool before the Append tool, to project the newly created line feature (class) into WGS_1984_Web_Mercator_Auxiliary_Sphere �?? no effect
- I also added a Define Projection tool before the Append tool, for the same reasons as above, but not at the same time obviously �?? no effect
- The incorrect SRID is not always 300002, but I�??ve seen 300003 and 300005 today as well. Almost as if it was autoincrementing with each retry�?�

Any suggestions? Comments/questions/anything, really? (I've also sent this to Esri support)

Thread http://forums.arcgis.com/threads/7422-Insert-data-through-SDE-and-Java-API-GIVEN-COORDINATE-REFERENC... is somewhat similar, but I'm not sure how to follow a lot of manual steps in a GP model.

--Jarkko
0 Kudos