Select to view content in your preferred language

How to add new polygon to Arcgis Server from Node.js Server

626
4
Jump to solution
10-28-2022 11:27 PM
EmrahAydemir
New Contributor III

Hi, i have a nodejs server and its working on postgis database. More than a hundred polygons are added to this database daily. Can I also add this geometry data from my Nodejs server to my layer on my Arcgis Server?

0 Kudos
1 Solution

Accepted Solutions
Scott_Tansley
MVP Regular Contributor

Well, it's the way I've done it, and most of the Esri community for many years, so I would say yes.  

ArcGIS Server 'reads' data sources.  You are not putting data into ArcGIS Server.  We put data into a database or geodatabase and then ArcGIS Server reads it from the source.  This is the most fundamental and simple thing that an ArcGIS Server does.  Have a read of this:

https://pro.arcgis.com/en/pro-app/latest/help/sharing/overview/publish-a-map-service.htm 

It may be that I'm misunderstanding your question, but if you have data in a database, then ArcGIS Pro can connect to it and read it (query layer).  You then publish that mapx document to the ArcGIS Server, which as long as permissions and drivers are in place, then it will just work.  

 

Scott Tansley
https://www.linkedin.com/in/scotttansley/

View solution in original post

0 Kudos
4 Replies
Scott_Tansley
MVP Regular Contributor

Yes.  You have two choices.

1)  You can create a query layer inside of ArcGIS Pro:  https://pro.arcgis.com/en/pro-app/latest/help/mapping/layer-properties/what-is-a-query-layer-.htm  

After you've set the properties (visualization etc) of this, then you can publish that as a Map Image Layer.  The Map Image Layer will query the underlying PostGIS database with each request, so each request shows the latest and most up-to-date view of the data.  You will need to configure the server/database to have appropriate permissions.  You will also need to create a Data Store entry in ArcGIS Server Manager.  This is not a connection per se, it's just more of a test to prove that the server and database can communicate.  The connection is handled by publishing the document.

2)  You could look to use the Hosted Feature Service option.  This has a RESTful specification and node.js could form the correct payload and post it to the feature service.  However, this would not be reading your postgis database directly, and so there could be fun and games if they get out of sync. 

Personally, I'd explore option 1 in the first instance.

 

Scott Tansley
https://www.linkedin.com/in/scotttansley/
0 Kudos
EmrahAydemir
New Contributor III

Hi, is option 1 exactly the answer to this question? If so it will save me a huge problem. https://community.esri.com/t5/arcgis-enterprise-questions/how-to-get-geometry-data-from-external-dat...

0 Kudos
Scott_Tansley
MVP Regular Contributor

Well, it's the way I've done it, and most of the Esri community for many years, so I would say yes.  

ArcGIS Server 'reads' data sources.  You are not putting data into ArcGIS Server.  We put data into a database or geodatabase and then ArcGIS Server reads it from the source.  This is the most fundamental and simple thing that an ArcGIS Server does.  Have a read of this:

https://pro.arcgis.com/en/pro-app/latest/help/sharing/overview/publish-a-map-service.htm 

It may be that I'm misunderstanding your question, but if you have data in a database, then ArcGIS Pro can connect to it and read it (query layer).  You then publish that mapx document to the ArcGIS Server, which as long as permissions and drivers are in place, then it will just work.  

 

Scott Tansley
https://www.linkedin.com/in/scotttansley/
0 Kudos
EmrahAydemir
New Contributor III

its worked thank you so much