I'd like to serve out data from a PostGIS server and consume it as a layer in the ArcGIS JavaScript API. Searching for "arcgis javascript postgis" I see information on ArcGIS Desktop, ArcGIS Server and information on creating a FeatureLayer.

My experience with Esri is with ArcSDE from about 10 years ago. At this stage, I'm left with no obvious clues. Browsing the documentation, I found this page on Layers and Data. Looking at the Core Layer Types section, it looks like a FeatureLayer isn't what I'm looking for - my database will be on Amazon RDS, not in the ArcGIS cloud.

Is there a way to configure a layer in JavaScript that will point to my PostGIS server or is it a little more involved than that?

For example, I'm thinking that I could create a web service call that returns the data from the PostgreSQL database. I could then consume this data and generate a GraphicsLayer.

  • 1
    ArcGIS Server supports both Query Layers and Enterprise geodatabase geometry layers as Feature Service sources from PostgreSQL RDS databases; while it can be set up in a day and taught in a a few hours, it would very much qualify as "more involved than that." There are quite a few ways to accomplish this, but all of them qualify as involved. – Vince Nov 27 '19 at 0:48

You will need some sort of GIS server between your database and your JS application. You cannot (and should not) connect directly to your database via your frontend.

The classic setup when using ArcGIS Java Script API is to deploy an ArcGIS Server which connects to your database and renders the GIS data as MapService or FeatureService. Your JS application then makes calls to your GIS server and consumes these services.

If you don't want to, you do not have to use ArcGIS server. Other GIS servers such as GeoServer or any other server which can render GIS services would work as well.

  • I think you make a valid point. I need to figure out the best "how" for my circumstance, so I think I'll need to ask more specific questions! – Mitkins Dec 2 '19 at 0:11

Not the answer you're looking for? Browse other questions tagged or ask your own question.