Take the 2-minute tour ×
Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. It's 100% free, no registration required.

I have the following requirement.

I created a web application with User accounts. based on the User type I need to filter certain point layer with a selected cities region. Ie , when user log in, his accessible cities (city ids are retrieved from a db) will get. With these city IDs , select corresponding city geometries regions from the map. After doing an Union operation on all these polygons (city layer) , give resulting final polygon to a spatial Query filter , so that certain point layers need to be shown filtered by this polygon.

So that user can only see the his accessible points features filtered by cities regions.

I am using ArcGIS JS API V.3.3 with ArcGIS Server 10 Kindly please help me how can achieve this goal. Is a solution possible via REST API/ JS API? Geoprocessing solution also accepted.

Thanks in advance Shabeerali

share|improve this question
add comment

1 Answer 1

up vote 1 down vote accepted

I am not sure if there are easier alternatives available with the programming options, so I'd go personally for a geoprocessing (GP) service which I am most comfortable with. Suggested workflow is:

  1. Get the user name that is being logged in.
  2. The user name becomes an input for the Add Join GP tool to join the cities layer with the user name id. I guess this join can be precreated as well.
  3. Select only those cities features with the SQL query (where cities ID = x).
  4. Send the FeatureSet of the selected features to the client, so only the selected features will be drawn on the client side.

Another thing you might think of is to create individual views in the database, each of which would contain only those cities that every user could see (if you don't have very many). You would need to publish the services based on these views (or let them become created on-the-fly when the user will be logging in). Then you decide via the programming technique - what user is logged in and what map service should be added to the web application.

If you will upgrade any time to 10.1 SP1, then you could consider another solution that is ownership-based access. Basically, you can make the service return to the client only those features that the logged in user owns. This functionality was introduced in SP1. You would need then to create a field in the cities feature class and assign the user names to the "owner" column, so the service will use this field to see if a logged in user name matches the owner name and if yes, the features will be returned. Otherwise, client will just "not see" them.

share|improve this answer
    
Thanks, Your answer helped me a lot. I created a GP Service to retrieve necessary data as a Result Map Service. –  Shabeerali Apr 10 '13 at 14:57
    
Glad it worked out well :) –  Alex Tereshenkov Apr 10 '13 at 15:17
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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