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'm want to get the lines of a polygon and then get the length of each line, I'm looking on how to do this, Can anyone show me some code? Does anyone have any pointers on how to do this?

I'm using ArcGis Server 9.3.1 and Visual Studio .NET. Thanks.

share|improve this question
    
When you say "the measure of each line" do you mean M values or the length? –  Kirk Kuykendall Jan 7 '11 at 15:55
    
I mean the length –  eiefai Jan 7 '11 at 16:00
    
Where is the polygon - on the server in a featureclass, or on the client app only? –  Kirk Kuykendall Jan 7 '11 at 16:08
    
Is in a feature class in the server –  eiefai Jan 7 '11 at 16:19

2 Answers 2

I'd use the REST api to formulate a url like this: http://sampleserver1.arcgisonline.com/ArcGIS/rest/services/Specialty/ESRI_StateCityHighway_USA/MapServer/1/query?text=New+York&outSR=102113&f=pjson

And use either the Silverlight/WPF sdk or Json.NET to parse the rings out of the geometry, and sum up their lengths.

share|improve this answer
    
do you have a sample code that I can look at? –  eiefai Jan 7 '11 at 17:36

Given the coordinates of the polygon (in order), you can use the formula found here to calculate the distance for each line in the polygon.

share|improve this answer
    
yeah, we tryied that but I need the length in meters, what I'm trying now is to call the measure function and pass two points as parameters, still no luck. –  eiefai Jan 8 '11 at 15:43
    
Are the coordinates of the 2 points in meters? Can you attach your code? –  Seth P. Jan 10 '11 at 1:26

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.