I have a requirement to show routes from optimized routing. I have the routing complete and working and now I want to add the route to a map. I added to stops to maps by using the rest add feature call to the server. No problem with 30+ stops. The routes have hundreds of segments in the returned path. I need to show the direction of the paths with arrows at the end. I'm not going to write hundreds of segments to a rest endpoint for a couple dozen routes. I want to add the segments to a SQL database. I've been trying everything and I can add, update and delete as expected but when I try to calculate the SHAPE I get the following error that I can't find anything about.
The UPDATE statement conflicted with the CHECK constraint "g90_ck". The conflict occurred in database "PSLGIS2", table "dbo.BLDG_RTE_STOPS", column 'SHAPE'.<SPAN class="line-numbers-rows"><SPAN></SPAN></SPAN>
The sql statement I am sending is
<SPAN class="keyword token">INSERT</SPAN> <SPAN class="keyword token">INTO</SPAN> BLDG_RTE_STOPS <SPAN class="punctuation token">(</SPAN>objectid<SPAN class="punctuation token">,</SPAN> inspID<SPAN class="punctuation token">,</SPAN> stopOrder<SPAN class="punctuation token">,</SPAN>inputOrder<SPAN class="punctuation token">,</SPAN> address<SPAN class="punctuation token">,</SPAN> x<SPAN class="punctuation token">,</SPAN> y<SPAN class="punctuation token">,</SPAN> SHAPE<SPAN class="punctuation token">)</SPAN> <SPAN class="keyword token">VALUES</SPAN><SPAN class="punctuation token">(</SPAN><SPAN class="number token">3</SPAN><SPAN class="punctuation token">,</SPAN><SPAN class="number token">208</SPAN><SPAN class="punctuation token">,</SPAN><SPAN class="number token">1</SPAN><SPAN class="punctuation token">,</SPAN><SPAN class="number token">2</SPAN><SPAN class="punctuation token">,</SPAN><SPAN class="string token">'123 sw psl blvd'</SPAN><SPAN class="punctuation token">,</SPAN><SPAN class="operator token">-</SPAN><SPAN class="number token">8943761.976904802</SPAN><SPAN class="punctuation token">,</SPAN><SPAN class="number token">3157847.4254109007</SPAN><SPAN class="punctuation token">,</SPAN><SPAN class="keyword token">geometry</SPAN>::STPointFromText<SPAN class="punctuation token">(</SPAN><SPAN class="string token">'POINT(-8943761.97 3157847.42)'</SPAN><SPAN class="punctuation token">,</SPAN><SPAN class="number token">3587</SPAN><SPAN class="punctuation token">)</SPAN><SPAN class="punctuation token">)</SPAN><SPAN class="line-numbers-rows"><SPAN></SPAN></SPAN>
I can add the attributes and create a new record without issue. I try to run an UPDATE bldg_rte_stops SET SHAPE = and I still get the error.
The feature class is versioned with move edits to base.
SQL 2016 on 2012 windows server
Desktop 10.6
Server 10.5
Edit:
+========================----------------------=================+
I wasn't able to resolve the direct creation of a single feature with a single input statement. If I chunked it up into an insert and add the stop info like address, inspection id's, etc and then call Update, it works.
objectid is obtained from a single call to SELECT MAX(OBJECTID) and incremented as needed.
<SPAN class="keyword token">INSERT</SPAN> <SPAN class="keyword token">INTO</SPAN> BLDG_RTE_STOPS <SPAN class="punctuation token">(</SPAN>objectid<SPAN class="punctuation token">,</SPAN> x<SPAN class="punctuation token">,</SPAN> y<SPAN class="punctuation token">)</SPAN> <SPAN class="keyword token">VALUES</SPAN><SPAN class="punctuation token">(</SPAN><SPAN class="number token">5</SPAN><SPAN class="punctuation token">,</SPAN><SPAN class="operator token">-</SPAN><SPAN class="number token">8941512.462</SPAN><SPAN class="punctuation token">,</SPAN> <SPAN class="number token">3156974.749</SPAN><SPAN class="punctuation token">)</SPAN>
<SPAN class="keyword token">update</SPAN> BLDG_RTE_STOPS <SPAN class="keyword token">set</SPAN> SHAPE <SPAN class="operator token">=</SPAN> <SPAN class="keyword token">geometry</SPAN>::<SPAN class="keyword token">Point</SPAN><SPAN class="punctuation token">(</SPAN><SPAN class="punctuation token">[</SPAN>x<SPAN class="punctuation token">]</SPAN><SPAN class="punctuation token">,</SPAN><SPAN class="punctuation token">[</SPAN>y<SPAN class="punctuation token">]</SPAN><SPAN class="punctuation token">,</SPAN><SPAN class="number token">3857</SPAN><SPAN class="punctuation token">)</SPAN> <SPAN class="keyword token">where</SPAN> OBJECTID<SPAN class="operator token">=</SPAN><SPAN class="number token">5</SPAN><SPAN class="line-numbers-rows"><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN></SPAN>