03-06-2019 08:33 AM
Hi,
I build a workflow in GMSC 16.5 as follows which should add a point to a point feature
<?xml version="1.0"?> <FormList xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> <Form name="add_visit" editable="true" idfield="id" table="visits"> <FormGeometry name="GEOMETRY" layer="visits"> <NewActions> <GeometryAction name="GE_NEWPOINT" isstartonload="true"/> </NewActions> </FormGeometry> <FormTab name="NewTabPage1" editable="true" visible="true"> <FormGroup name="NewGroup1" editable="true" visible="true"> <FormField name="id" editable="false" visible="true" datatype="string" required="false" persisted="true" saveinsession="false" type="textfield" override="false" /> <FormField name="crop1" editable="true" visible="true" datatype="string" lov="LIST[فاكهة=فاكهة;خضروات=خضروات;أرز=أرز;قمح=قمح;ذرة=ذرة]" required="true" persisted="true" saveinsession="false" type="combobox" override="false" /> <FormField name="crop2" editable="true" visible="true" datatype="string" lov="LIST[فاكهة=فاكهة;خضروات=خضروات;أرز=أرز;قمح=قمح;ذرة=ذرة]" required="false" persisted="true" saveinsession="false" type="combobox" override="false" /> </FormGroup> <FormAction name="draw" editable="true" visible="true" action="SCRIPT[IG.captureGeometry()]" /> </FormTab> </Form> </FormList>
But I get the following error and can't save the drawn point:
06.03.2019 18:25:07 ERROR - Controller SmartClient has raised an exception in Action SaveGeometries. Npgsql.PostgresException: 22023: Geometry SRID (0) does not match column SRID (32636) [Data] Severity: ERROR SqlState: 22023 Code: 22023 MessageText: Geometry SRID (0) does not match column SRID (32636) File: gserialized_typmod.c Line: 157 Routine: postgis_valid_typmod SimpleIdentifier: 8 Geometries: Sql: at Intergraph.Emea.SmartClient.Data.DefaultGeometryContext._Save(IEnumerable`1 geometries, FeatureMetadata featureMetadata, IDatabaseProvider dbProvider, DbConnection dbConnection, DbTransaction dbTransaction) at Intergraph.Emea.SmartClient.Data.DefaultGeometryContext.Save(IEnumerable`1 geometries, FeatureMetadata featureMetadata) at Intergraph.Emea.SmartClient.Workflows.SmartClientController.SaveGeometries(SaveGeometryRequest geometryRequest) at lambda_method(Closure , ControllerBase , Object[] ) at System.Web.Mvc.ReflectedActionDescriptor.Execute(ControllerContext controllerContext, IDictionary`2 parameters) at System.Web.Mvc.ControllerActionInvoker.InvokeActionMethod(ControllerContext controllerContext, ActionDescriptor actionDescriptor, IDictionary`2 parameters) at System.Web.Mvc.Async.AsyncControllerActionInvoker.<BeginInvokeSynchronousActionMethod>b__39(IAsyncResult asyncResult, ActionInvocation innerInvokeState) at System.Web.Mvc.Async.AsyncResultWrapper.WrappedAsyncResult`2.CallEndDelegate(IAsyncResult asyncResult) at System.Web.Mvc.Async.AsyncControllerActionInvoker.EndInvokeActionMethod(IAsyncResult asyncResult) at System.Web.Mvc.Async.AsyncControllerActionInvoker.AsyncInvocationWithFilters.<InvokeActionMethodFilterAsynchronouslyRecursive>b__3d() at System.Web.Mvc.Async.AsyncControllerActionInvoker.AsyncInvocationWithFilters.<>c__DisplayClass46.<InvokeActionMethodFilterAsynchronouslyRecursive>b__3f() at System.Web.Mvc.Async.AsyncControllerActionInvoker.AsyncInvocationWithFilters.<>c__DisplayClass46.<InvokeActionMethodFilterAsynchronouslyRecursive>b__3f() at System.Web.Mvc.Async.AsyncControllerActionInvoker.AsyncInvocationWithFilters.<>c__DisplayClass46.<InvokeActionMethodFilterAsynchronouslyRecursive>b__3f() at System.Web.Mvc.Async.AsyncControllerActionInvoker.EndInvokeActionMethodWithFilters(IAsyncResult asyncResult) at System.Web.Mvc.Async.AsyncControllerActionInvoker.<>c__DisplayClass21.<>c__DisplayClass2b.<BeginInvokeAction>b__1c() at System.Web.Mvc.Async.AsyncControllerActionInvoker.<>c__DisplayClass21.<BeginInvokeAction>b__1e(IAsyncResult asyncResult) at System.Web.Mvc.Async.AsyncControllerActionInvoker.EndInvokeAction(IAsyncResult asyncResult) at System.Web.Mvc.Controller.<BeginExecuteCore>b__1d(IAsyncResult asyncResult, ExecuteCoreState innerState) at System.Web.Mvc.Async.AsyncResultWrapper.WrappedAsyncVoid`1.CallEndDelegate(IAsyncResult asyncResult) at System.Web.Mvc.Controller.EndExecuteCore(IAsyncResult asyncResult) at System.Web.Mvc.Async.AsyncResultWrapper.WrappedAsyncVoid`1.CallEndDelegate(IAsyncResult asyncResult) at System.Web.Mvc.Controller.EndExecute(IAsyncResult asyncResult) at System.Web.Mvc.MvcHandler.<BeginProcessRequest>b__5(IAsyncResult asyncResult, ProcessRequestState innerState) at System.Web.Mvc.Async.AsyncResultWrapper.WrappedAsyncVoid`1.CallEndDelegate(IAsyncResult asyncResult) at System.Web.Mvc.MvcHandler.EndProcessRequest(IAsyncResult asyncResult) at System.Web.HttpApplication.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() at System.Web.HttpApplication.ExecuteStepImpl(IExecutionStep step) at System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously)
Best Regards
Khaled
03-07-2019 04:01 AM
Hi Khaled,
Which update of GMSC 16.5 are you using?
There was a possibly related issue identified early in GMSC 16.5 that was resolved in latest release Update 3.
Otherwise, the workflow looks fine as you have it.
You could try on the PostGres table using INSERT statement to add geometry feature to the table. Is the issue appearing here as well?
03-07-2019 11:56 PM
I suggest to enable logging on the database and read the SQL statement being executed. It may give some more hints why the insert fails. Following settings in postgresql.conf file shows most important things in the log of my testing VM:
log_destination = 'stderr' logging_collector = on log_directory = 'pg_log' log_filename = 'postgresql-%Y-%m-%d_%H%M%S.log' log_statement = 'all'
03-10-2019 12:53 AM
Hi Jan,
I logged the database and I found the follwing:
2019-03-10 00:45:52 PST [2816]: [35-1] user=,db=,app=,client= LOG: checkpoint starting: time 2019-03-10 00:45:54 PST [2816]: [36-1] user=,db=,app=,client= LOG: checkpoint complete: wrote 10 buffers (0.1%); 0 transaction log file(s) added, 0 removed, 0 recycled; write=1.096 s, sync=0.140 s, total=1.315 s; sync files=5, longest=0.053 s, average=0.028 s; distance=23 kB, estimate=91 kB 2019-03-10 00:46:07 PST [4540]: [1-1] user=postgres,db=matboul,app=[unknown],client=192.168.1.153 ERROR: Geometry SRID (0) does not match column SRID (32636) 2019-03-10 00:46:07 PST [4540]: [2-1] user=postgres,db=matboul,app=[unknown],client=192.168.1.153 STATEMENT: Insert Into visits (crop1, crop2, geometry, geometry_spa) Values ($1, $2, $3, $4) Returning id 2019-03-10 00:46:08 PST [3404]: [1-1] user=,db=,app=,client= LOG: automatic analyze of table "gmsc.public.sec_session" system usage: CPU 0.00s/0.00u sec elapsed 0.03 sec
and also the follwing is the log of the workflow:
10.03.2019 10:46:06 ERROR - Controller SmartClient has raised an exception in Action SaveGeometries. Npgsql.PostgresException: 22023: Geometry SRID (0) does not match column SRID (32636) [Data] Severity: ERROR SqlState: 22023 Code: 22023 MessageText: Geometry SRID (0) does not match column SRID (32636) File: gserialized_typmod.c Line: 157 Routine: postgis_valid_typmod SimpleIdentifier: 8 Geometries: Sql: at Intergraph.Emea.SmartClient.Data.DefaultGeometryContext._Save(IEnumerable`1 geometries, FeatureMetadata featureMetadata, IDatabaseProvider dbProvider, DbConnection dbConnection, DbTransaction dbTransaction) at Intergraph.Emea.SmartClient.Data.DefaultGeometryContext.Save(IEnumerable`1 geometries, FeatureMetadata featureMetadata) at Intergraph.Emea.SmartClient.Workflows.SmartClientController.SaveGeometries(SaveGeometryRequest geometryRequest) at lambda_method(Closure , ControllerBase , Object[] ) at System.Web.Mvc.ReflectedActionDescriptor.Execute(ControllerContext controllerContext, IDictionary`2 parameters) at System.Web.Mvc.ControllerActionInvoker.InvokeActionMethod(ControllerContext controllerContext, ActionDescriptor actionDescriptor, IDictionary`2 parameters) at System.Web.Mvc.Async.AsyncControllerActionInvoker.<BeginInvokeSynchronousActionMethod>b__39(IAsyncResult asyncResult, ActionInvocation innerInvokeState) at System.Web.Mvc.Async.AsyncResultWrapper.WrappedAsyncResult`2.CallEndDelegate(IAsyncResult asyncResult) at System.Web.Mvc.Async.AsyncControllerActionInvoker.EndInvokeActionMethod(IAsyncResult asyncResult) at System.Web.Mvc.Async.AsyncControllerActionInvoker.AsyncInvocationWithFilters.<InvokeActionMethodFilterAsynchronouslyRecursive>b__3d() at System.Web.Mvc.Async.AsyncControllerActionInvoker.AsyncInvocationWithFilters.<>c__DisplayClass46.<InvokeActionMethodFilterAsynchronouslyRecursive>b__3f() at System.Web.Mvc.Async.AsyncControllerActionInvoker.AsyncInvocationWithFilters.<>c__DisplayClass46.<InvokeActionMethodFilterAsynchronouslyRecursive>b__3f() at System.Web.Mvc.Async.AsyncControllerActionInvoker.AsyncInvocationWithFilters.<>c__DisplayClass46.<InvokeActionMethodFilterAsynchronouslyRecursive>b__3f() at System.Web.Mvc.Async.AsyncControllerActionInvoker.EndInvokeActionMethodWithFilters(IAsyncResult asyncResult) at System.Web.Mvc.Async.AsyncControllerActionInvoker.<>c__DisplayClass21.<>c__DisplayClass2b.<BeginInvokeAction>b__1c() at System.Web.Mvc.Async.AsyncControllerActionInvoker.<>c__DisplayClass21.<BeginInvokeAction>b__1e(IAsyncResult asyncResult) at System.Web.Mvc.Async.AsyncControllerActionInvoker.EndInvokeAction(IAsyncResult asyncResult) at System.Web.Mvc.Controller.<BeginExecuteCore>b__1d(IAsyncResult asyncResult, ExecuteCoreState innerState) at System.Web.Mvc.Async.AsyncResultWrapper.WrappedAsyncVoid`1.CallEndDelegate(IAsyncResult asyncResult) at System.Web.Mvc.Controller.EndExecuteCore(IAsyncResult asyncResult) at System.Web.Mvc.Async.AsyncResultWrapper.WrappedAsyncVoid`1.CallEndDelegate(IAsyncResult asyncResult) at System.Web.Mvc.Controller.EndExecute(IAsyncResult asyncResult) at System.Web.Mvc.MvcHandler.<BeginProcessRequest>b__5(IAsyncResult asyncResult, ProcessRequestState innerState) at System.Web.Mvc.Async.AsyncResultWrapper.WrappedAsyncVoid`1.CallEndDelegate(IAsyncResult asyncResult) at System.Web.Mvc.MvcHandler.EndProcessRequest(IAsyncResult asyncResult) at System.Web.HttpApplication.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() at System.Web.HttpApplication.ExecuteStepImpl(IExecutionStep step) at System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously)
Best Regards
Khaled
03-14-2019 07:50 AM
Issue was caused by following setup:
Probably because of the combination above GMSC, did not provide an SRID for the geometry to be stored. After assigning coordinate system claim to the user role, the data could be stored from offline.