query - sum areas of soil types within a polyline

query - sum areas of soil types within a polyline

annw2
Collaborator Collaborator
1,986 Views
16 Replies
Message 1 of 17

query - sum areas of soil types within a polyline

annw2
Collaborator
Collaborator

Work is slow & I am stumbling around with the Map functions.

 

I've got a CAD file with a closed drainage area poly line.

 

I did a map import with the closed polylines for the soils in the area.

 

I've got an FDO connection to the shape file that correctly labels the soil types.

  I can right click & show data table and have a table appear.

 

I want to queary and get a summation of the area of each soil type within the overall polyine.

 

Under the Map Explorer tab - I can add the location criteria of the overall poly line.  All the other tabs say no table exists when trying to get the data.

 

Under display manager, I got a filter to work that shows one of the soil types.

 

I can't seem to stumble around with either will let me determine the area.

Ann Wingert, P.E.
0 Likes
1,987 Views
16 Replies
Replies (16)
Message 2 of 17

parkr4st
Advisor
Advisor

ann

 

consider doing feature overlay  intersecton   source soils  overlay watershed  to a new sdf

 

in the sdf table do a calculation  Area 2d (Geometry) for a new field with the area of each polygonof soils in the watershed.

 

Thanks to Alfred a few days ago  watch the video  http://forums.autodesk.com/t5/autocad-map-3d-general/display-area-of-sql-spacial-geometry/td-p/55422...

 

https://www.youtube.com/watch?v=3Wo7xyiMnh4  if you haven't done that before.

 

you can then select all and export the data table to a .cvs and use spreadsheet or db to sort and sum the data.

 

dave

 

 

0 Likes
Message 3 of 17

annw2
Collaborator
Collaborator

The video doesn't help as it doesn't apply to what I am doing.

 

I did find an older YouTube video over the weekend that seemed to be what I wanted.  It involved using the Map Workspace data connect to connect a dwg with water main information with attributes and doing a sum. 2010

 

I am trying this morning and the first thing I find in 2014 is that the data connect doesnt' have a connect dwg option any more.

 

I've got a shape file I used the data connect feature for, but neither of the queary functions under map explorer or the display manager seems to be able to read the data from it.  I keep getting no table, even though the show data table shows the table.

 

I have no idea what the beginning of your reply means.  I am absolutely new at this.

 

 

 

Ann Wingert, P.E.
0 Likes
Message 4 of 17

parkr4st
Advisor
Advisor

Ann

 

Sorry for the confusion.  Making sure the question is understood. 

 

You desire to know what soils polygons or parts thereof are contained within the boundaries of a second polygon representing the closed drainage area?

 

You then want to sum area by soil soil type from the answer of the query?  Is that ok?

 

An intersection of the data sets results in a data set containing the soil polygons or parts of polygons in data set 1 that are within the 2nd polygon. 

 

The resulting layer represents what the Source and Overlay have in common.

 

Intersection is a type of overlay analysis.  It in help under Topology Overlay Analysis

 

The command is MapGisOverlay

 

This video from help

http://help.autodesk.com/view/clientframework/video/ooyala.html?embedCode=JwZnFnazrTfIHq4s7Y6zh7JIu9...

 

shows a good example.

 

I did a very similar routine with attached files for a project i am working on.  These are public domain data from New Hampshire GRANIT site.  Uses NH83F Coordinate system.  Your are welcome to experiment with the data.

 

SoilFarm  is soils in the town of Farmington, NH; HUD is a watershed; SoilFarm_Intersect is the soils in the watershed in Farmington.

 

The Area2(Geometry) calculation calculates the areas of the polygons in the new data set .

 

In the SoilFarm_Intersect data table I added a calculation Area2(Geometry) which calculates the area of each polygon in the data set into column AreaNew.  Next select a record in the table and Ctrl A  to select all records and Options>Export to a *.csv which you can open in a spreadsheet or DB program for further analysis.

 

You can further right click the Intersect layer in  Display Manager and select export layer data to SDF and create a new SDF file with the AreaNew column as part of the object data.  This data can now be worked with as you choose, mapimport to dwg objects with or without data, etc.

 

Hope this helps.  It took me awhile to catch on to this, so be patient, & post your questions.

 

dave

 

0 Likes
Message 5 of 17

annw2
Collaborator
Collaborator

Dave:

 

Still not there.

 

My area is a closed POLYLINE, ie. an AutoCAD drawing entity, not a database polygon.  I suppose I could do a MAPEXPORT, but it seems that would be an extra step.

 

The soils are a data connected shape file.

 

I also didn't see anything in the video about exporting a report, comma separated ASCII file or anything else.

 

I need the totals to import into an Excell spreadsheet.  The ASCII comma delineated file would work.

Ann Wingert, P.E.
0 Likes
Message 6 of 17

parkr4st
Advisor
Advisor

My area is a closed POLYLINE, ie. an AutoCAD drawing entity, not a database polygon.  I suppose I could do a MAPEXPORT, but it seems that would be an extra step.

 

If you don't have a fdo for this portion, try  IDM_METASK_CREATESDF (CREATE tab  sdf button on Feature Data Store panel) .  give it a file name and ok the GeoCoorSys & apply and ok.   (Command IDM_METASK_CREATESHP or select the SHP button if you want to go with a *.shp file type.)

 

the new sdf or shp will show up in Display manager, right click the layer name there and select  New feature from geometry, select your polygon, y or n  and done.  use that to do the intersection. Takes about ten seconds.

 

or rc and select   Create >New polygon feature if you need to draw the polygon from scratch.

 

 

 

 

also didn't see anything in the video about exporting a report, comma separated ASCII file or anything else.

 

To Export Data from the Data Table


You can export the data in the Data Table to a .csv (comma-separated text file) that can be opened in most spreadsheet applications.

To export from the Data Table
In the Data Table, select the rows of data to export.
From the Options list in the Data Table, select Export.  This at the bottom of the table
Save the .csv file to the specified name and folder

 

hth

 

dave

0 Likes
Message 7 of 17

annw2
Collaborator
Collaborator

Dave:

 

Will try this tomorrow.  The 2010 Facebook video had a report as one of the output modes on a query.  I tried following along on all his steps, but Map never gave me report as an option.  The button was greyed out and it only allowed drawing.

Ann Wingert, P.E.
0 Likes
Message 8 of 17

annw2
Collaborator
Collaborator

Dave:

 

The data table has absolutely no useful data in it.

 

I got this nice colored area on the screen, clipping the soils at the edge of the drainage area.  It seems to have erased all the field from the soils.

 

I have Id, FeatId_1 & FeatId_2 - I need the area of each of the soil types. 

 

The soil types were all stripped from the shape file.

Ann Wingert, P.E.
0 Likes
Message 9 of 17

parkr4st
Advisor
Advisor

I hate it when that happens.   Did you look at my data to see if the process worked in a similar fashion?

 

Can you attach your soil data file or a link to download it if it is public data?

 

dave

0 Likes
Message 10 of 17

annw2
Collaborator
Collaborator

I can apparently only do 3 files per reply.

 

Had a couple days of work that kept me from replying.

Ann Wingert, P.E.
0 Likes
Message 11 of 17

annw2
Collaborator
Collaborator

poly outer closed polyline to start and last 2 files of the soil shape files.

 

It didn't like the idx file so I renamed to txt.

Ann Wingert, P.E.
0 Likes
Message 12 of 17

parkr4st
Advisor
Advisor

ann

 

 

aoi such as soil web survey? 

If you did the SWS and didn't get data let me know how you tried it.  Maybe you missed a step?

 

I ran your aoi thru soil web survey and downloaded the soils data. Hope I got the right area of the country.  Tollgate Road in the central area?

 

your files did no show data attached to the polygons

 

attached .sdf has data attached.  Give it a try.  you can mapimport and mapexport if you want a .shp file.

 

open the data table and add a calculation    AreaAcres     Area2D ( Geometry ) /43560

 

that will give you the area in acres.  you can modify the equaiton to give the units you want to work with.

 

 

Dave

0 Likes
Message 13 of 17

annw2
Collaborator
Collaborator

No that doesn't help.  It doesn't have the MU symbols.

 

I stumbled around with the map tutorials and got  a data table to show up with the soil types.  I tried a calculation to get it to show the area of each soil polygon.

 

I stumbled through and did the interect clip function to clip the soil polygons at the outer edge.

 

I then selected all and exported the cvs  file.  

 

Unfortunately, the areas did not total to the drainage area.

 

I tried again and the areas provided were completely different than the first calculation.

 

So Map doesn't know know to determine the area of the closed poly lines.?

 

 

Ann Wingert, P.E.
0 Likes
Message 14 of 17

annw2
Collaborator
Collaborator

did you get all 6 files?

Ann Wingert, P.E.
0 Likes
Message 15 of 17

parkr4st
Advisor
Advisor

did you get all 6 files?

 

no.  only the .dwg

 

 

 

 

 

 

 

0 Likes
Message 16 of 17

annw2
Collaborator
Collaborator

I'm sorry.  I meant on the previous upload.  The shape files have the soil types when I bring them in.

Ann Wingert, P.E.
0 Likes
Message 17 of 17

annw2
Collaborator
Collaborator

I just discovered that the file I uploaded was the correct answer.  The second 'calculated' column in the data table calculated correctly and summed correctly.  I could have swoen I did the exact same thing both times.

 

Thank you for your help.  And there is no button to check problem solved in this window.

Ann Wingert, P.E.
0 Likes