I am new to this domain of GeoInformation development. I am following the below pipeline architecture flow to achieve a GIS-based application problem.
PostGIS - GeoServer - Leaflet
I have set up my leaflet client application which composes tiles to a map. I am also using some leaflet plugins (like Draw, zoom) in order to give users the option to mark and to draw on the map.
I am able to draw and get the GeoJSON features of the drawn polygon as shown below:
I am stuck after this part of figuring how do I need to send the polygon request drawn and retrieve the polygon (which is saved) programmatically. I know the answer is WFS-T, but how do I use this in my raw code. Here is the raw code example:
Raw Code link: https://pastebin.com/wCAHxVc0Follow the link
References:
The best way to understand WFS-T is using GeoServer Demo option (Link: http://localhost:8080/geoserver/web/wicket/bookmarkable/org.geoserver.web.demo.DemoRequestsPage?5). The main problem for me was to figure out how do I insert and update transaction details. Exploring GeoServer Demo gave me the solution to it.
Here is a sample example:
This XML request can later be used to send to GeoServer for manipulation using AJAX call as shown below:
For better understanding with an application scenario of WFS-T, try following this URL: https://georepublic.info/en/blog/2012/leaflet-example-with-wfs-t/. This should help you get started with WFS-T. Happy map editing :)