M.App Enterprise Discussions

Discuss topics with other M.App Enterprise Product pioneers and experts to get the most out of it.
Showing results for 
Search instead for 
Do you mean 
Reply
Highlighted
Contributor
Posts: 75
Registered: ‎02-19-2019

Split and Merge Polygon M.APP Enterprise

Dear community,

 

I'm using M.APP Enterprise 2018 (16.5.604) version to develop a Land acquisition system where I need to split a polygon and also need merge 2 polygon.  Please have a look screenshot. I have a big portion of land (whole land) and I can split small portion of land to give lease/Rent. I'm using this code to split polygon. I want new record with the new split geometry. 

 

I can save in the database with new recode but I can't get the split gemetry ID , all split geometry are showing same ID. Have any other command to split and merge geometry ?

 

 

SC.digitize('ASSETS', {commands: ['GE_SPLITPOLYGON'], startOnLoad: 'GE_SPLITPOLYGON'}, [{FORM.ASSET_PK}])

Untitled.png

 

Kind Regards,
Liton

Highlighted
Technical Evangelist
Posts: 833
Registered: ‎11-12-2015

Re: Split and Merge Polygon M.APP Enterprise

Hi Liton,

 

The 'GE_SPLITPOLYGON' is antiquated command and the official commands to edit existing geometries in M.App Enterprise should be used. They are documented here and the equivalent of the 'GE_SPLITPOLYGON' will be 'SplitSurface'.

Each time a surface is split the newly resulted feature(s) should get a new primary key unique to the new feature(s). I tested this and this is working. Please review the link and try with the proper command. I hope you will get the results you had been expecting.

 

HTH

Highlighted
Contributor
Posts: 75
Registered: ‎02-19-2019

Re: Split and Merge Polygon M.APP Enterprise

Hi Sclow,

 

Thank you so much for your reply. Please see the below screenshot and code. I'm using 2 layers (2 tables). My main land in Asset table and after split keeping land in disposal layer. after split data are saving in disposal table but I'm not getting all ID. 

 

Its a mandatory to keep main land and split land in same table means same layer ?

 

Assets.png

 

SC.digitize('ASSETS', {commands: ['SplitSurface'], startOnLoad: 'SplitSurface'}, [{FORM.ASSET_PK}])

Kind Regards,
Liton

Highlighted
Technical Evangelist
Posts: 833
Registered: ‎11-12-2015

Re: Split and Merge Polygon M.APP Enterprise

[ Edited ]

Hi Liton,

 

I am not sure I understand your question in bolded type, sorry.

 

The split is for the 'ASSETS' layer. Is the {FORM.ASSET_PK} a required field on your form?

Does it have a sequence set against 'ASSET_PK' column in the database?

 

Is there any error in the client or Studio?

 

HTH

Highlighted
Contributor
Posts: 75
Registered: ‎02-19-2019

Re: Split and Merge Polygon M.APP Enterprise

Hi HTH,

Thank you so much for your reply.

 

Please see the below of your answer. 

Is the {FORM.ASSET_PK} a required field on your form?--> Yes required field 

Does it have a sequence set against 'ASSET_PK' column in the database?---> Yes its a auto incremental field and primary key set in Asset table. and this key is foreign key in disposal table. and Disposal table have ID column is a primary key. Please see the below workflow.

 

Please see my workflow.

<?xml version="1.0"?>
<FormList xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
  <Form name="SplitTest" label="Split Test" editable="true" idfield="ASSET_PK" table="Assets">
    <FormTab name="NewTabPage1" editable="true" visible="true">
      <FormGroup name="NewGroup1" editable="true" visible="true">
        <FormField name="ASSET_PK" label="ASSET_PK" editable="true" visible="true" datatype="number" defaultvalue="{REQUESTCONTEXT.ASSET_PK}" defaultvaluemode="onload" required="true" persisted="true" saveinsession="false" type="textfield" override="false" />
        <FormField name="ASSET_ID" label="ASSET_ID" editable="true" visible="true" datatype="string" defaultvaluemode="onload" required="true" persisted="true" saveinsession="false" type="textfield" override="false" />
        <FormField name="FILE_NO" label="FILE_NO" editable="true" visible="true" datatype="string" defaultvaluemode="onload" required="true" persisted="true" saveinsession="false" type="textfield" override="false" />
        <FormField name="TYPE_ID" label="TYPE_ID" editable="true" visible="true" datatype="number" defaultvaluemode="onload" required="true" persisted="true" saveinsession="false" type="textfield" override="false" />
        <FormAction name="CaptureTest" label="CaptureTest" editable="true" visible="true" action="SCRIPT[SC.digitize('ASSETS', {commands: ['SplitSurface'], startOnLoad: 'SplitSurface'}, [{FORM.ASSET_PK}])]" />
      </FormGroup>
    </FormTab>
  </Form>
</FormList>

Kind Regards,

Liton