0

Let me give a bit of a background on what I have: I have 3 published layers using a SQL view as a DataSource. The reason for this is because I have a layer for points, lines, and polygons that all share the same "attributes". So I created one master feature table that contains all the shared properties, with an objectId and layerType field. I then created views for all 3 layers, joining on the objectId and the LayerType fields. This displays wonderfully as I would like it to, and using the MapServer REST API works as it should.

Now here is what I am trying to do: I would like to use the FeatureService REST API to add features (Add Features/Apply edits) on the main feature class which is not the layers dataSource. The layers are using the SQL view as DataSource so adding features are not supported, because it is not a table it is a SQL view.

The FeatureService works perfectly when I use the feature class as DataSource instead of the view, but this then forces me to duplicate all the properties on all my feature classes.

So is there a way to use the FeatureService or any other REST API to add an entry to the feature class table, when the table is not directly linked to published layer? Maybe using the ObjectClassId?

  • 1
    Unfortunately, putting all your geometries in a single table is an anti-pattern from which it is difficult to escape. You could have created three different feature classes and used a UNION ALL view to assemble the all-in-one look and feel. Now you need to choose between using existing tools and creating your own service to implement editing. – Vince Jun 7 at 11:36
  • Thanks @Vince, I do have 3 different tables for each feature (Point, Line, Polygon). The solution I am going with, is to have a different MapServer to manage the feature classes, and another mapServer to display it with the correct properties. – Darrelk Jun 10 at 13:31

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.