AnsweredAssumed Answered

Creating a webmapping application that connects to database

Question asked by cesium133 on May 10, 2019
Latest reply on Apr 17, 2020 by aniessen-esristaff

Hi all, 


I'm trying to create a web mapping application that lets users submit data from a map interface to a database existing server-side. I'm wondering if anyone could guide me through the basic design of this client-server architecture. I'm a relative beginner to full-stack web GIS development, so any help is appreciated!


What am I trying to do? 

I want to build a webmap that allows the user to do these tasks:

1) draw polygons on the map to choose areas

2) fill out a form on the side panel related to the polygon that was created. User inputs information into form and submits it. 

When the form is submitted, the polygon data is automatically submitted with it. This data is then recorded into a table in database existing on a server. 

I would also like to retrieve this data from the database and put it back on the map for a separate part of the application. 


What ideas do I have so far? 

I'm using the ArcGIS API for JavaScript to create the webmap. I think the best way to submit the drawn polygons to the database would be to convert them to GeoJSON and then submit it as a string to a new column in the table. But how do I do this? Is there a way in the JS API to convert the polygons that are drawn using the Sketch widget to GeoJSON?

Or is there a way to utilize some tool like GeoServer for this, and not go the GeoJSON route? 

And after this step, how do I submit this form and polygon data to the Postgres database? I was thinking of using PHP and PDO



Any ideas or tips on how to go about designing this app?