[Geomoose-users] Feature Editor: Polygon_update and Polygon_delete Errors

Brent Fraser bfraser at geoanalytic.com
Mon Dec 12 09:30:00 EST 2011


Atif,

   The docs also explain how the services are used (the last section 
called "Create the Identify.html File" is VERY important).

   The "Identify" tool is used to return Edit and Delete links for the 
polygon the user selected.  The Identify service is used to get the 
feature id for the feature the user clicked, render it into the layer's 
query template, and send the resulting HTML to GeoMoose.  When the user 
clicks on the rendered links, the feature id is sent to the modify or 
delete service.  You need to get your system working this way first, 
then modify it to work the way you want.

Best Regards,
Brent Fraser


On 12/11/2011 10:31 PM, Atif Butt wrote:
> Hi Brent
> This docs has only explained the delete  and modify polygon servies as 
> follow:
> <service name="delete_polygon">
> <url>php/editor.php</url>
> <step type='input'>
> <input type="hidden" name="op" value="delete"/>
> <input type="hidden" name="table" value="test_polygons"/>
> <input type="hidden" name="feature:polygon_id"/>
> </step>
> </service>
> similarly, modify_polygon service as
> <service name="modify_polygon">
> <url>php/editor.php</url>
> <step type='spatial' name='feature:wkb_geometry' line='false' 
> polygon='true' point='false' default='point' edit-polygon='true'> <!-- 
> It's necessary to specify that the polygon editor be turned on, the 
> rest of the options are CREATION functions -->
> <input type="hidden" name="op" value="update"/>
> <!-- This just changes the option to 'update' instead of 'create' -->
> <input type="hidden" name="table" value="test_polygons"/>
> <input type="hidden" name="feature:polygon_id"/>
> <input type="user" name="feature:title" title="Title:"/>
> <input type="user" name="feature:owner" title="Owner:"/>
> </step>
> </service>
> If you talking about these steps, then I have already done with them. 
> I dont know, maybe something else conflicting or left to be perfromed.
> The URL for checking the results so far (use firefox to open): 
> http://141.117.248.26/geomoose2/geomoose.html
> You can check my mapbook.xml or anyother documents related to the 
> feature_editor_configuration from this URL, I put all configuration 
> files together in one folder; acessable at: 
> http://141.117.248.26/geomoose2/Development_Docs/
>  e.g., mapbook.xml can be accessed at URL= 
> http://141.117.248.26/geomoose2/Development_Docs/conf/mapbook.xml
> Best Regards and Thanks for quick response
> Atif
>
>
> On Sun, Dec 11, 2011 at 3:37 PM, Brent Fraser <bfraser at geoanalytic.com 
> <mailto:bfraser at geoanalytic.com>> wrote:
>
>     Have a look at
>
>     http://www.geomoose.org/docs/feature_editor.html
>
>     Best Regards,
>     Brent Fraser
>
>
>     On 12/11/2011 1:24 PM, Atif Butt wrote:
>>     I got your point now, I was thinking it may be setup already.
>>     Any how from where you want me to start (any document reference
>>     or URL talking about delete and modify service  ), Or you suggest
>>     me to see the builtin service of geomoose (in relation to modify
>>     /delete polygon).
>>     Give me your suggestions
>>     Thanks and regards
>>     Atif
>>
>>     On Sun, Dec 11, 2011 at 3:18 PM, Brent Fraser
>>     <bfraser at geoanalytic.com <mailto:bfraser at geoanalytic.com>> wrote:
>>
>>         Atif,
>>
>>           The Feature Editor doc on the Geomoose site uses the
>>         results of the Identify operation to render a link to delete
>>         the selected feature.  Your mapbook creates a
>>         "delete_polygon" button on the tool bar referencing the a
>>         delete_polygon service:
>>
>>         <service name="delete_polygon">
>>         <url>php/editor.php</url>
>>         <step type="input">
>>         <input type="hidden" name="op" value="delete"/>
>>         <input type="hidden" name="table" value="test_polygons"/>
>>         <input type="hidden" name="feature:polygon_id"/>
>>         </step>
>>         </service>
>>
>>         Since your service has no spatial step (only a form input
>>         step), there is no way for the user to select the polygon to
>>         delete.
>>
>>           You need to look at the Feature Editor doc and get your
>>         editing functions working as documented first, then you would
>>         be in a better position to expand it by adding tool bar
>>         buttons to do delete and modify.
>>
>>         Best Regards,
>>         Brent Fraser
>>
>>
>>         On 12/11/2011 12:54 PM, Atif Butt wrote:
>>>         Hi Brent
>>>         I used the following code, for the identify.html file.
>>>         Kindly have a look.
>>>         http://141.117.248.26/geomoose2/geomoose.html
>>>         <!-- MapServer Template -->
>>>
>>>         <tr bgcolor="#AA55AA">
>>>
>>>         <td colspan="2"><b>[title] ([polygon_id])</b></td>
>>>
>>>         </tr>
>>>
>>>         <tr>
>>>
>>>         <td>Owner:</td><td>[owner]</td>
>>>
>>>         </tr>
>>>
>>>         <tr>
>>>
>>>         <td>
>>>
>>>         <a href="javascript:GeoMOOSE.startService('modify_polygon',
>>>         {'feature:polygon_id' :
>>>         '[polygon_id]','feature:wkb_geometry' : '[wkt_geometry]',
>>>         'feature:title' : '[title]', 'feature:owner' :
>>>         '[owner]'})">Edit</a>
>>>
>>>         </td>
>>>
>>>         <td>
>>>
>>>         <a href="javascript:if(confirm('Are you sure you want to
>>>         delete this?')) { GeoMOOSE.startService('delete_polygon',
>>>         {'feature:polygon_id' : '[polygon_id]'}); }">Delete</a>
>>>
>>>         </td>
>>>
>>>         </tr>
>>>
>>>         Secondly, why the above geomoose link can only be working
>>>         inside firefox, why not IE, and chrome, etc. Do you have any
>>>         idea ?
>>>
>>>         Best regards
>>>         Atif
>>>         On Wed, Dec 7, 2011 at 10:20 AM, Brent Fraser
>>>         <bfraser at geoanalytic.com <mailto:bfraser at geoanalytic.com>>
>>>         wrote:
>>>
>>>             Well the PHP is pretty simple for the delete:
>>>
>>>                 } else if($operation == 'delete') {
>>>                         if($feature_info[$primaryKeyColumn] < 1) {
>>>                                 print 'No Feature ID specified to
>>>             delete.<br/>';
>>>                                 die;
>>>                         }
>>>
>>>             So what that tells me is that the value passed from the
>>>             browser is <1.  Possibly your identity.html has a syntax
>>>             problem?  And what is the content of the "Delete" link
>>>             when you do an identify on the polygon?
>>>
>>>             Best Regards,
>>>             Brent Fraser
>>>
>>>
>>>             On 12/6/2011 11:03 PM, Atif Butt wrote:
>>>>
>>>>             Yes
>>>>
>>>>             this is my test_polygon.ini file settings
>>>>
>>>>             ; Basic Connection Information
>>>>                    host=localhost
>>>>                    dbname=postgis
>>>>                    username=postgres
>>>>                    password=xxxxxxx
>>>>
>>>>             ; Table Information
>>>>                    tablename=test_polygons
>>>>                    geometry_column=wkb_geometry
>>>>                    primary_key_column=polygon_id
>>>>                    primary_key_sequence=test_polygons_seq
>>>>                    srid=26915
>>>>
>>>>             ; Required Columns
>>>>             ; This is a comma separated list of columns required
>>>>             ; for creating or updating features in this layer
>>>>                   required_for_create=wkb_geometry,title
>>>>                   required_for_update=title
>>>>
>>>>             ; GeoMOOSE Information
>>>>                    layerpath=poly_editor/polygons
>>>>
>>>>
>>>>             Regards
>>>>             Atif
>>>>
>>>>
>>>>             On Tue, Dec 6, 2011 at 11:24 PM, Brent Fraser
>>>>             <bfraser at geoanalytic.com
>>>>             <mailto:bfraser at geoanalytic.com>> wrote:
>>>>
>>>>                 Do you have the primary_key_column defined in the
>>>>                 ini file?
>>>>
>>>>                 Best Regards,
>>>>                 Brent Fraser
>>>>
>>>>
>>>>                 On 12/6/2011 7:24 PM, Atif Butt wrote:
>>>>>
>>>>>                 Hi
>>>>>
>>>>>                 Is there any other steps needs to do (except
>>>>>                 written inside the feature editor document) for
>>>>>                 "polygon_update and ploygon_delete". Because after
>>>>>                 doing these steps, when I use update polygon
>>>>>                 feature I am getting this message (1No Feature ID
>>>>>                 available for update.) and when I use
>>>>>                 delete_polygon tool, it says "No Feature ID
>>>>>                 specified to delete."
>>>>>
>>>>>                 I think something is missing.
>>>>>
>>>>>                 kindly check
>>>>>                 (http://99.243.192.221/geomoose2/geomoose.html)
>>>>>                 and give me your suggestions.
>>>>>
>>>>>                 Best Regards
>>>>>
>>>>>                 Atif
>>>>>
>>>>>
>>>>>
>>>>>                 _______________________________________________
>>>>>                 Geomoose-users mailing list
>>>>>                 Geomoose-users at lists.osgeo.org  <mailto:Geomoose-users at lists.osgeo.org>
>>>>>                 http://lists.osgeo.org/mailman/listinfo/geomoose-users
>>>>
>>>>
>>>
>>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/geomoose-users/attachments/20111212/234229c8/attachment-0001.html


More information about the Geomoose-users mailing list