Select to view content in your preferred language

Creating buffer using geometry service through flex api

2960
7
08-15-2012 03:37 AM
NadeemQazi
Regular Contributor
Hi
I am new to flex API programming , I have a map having several layer i have published it on my ARCGIS Server and I can also access using flex API in mxml file. However i want to apply now buffer operation giving on of my layer as input along with distance in meters. I have done it using Python with buffer_analysis method but now i need to do it using FLEX api for my browser application. I have searched on net and understand the following:
1. I need to create and  published a geometery service on my ARCGIS server
2.then need to access this geometry service using url in my .mxml file in flex
3. then i need to use buffer method of Geometry service object with Bufferparameter as object.
My questions are:
When I create a Geometry service what should it contain on the server.
how can i pass the name of my input layer to the buffer parameter object
how can i pass the name of my out put layer to the buffer parameter object.
Any help is highly appreciated. If some body know any tutorial link for using geometry service in flex api please let me know.
Regards
Nadeem
Tags (2)
0 Kudos
7 Replies
RobertScheitlin__GISP
MVP Emeritus
Nadeem,

When I create a Geometry service what should it contain on the server. There is no options or user defined parameters. All you do is create the service and it is done.
how can i pass the name of my input layer to the buffer parameter object. You do not pass layers to the buffer operation you pass geometries and get back geometries.
how can i pass the name of my out put layer to the buffer parameter object. You do not pass layers to the buffer operation you pass geometries and get back geometries.

Use the Buffer sample to understand better:

http://resources.arcgis.com/en/help/flex-api/samples/01nq/01nq0000002q000000.htm

Don't forget to click the Mark as answer check on this post and to click the top arrow (promote).
Follow the steps as shown in the below graphic:
0 Kudos
NadeemQazi
Regular Contributor
Nadeem,

When I create a Geometry service what should it contain on the server. There is no options or user defined parameters. All you do is create the service and it is done.
how can i pass the name of my input layer to the buffer parameter object. You do not pass layers to the buffer operation you pass geometries and get back geometries.
how can i pass the name of my out put layer to the buffer parameter object. You do not pass layers to the buffer operation you pass geometries and get back geometries.

Use the Buffer sample to understand better:

http://resources.arcgis.com/en/help/flex-api/samples/01nq/01nq0000002q000000.htm

Don't forget to click the Mark as answer check on this post and to click the top arrow (promote).
Follow the steps as shown in the below graphic:

 

Thanks Robert. Please note that my input features for this buffer operation is in a shape file , so in that case how would i pass this shape file as input. This data in this shape file is for polygon having one entry in the attribute table with following fields.
fid, shape, area in hectre and other fields.
Nadeem

Regards
Nadeem
0 Kudos
RobertScheitlin__GISP
MVP Emeritus
Nadeem,

   It is not likely that you will be operating with a shapefile on the client, unless you are working with the shapefile that has all of it's related file in a zip or something... When you are working in Flex API code you are dealing mainly with client side code and server calls. I sounds like you might want to start focusing on a GP service or a published model. As far as using a geometry service and making a buffer request to that service you will not get dealing with shapefiles, you will be dealing with individual geometries.
0 Kudos
NadeemQazi
Regular Contributor
Nadeem,

   It is not likely that you will be operating with a shapefile on the client, unless you are working with the shapefile that has all of it's related file in a zip or something... When you are working in Flex API code you are dealing mainly with client side code and server calls. I sounds like you might want to start focusing on a GP service or a published model. As far as using a geometry service and making a buffer request to that service you will not get dealing with shapefiles, you will be dealing with individual geometries.


Thanks Robert, Can I have more advice from you. Actually what i want is that when user click a map area than i want to show a buffer area around the user clicked area. my application would be running on web so what is your suggestion to use in this case GP or geometeries
0 Kudos
RobertScheitlin__GISP
MVP Emeritus
Nadeem,

    Well in the scenario you described you would have a mapclick which produces a MapPoint geometry and that is the geometry that is used in the buffer operation and then when the buffer is done it returns you a polygon geometry of the actual buffer and you can use that in a query task to return the features that intersect that polygon. The sample link I provided earlier will get you started using the drawTool and instead of using a polygon you would just use a point. Then there are several API samples for doing queries.
0 Kudos
NadeemQazi
Regular Contributor
Nadeem,

    Well in the scenario you described you would have a mapclick which produces a MapPoint geometry and that is the geometry that is used in the buffer operation and then when the buffer is done it returns you a polygon geometry of the actual buffer and you can use that in a query task to return the features that intersect that polygon. The sample link I provided earlier will get you started using the drawTool and instead of using a polygon you would just use a point. Then there are several API samples for doing queries.


thnx, I had a look to the code, it says it requires 10.1 while i am using 10.0 , how to use it on arcgis 10.0
0 Kudos
RobertScheitlin__GISP
MVP Emeritus
Nadeem,

   The basic concept of setting up the bufferparameters in code are still the same.

http://resources.arcgis.com/en/help/flex-api/apiref/com/esri/ags/tasks/supportClasses/BufferParamete...
0 Kudos