Node.js (version >=14.0.0) should be installed
-
First of all, spin up the database
docker-compose up
-
Secondly, we need to load the shapefiles to the database. Modify the variables inside
loadShapeFile.py
, and then run itpython3 loadShapeFile.py
-
cd
into theAPI
directory and start the server (The backend server could easily be combined with the docker-comose file)
npm i
npm run build
npm start
If test_shapefile.zip
shape file is loaded properly, the following url would return a GeoJSON response
http://localhost:3000/delineated-fields?long=11.185365749239793&lat=60.749728158409454
Comments are missing in the code
Logging is not implemented
Error has to be handled centrally and properly, which is completely missing
Anything that is coming from outside has to validated and different status code has to returned as required. Validation has to handled away from the main code block.
Combine the node.js server with the database in docker-compose file, so that we could easily spip-up the app.
Sadiqur Rahman