Select to view content in your preferred language

help beginner.

1064
6
Jump to solution
09-17-2013 08:56 AM
GianfrancoOliva
Emerging Contributor
Hello, I'm new to arcgis and also in Javascript API. I need to do a project in which I have a connection to Oracle SDE and I managed to publish my service (MapServer, FeatureServer). My problem is that I'm storing my data (polygon) based on the type of cordinates. (WGS84, UTM Zone PSAD and 17S, 18S, 19S). The objetive of this project is to publish all the information so that users can query based on metadata. I want to know what kind of sevice I use: MapServer, FeatureServer, etc. Please I need to be guided.

Thank you.
0 Kudos
1 Solution

Accepted Solutions
KenBurcham
Deactivated User
For your first question, yes, you can do that.  When you want to display just the features in each featurelayer with a specific CODE then you would just iterate over the layers you've defined and call "setDefinitionExpression" with a query like "CODE = 'value'".  It will then display just those features that match the query.  Here is a link to the documentation: https://developers.arcgis.com/en/javascript/jsapi/featurelayer-amd.html#setdefinitionexpression

For your second question, I don't know!  🙂  Maybe someone with more experience with that can chime in.  I'm sure you can do a query by geometry from one service to the other, but maybe there's a way to do it more elegantly.  Perhaps this feature would be helpful: https://developers.arcgis.com/en/javascript/jsapi/intersectinggeographies-amd.html  It also has a link to samples.

Good luck!

ken.

View solution in original post

0 Kudos
6 Replies
KenBurcham
Deactivated User
Hi boss182,

  Welcome!  I think you'll find plenty to get you started by going to the developer page and exploring the samples.  There's a sample that demonstrates how to do queries on a feature class here https://developers.arcgis.com/en/javascript/jssamples/fl_paging.html for example, and there are others.  Please take a look at that and see if that gets you going!

  The main sample page with the query samples can be found here: https://developers.arcgis.com/en/javascript/jssamples/#query_and_select

Good luck!

ken.
0 Kudos
GianfrancoOliva
Emerging Contributor
Thank you for your prompt response kenburcham,

Actually I researched a lot and I've noticed that my problem is not to be a programmer javascript API. My main problem is to establish my data model. Maybe not make it clear, I have currently shapefiles and each in a different coordinate system. then what I want is to establish a data model and then make my queries in javascript. I know I use FEATURE DATASET, FEATURECLASS, ETC, but I've never modeled geographic data and not know it.

Thank you very much.
0 Kudos
KenBurcham
Deactivated User
boss182,

If I understand, I think your next step is to move your shapefiles into a geodatabase and then publish them as services. 

To do that you'll need to use ArcMap to create a geodatabase on a database server (or maybe you have one already and just need to import those shapefiles?) and then create a map that uses those feature classes.  Then you can publish that map as a service that will contain those features and make them available as services on your ArcGIS Server. 

Alternatively to all of that, you can use ArcGIS Online if you have a subscription.  Once you have those magic services available, then you can write your javascript to consume them and do wonderful things.  🙂

Hope that helps!  Feel free to explain more of what you need if I'm off the mark.

Good luck!

ken.
0 Kudos
GianfrancoOliva
Emerging Contributor
Thank you,

Clearly your tips are very helpful.

I have two more questions:

1 - I have a service with three layers (polygons, lines and points), all have a metadata field in common (CODE). That way I can make a query so that search achieve the three layers and I return the results found in each layer. (Make query with multiple layers of different geometries)

2 - I have the need to load a shapefile, which may contain a Point or Polygon. This geometry obtained from the shapefile to be cross with my service and stated in order to get all geometries that intersect. You must create a geoprocessing service?

Again, thank you very much.
0 Kudos
KenBurcham
Deactivated User
For your first question, yes, you can do that.  When you want to display just the features in each featurelayer with a specific CODE then you would just iterate over the layers you've defined and call "setDefinitionExpression" with a query like "CODE = 'value'".  It will then display just those features that match the query.  Here is a link to the documentation: https://developers.arcgis.com/en/javascript/jsapi/featurelayer-amd.html#setdefinitionexpression

For your second question, I don't know!  🙂  Maybe someone with more experience with that can chime in.  I'm sure you can do a query by geometry from one service to the other, but maybe there's a way to do it more elegantly.  Perhaps this feature would be helpful: https://developers.arcgis.com/en/javascript/jsapi/intersectinggeographies-amd.html  It also has a link to samples.

Good luck!

ken.
0 Kudos
GianfrancoOliva
Emerging Contributor
Thank you very much for help I certainly have been very useful.
0 Kudos